Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

lfdebrux
Copy link
Contributor

General

Have the results of the proposed changes been tested?

  • I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
  • I generally don't use the affected packages but briefly tested this PR

Does it build and run successfully?

(Please choose at least one native build and, if supported, at least one cross build. More are better.)

  • I built this PR locally for my native architecture, (x86_64-musl)
  • I built this PR locally for these architectures (if supported. mark crossbuilds):
    • aarch64-musl
    • armv7l
    • armv6l-musl
    • armv5tel-musl

Copy link
Member

@ericonr ericonr left a 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 ;;
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor Author

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)

Copy link
Member

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.

Copy link
Member

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).

Copy link
Contributor Author

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.
@ericonr ericonr closed this in 8483b59 Feb 14, 2021
hazayan pushed a commit to hazayan/void-packages that referenced this pull request Feb 28, 2021
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]
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants