-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
micropython: update to 1.14 #28708
micropython: update to 1.14 #28708
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please squash the commits into a single one as well :)
|
||
case "$XBPS_TARGET_MACHINE" in | ||
armv5tel-musl) nopie=yes ;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might (almost definitely) be a bug you want to report to musl folks. Can you show a stack trace / disassembly output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lfdebrux can you check if their build system doesn't simply disable PIC? By passing -fno-PIC
to the compiler, for example. If that's the case, what can happen is that it interacts badly with our PIE by default toolchain, and creates a text relocation in the binary. Musl doesn't support those at all.
You can check for their presence with readelf -d <binary>
and seeing if TEXTREL appears in the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like they disable PIC; what's weird is that it works fine on x86_64-musl with PIE, but doesn't on armv5tel-musl, which as you say does point towards it being a bug in musl.
Here's a stacktrace from gdb
(gdb) start
Temporary breakpoint 1 at 0x90f0: file main.c, line 421.
Starting program: /usr/bin/micropython
Program received signal SIGSEGV, Segmentation fault.
0xb6fb68c0 in do_relocs () from /lib/ld-musl-arm.so.1
(gdb) backtrace
#0 0xb6fb68c0 in do_relocs () from /lib/ld-musl-arm.so.1
#1 0xb6fb6c88 in reloc_all () from /lib/ld-musl-arm.so.1
#2 0xb6fb900c in __dls3 () from /lib/ld-musl-arm.so.1
#3 0xb6fb867c in __dls2 () from /lib/ld-musl-arm.so.1
#4 0xb6fb569c in _dlstart () from /lib/ld-musl-arm.so.1
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems it also segfaults on armv6l :P
I will try to determine which platforms we have to enable nopie
for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0x00000016 (TEXTREL) 0x0
As suspected :) So not really a bug on musl's side, though it would be nice if an error message were added.
This might be due to their assembly code somewhere, though I couldn't find it. Weirdly, Alpine disables armv7l
as a target because tests don't pass, and even armhf
(which is equivalent to our armv6l) because it doesn't build (it might simply be outdated, of course).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting. With nopie
that isn't present. Sorry I can't be more helpful, I'm a bit out my depth!
Additionally, use nopie on armv5tel-musl: On armv5tel-musl micropython crashes with a SEGV in musl's do_relocs() function. Disabling PIE fixes this.
e755c66
to
466bd90
Compare
Additionally, use nopie on arm*-musl, otherwise the resulting binary contains text relocations, which aren't supported by musl. Closes: void-linux#28708 [via git-merge-pr]
General
Have the results of the proposed changes been tested?
Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)