micropython: update to 1.9.4.

This commit is contained in:
Christian Buschau 2019-01-12 23:32:29 +01:00 committed by maxice8
parent dbe6d7b58e
commit f810fa4a09
3 changed files with 78 additions and 35 deletions

View File

@ -0,0 +1,64 @@
Source: https://github.com/micropython/micropython/commit/c97607db5ccc03afbccacf853f2cd06305c28251
Upstream: Yes
Reason: mpy-cross segfaults on i686
commit c97607db5ccc03afbccacf853f2cd06305c28251
Author: Damien George <damien.p.george@gmail.com>
Date: Tue May 15 11:17:28 2018 +1000
py/nlrx86: Use naked attribute on nlr_push for gcc 8.0 and higher.
gcc 8.0 supports the naked attribute for x86 systems so it can now be used
here. And in fact it is necessary to use this for nlr_push because gcc 8.0
no longer generates a prelude for this function (even without the naked
attribute).
diff --git py/nlrx86.c py/nlrx86.c
index 23882cc30..59b97d8ee 100644
--- py/nlrx86.c
+++ py/nlrx86.c
@@ -39,15 +39,29 @@ unsigned int nlr_push_tail(nlr_buf_t *nlr) asm("nlr_push_tail");
__attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr);
#endif
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8
+// Since gcc 8.0 the naked attribute is supported
+#define USE_NAKED (1)
+#define UNDO_PRELUDE (0)
+#elif defined(__ZEPHYR__) || defined(__ANDROID__)
+// Zephyr and Android use a different calling convention by default
+#define USE_NAKED (0)
+#define UNDO_PRELUDE (0)
+#else
+#define USE_NAKED (0)
+#define UNDO_PRELUDE (1)
+#endif
+
+#if USE_NAKED
+__attribute__((naked))
+#endif
unsigned int nlr_push(nlr_buf_t *nlr) {
+ #if !USE_NAKED
(void)nlr;
+ #endif
__asm volatile (
- // Check for Zephyr, which uses a different calling convention
- // by default.
- // TODE: Better support for various x86 calling conventions
- // (unfortunately, __attribute__((naked)) is not supported on x86).
- #if !(defined(__ZEPHYR__) || defined(__ANDROID__))
+ #if UNDO_PRELUDE
"pop %ebp \n" // undo function's prelude
#endif
"mov 4(%esp), %edx \n" // load nlr_buf
@@ -61,7 +75,9 @@ unsigned int nlr_push(nlr_buf_t *nlr) {
"jmp nlr_push_tail \n" // do the rest in C
);
+ #if !USE_NAKED
return 0; // needed to silence compiler warning
+ #endif
}
NORETURN void nlr_jump(void *val) {

View File

@ -1,20 +0,0 @@
--- py/emitglue.c 2018-12-20 16:15:21.717553255 +0100
+++ py/emitglue.c 2018-12-20 16:14:34.210702965 +0100
@@ -403,7 +403,7 @@
// here we define mp_raw_code_load_file depending on the port
// TODO abstract this away properly
-#if defined(__i386__) || defined(__x86_64__) || (defined(__arm__) && (defined(__unix__)))
+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__) || (defined(__arm__) && (defined(__unix__)))
// unix file reader
#include <sys/stat.h>
@@ -637,7 +637,7 @@
// here we define mp_raw_code_save_file depending on the port
// TODO abstract this away properly
-#if defined(__i386__) || defined(__x86_64__) || (defined(__arm__) && (defined(__unix__)))
+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__) || (defined(__arm__) && (defined(__unix__)))
#include <unistd.h>
#include <sys/stat.h>

View File

@ -1,30 +1,29 @@
# Template file for 'micropython' # Template file for 'micropython'
pkgname=micropython pkgname=micropython
version=1.7 version=1.9.4
revision=2 revision=1
build_wrksrc=unix build_wrksrc=ports/unix
hostmakedepends="pkg-config python" hostmakedepends="pkg-config python"
makedepends="libffi-devel readline-devel" makedepends="libffi-devel"
short_desc="Implementation of Python 3.x for microcontrollers" short_desc="Implementation of Python 3.x for microcontrollers"
maintainer="Juan RP <xtraeme@voidlinux.org>" maintainer="Juan RP <xtraeme@voidlinux.org>"
license="MIT" license="MIT"
homepage="http://micropython.org/" homepage="https://micropython.org/"
distfiles="http://github.com/micropython/micropython/archive/v${version}.tar.gz" distfiles="https://github.com/micropython/micropython/releases/download/v${version}/micropython-${version}.tar.gz"
checksum=ad44d28700d346ceb9a70ae92d36306d42e187fc1af19fa2c7a3ab7dc18742ef checksum=0db042011bffcbd65362b67eb3cca87eaefa9f2a55b747fa75e922c706b8ce1a
case "$XBPS_TARGET_MACHINE" in
aarch64*) broken="https://build.voidlinux.eu/builders/aarch64-musl_builder/builds/2215/steps/shell_3/logs/stdio";;
esac
pre_configure() { pre_configure() {
sed -i 's|-Werror||;/^COPT =/d' Makefile sed -i 's|-Werror||;/^COPT =/d' Makefile
} }
do_build() { do_build() {
make V=1 CC=$CC CFLAGS_EXTRA="$CPPFLAGS $CFLAGS" \ unset CPP
LDFLAGS_EXTRA="$LDFLAGS" STRIP=echo make -C ../../mpy-cross V=1 STRIP=echo ${makejobs}
make V=1 CC=${CC} CFLAGS_EXTRA="${CPPFLAGS} ${CFLAGS}" \
LDFLAGS_EXTRA="${LDFLAGS}" STRIP=echo ${makejobs} axtls all
} }
do_install() { do_install() {
vbin micropython vbin micropython
vbin ../tools/pip-micropython vlicense ../../LICENSE
vlicense ../LICENSE
} }