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

pkgsCross.gnu64.bash fails to build on x86_64-linux #243164

Open
ghost opened this issue Jul 12, 2023 · 6 comments
Open

pkgsCross.gnu64.bash fails to build on x86_64-linux #243164

ghost opened this issue Jul 12, 2023 · 6 comments
Labels
0.kind: bug Something is broken 6.topic: cross-compilation Building packages on a different platform than they will be used on

Comments

@ghost
Copy link

ghost commented Jul 12, 2023

Describe the bug

At current master, this fails:

nix build pkgsCross.gnu64.bash --system x86_64-linux

Screenshots

$ git rev-parse HEAD
ba448b056b5dcd97eb875596a0962912771a2bdf

$ nix build -f . -L pkgsCross.gnu64.bash
bash> configure flags: --disable-static --prefix=/nix/store/cygrphwqmv7lmcgdk53m76sw4zp8c5f0-bash-5.2-p15-x86_64-unknown-linux-gnu --bindir=/nix/store/cygrphwqmv7lmcgdk53m76sw4zp8c5f0-bash-5.2-p15-x86_64-unknown-linux-gnu/bin --sbindir=/nix/store/cygrphwqmv7lmcgdk53m76sw4zp8c5f0-bash-5.2-p15-x86_64-unknown-linux-gnu/sbin --includedir=/nix/store/fq5ifn83r9y7qzfrabj2pcsqj8i5mri2-bash-5.2-p15-x86_64-unknown-linux-gnu-dev/include --oldincludedir=/nix/store/fq5ifn83r9y7qzfrabj2pcsqj8i5mri2-bash-5.2-p15-x86_64-unknown-linux-gnu-dev/include --mandir=/nix/store/bbvqpyzvxf92spv70ds2dah3fjkaxwi5-bash-5.2-p15-x86_64-unknown-linux-gnu-man/share/man --infodir=/nix/store/j957krj8qlfzawp30i45w99lr0jrxzm9-bash-5.2-p15-x86_64-unknown-linux-gnu-info/share/info --docdir=/nix/store/rwmvr3pc2r7hfhzny28yhdr0vaq2zamx-bash-5.2-p15-x86_64-unknown-linux-gnu-doc/share/doc/bash --libdir=/nix/store/cygrphwqmv7lmcgdk53m76sw4zp8c5f0-bash-5.2-p15-x86_64-unknown-linux-gnu/lib --libexecdir=/nix/store/cygrphwqmv7lmcgdk53m76sw4zp8c5f0-bash-5.2-p15-x86_64-unknown-linux-gnu/libexec --localedir=/nix/store/cygrphwqmv7lmcgdk53m76sw4zp8c5f0-bash-5.2-p15-x86_64-unknown-linux-gnu/share/locale --disable-readline bash_cv_job_control_missing=nomissing bash_cv_sys_named_pipes=nomissing bash_cv_getcwd_malloc=yes --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu
bash> configure: WARNING: unrecognized options: --disable-static
bash> checking build system type... x86_64-unknown-linux-gnu
bash> checking host system type... x86_64-unknown-linux-gnu
bash> Beginning configuration for bash-5.2-release for x86_64-unknown-linux-gnu
bash> checking for x86_64-unknown-linux-gnu-gcc... x86_64-unknown-linux-gnu-gcc
bash> checking whether the C compiler works... no
bash> configure: error: in `/build/bash-5.2':
bash> configure: error: C compiler cannot create executables
bash> See `config.log' for more details

From config.log:

configure:4363: $? = 1
configure:4383: checking whether the C compiler works
configure:4405: x86_64-unknown-linux-gnu-gcc    conftest.c  >&5
/nix/store/zsvpmlddl2i5mpzm031a99xfpn410m5b-binutils-2.40/bin/ld: cannot find crt1.o: No such file or directory
/nix/store/zsvpmlddl2i5mpzm031a99xfpn410m5b-binutils-2.40/bin/ld: cannot find crti.o: No such file or directory
/nix/store/zsvpmlddl2i5mpzm031a99xfpn410m5b-binutils-2.40/bin/ld: cannot find -lgcc_s: No such file or directory
collect2: error: ld returned 1 exit status
@ghost ghost added the 0.kind: bug Something is broken label Jul 12, 2023
@ghost ghost linked a pull request Jul 12, 2023 that will close this issue
12 tasks
@ghost ghost removed a link to a pull request Jul 12, 2023
12 tasks
@TomMD
Copy link

TomMD commented Sep 18, 2023

This particular issue might be fixed by #238154. Regardless, it is not a problem with latest nixpkgs.

@FliegendeWurst
Copy link
Member

Can confirm: not a problem with recent nixpkgs.

@FliegendeWurst FliegendeWurst added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Oct 31, 2023
@ghost
Copy link
Author

ghost commented Nov 2, 2023

The fix came from

Unfortunately that PR caused other problems; we're no longer able to use lib.warn to deprecate anything in the platform objects, like e.g.

The fix-for-the-fix is in

@ghost
Copy link
Author

ghost commented Nov 2, 2023

Note that the fix isn't really complete. If you cross-compile between two platforms that have the same .config triple but aren't ==-equal (for example you added a -march= or -mtune= compiler flag) you'll still hit this bug.

@ghost
Copy link
Author

ghost commented Nov 2, 2023

I don't think this bug was really fixed; it was merely papered over.

See

@ghost ghost reopened this Nov 2, 2023
@ghost ghost mentioned this issue Nov 3, 2023
13 tasks
@ghost ghost self-assigned this Nov 4, 2023
@ghost
Copy link
Author

ghost commented Nov 4, 2023

The fix is

but it causes a mass rebuild and we don't have enough staging cycles left before 23.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: cross-compilation Building packages on a different platform than they will be used on
Projects
None yet
Development

No branches or pull requests

2 participants