-
-
Notifications
You must be signed in to change notification settings - Fork 14.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
Fix GHC bootstrap in pkgsMusl and include patch for binutils/16177 #103183
Conversation
@ofborg build pkgsMusl.haskellPackages.hello |
cc @Ericson2314 as maintainer for binutils |
Mass rebuild so open this against staging, please |
14efdb2
to
fceffbe
Compare
Oops, changed the target branch in github and the whole world got requested for reviews, sorry! |
@expipiplus1 Don't worry about it, that's just what happens 🤷 |
If I revert the gdb change then |
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.
I added two requests to add comments, sounds great otherwise.
9bc9132
to
b70bf82
Compare
@nh2 I've added the comments as suggested Also, while doing this I realize that this patch will break the i686 build! I've added some small amount of complexity to only use ncurses6 on x86_64. |
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.
Also, while doing this I realize that this patch will break the i686 build! I've added some small amount of complexity to only use ncurses6 on x86_64.
Just to understand, why is that? Does ncurses6
not work on i686?
It doesn't compile with the changes as before for i686, I guess because it's still using the deb9 version which is linked with ncurses5. There's no fedora27 version for i686. |
@expipiplus1 Ah, please add that as a comment as well -- "upstream does not provide a version" is a good justification. @bgamari Do you think there should be a fedora27 version for i686, or should this stay with ncurses5? |
Is there even an i686 release of fedora27? |
x86_64-linux Ben Gamari's patch from NixOS#85924. Fixes NixOS#85924, allowing one to bootstrap GHC in `pkgsMusl` `nix-build -A pkgsMusl.haskellPackages.hello` succeeds with this patch.
…d=16177 This bug was preventing one compiling Haskell programs from `pkgsMusl` for armv7. `nix-build --argstr crossSystem "armv7l-linux" -A pkgsMusl.haskellPackages.hello` succeeds with this patch. The patch is Nick Clifton's one, rebased by @Ericson2314 here https://sourceware.org/bugzilla/show_bug.cgi?id=16177#c6 Although there was some talk about the efficacy of the binutils patch (https://sourceware.org/bugzilla/show_bug.cgi?id=16177#c9) the resulting binary seems to run without issue on the target platform. Jessica's patch there caused ld to fail linking some programs. Nick's proposed patch has worked well in my testing so far (a Haskell project of some small complexity cross compiled with musl to armv7).
@nh2, done |
b70bf82
to
b3640e0
Compare
I think they dropped kernel support with fedora31, but I'm not sure I get the whole picture there: https://fedoramagazine.org/in-fedora-31-32-bit-i686-is-86ed/ |
@cdepillabout Good to go? The comment you requested has been added. I'm not quite sure if all your questsions from #103183 (comment) are addressed. |
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 looks good, thanks for fleshing out the comments!
First of all, thank you for the PRs! I still seem to fail compiling statically due to gdb, whether with the earliest revision containing both PRs EDIT: By both PRs, I mean this one, and #104201 Configuring in ./gdb
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../opcodes -I. -I../../opcodes -I../bfd -I../../opcodes/../include -I../../opcodes/../bfd -I./../intl -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -g -O2 -MT disassemble.lo -MD -MP -MF .deps/disassemble.Tpo -c -DARCH_all ../../opcodes/disassemble.c -o disassemble.o
mkdir -p -- ./libctf
Configuring in ./libctf
/nix/store/nz8dyqljf2xwacml7jivafpqqajh15jj-binutils-2.31.1/bin/ld: ax-ipa.o: in function `ax_printf(unsigned long, unsigned long, char const*, int, unsigned long*) [clone .isra.0]':
/build/gdb-10.1/_build/gdbserver/../../gdbserver/ax.cc:928: undefined reference to `libintl_gettext'
/nix/store/nz8dyqljf2xwacml7jivafpqqajh15jj-binutils-2.31.1/bin/ld: /build/gdb-10.1/_build/gdbserver/../../gdbserver/ax.cc:837: undefined reference to `libintl_gettext'
/nix/store/nz8dyqljf2xwacml7jivafpqqajh15jj-binutils-2.31.1/bin/ld: /build/gdb-10.1/_build/gdbserver/../../gdbserver/ax.cc:889: undefined reference to `libintl_gettext'
/nix/store/nz8dyqljf2xwacml7jivafpqqajh15jj-binutils-2.31.1/bin/ld: ax-ipa.o: in function `gdb_eval_agent_expr(eval_agent_expr_context*, agent_expr*, unsigned long*)':
/build/gdb-10.1/_build/gdbserver/../../gdbserver/ax.cc:1334: undefined reference to `libintl_gettext'
/nix/store/nz8dyqljf2xwacml7jivafpqqajh15jj-binutils-2.31.1/bin/ld: gdbsupport/common-utils-ipa.o: in function `xstrvprintf(char const*, __va_list_tag*)':
/build/gdb-10.1/_build/gdbserver/../../gdbserver/../gdbsupport/common-utils.cc:57: undefined reference to `libintl_gettext'
/nix/store/nz8dyqljf2xwacml7jivafpqqajh15jj-binutils-2.31.1/bin/ld: gdbsupport/common-utils-ipa.o:/build/gdb-10.1/_build/gdbserver/../../gdbserver/../gdbsupport/common-utils.cc:69: more undefined references to `libintl_gettext' follow
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:389: libinproctrace.so] Error 1
(...non-error lines...)
make[2]: Leaving directory '/build/gdb-10.1/_build/gdbserver'
make[1]: *** [Makefile:9365: all-gdbserver] Error 2
(...non-error lines...)
make: *** [Makefile:854: all] Error 2
builder for '/nix/store/lay3ilkzal9qsr2k9nbyxm38x1p5cd8k-gdb-10.1.drv' failed with exit code 2
building '/nix/store/v66vfzmg640vgljbq3w61xsyjn1blaqp-cmake-3.19.1.drv'...
cannot build derivation '/nix/store/cbi55fccyxivc6g1nrkh029r4yzdjwfx-python3.8-Cython-0.29.21.drv': 1 dependencies couldn't be built Is it the same problem? Or is it a different problem? |
@talw that looks different, can you make a separate issue if this still exists? |
@matthewbauer should we backport this? |
I see. I guess it is something different. Thanks! |
@talw If you can tell me how to reproduce (best even directly with a |
Thanks @nh2 For reference here is the message I wrote and deleted shortly after (to which you replied):
What I realized shortly after is that while the gdb is different and fails to compile, even without The PRs are #104201 and this one #103183 The revision I chose is simply the earliest one to contain both PRs. To reproduce: $ nix-build --show-trace --no-out-link -E "(import (fetchTarball \"https://github.com/NixOS/nixpkgs/archive/15b3bc33064eeb0cba743cad585c829b6694669c.tar.gz\") {}).pkgsMusl.gdb"
...abbreviated...
/nix/store/zkpjbbicsqa36sg6jb7fcg5qlahcx2na-binutils-2.31.1/bin/ld: ax-ipa.o: in function `ax_printf(unsigned long, unsigned long, char const*, int, unsigned long*) [clone .isra.0]':
/build/gdb-10.1/_build/gdbserver/../../gdbserver/ax.cc:928: undefined reference to `libintl_gettext'
/nix/store/zkpjbbicsqa36sg6jb7fcg5qlahcx2na-binutils-2.31.1/bin/ld: /build/gdb-10.1/_build/gdbserver/../../gdbserver/ax.cc:837: undefined reference to `libintl_gettext'
/nix/store/zkpjbbicsqa36sg6jb7fcg5qlahcx2na-binutils-2.31.1/bin/ld: /build/gdb-10.1/_build/gdbserver/../../gdbserver/ax.cc:889: undefined reference to `libintl_gettext'
/nix/store/zkpjbbicsqa36sg6jb7fcg5qlahcx2na-binutils-2.31.1/bin/ld: ax-ipa.o: in function `gdb_eval_agent_expr(eval_agent_expr_context*, agent_expr*, unsigned long*)':
/build/gdb-10.1/_build/gdbserver/../../gdbserver/ax.cc:1334: undefined reference to `libintl_gettext'
/nix/store/zkpjbbicsqa36sg6jb7fcg5qlahcx2na-binutils-2.31.1/bin/ld: gdbsupport/common-utils-ipa.o: in function `xstrvprintf(char const*, __va_list_tag*)':
/build/gdb-10.1/_build/gdbserver/../../gdbserver/../gdbsupport/common-utils.cc:57: undefined reference to `libintl_gettext'
/nix/store/zkpjbbicsqa36sg6jb7fcg5qlahcx2na-binutils-2.31.1/bin/ld: gdbsupport/common-utils-ipa.o:/build/gdb-10.1/_build/gdbserver/../../gdbserver/../gdbsupport/common-utils.cc:69: more undefined references to `libintl_gettext' follow
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:389: libinproctrace.so] Error 1
...abbreviated...
make[2]: Leaving directory '/build/gdb-10.1/_build/gdbserver'
make[1]: *** [Makefile:9365: all-gdbserver] Error 2
...abbreviated...
make: *** [Makefile:854: all] Error 2
builder for '/nix/store/9ly1l78ggcd6nlhs1c81ilw6x83zc2py-gdb-10.1.drv' failed with exit code 2
error: build of '/nix/store/9ly1l78ggcd6nlhs1c81ilw6x83zc2py-gdb-10.1.drv' failed |
Motivation for this change
This allows one to cross compile statically linked Haskell programs for armv7
Fixes #85924 using Ben's patch from there. A similar patch should probably be applied to ghc8102-binary.
Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=16177 by applying the patch mentioned there.
Although there was some talk about the efficacy of the binutils patch (https://sourceware.org/bugzilla/show_bug.cgi?id=16177#c9 and expipiplus1/nixpkgs@14efdb2) the resulting binary seems to run without issue on the target platform. Jessica's patch there caused ld to fail linking some programs.
It would be good if there was some resolution to the discussion on the binutils ticket, however this does seem to be an improvement over the broken state of things at the moment.
Obviously this would require rebuilding everything Haskell, and everything on armv7.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)