tpwrules / nixos-apple-silicon

Resources to install NixOS bare metal on Apple Silicon Macs
MIT License
791 stars 82 forks source link

Erro building m1n1 #2

Closed dejanr closed 2 years ago

dejanr commented 2 years ago

Hi,

great work with packaging all this together.

Unfortunately for me building m1n1 doesn't work, i am getting this:

ecking if the linker (/private/tmp/nix-build-aarch64-unknown-linux-gnu-stage-final-gcc-debug-11.2.0.drv-0/build/./gcc/collect-ld) is GNU ld... (cached) yes
checking for shared libgcc... yes
configure: versioning on shared library symbols is gnu
configure: updating cache ./config.cache
checking for CET support... no
checking that generated files are newer than configure... done
configure: error: conditional "ENABLE_DARWIN_AT_RPATH" was never defined.
Usually this means the macro was only invoked conditionally.
make[1]: *** [Makefile:16550: configure-target-libatomic] Error 1
checking that generated files are newer than configure... done
configure: error: conditional "ENABLE_DARWIN_AT_RPATH" was never defined.
Usually this means the macro was only invoked conditionally.
make[1]: *** [Makefile:15634: configure-target-libgomp] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-aarch64-unknown-linux-gnu-stage-final-gcc-debug-11.2.0.drv-0/build'
make: *** [Makefile:974: all] Error 2
error: builder for '/nix/store/m0fhn8c51q9qjshi7y9m56yl3pif91d1-aarch64-unknown-linux-gnu-stage-final-gcc-debug-11.2.0.drv' failed with exit code 2;
       last 10 log lines:
       > checking that generated files are newer than configure... done
       > configure: error: conditional "ENABLE_DARWIN_AT_RPATH" was never defined.
       > Usually this means the macro was only invoked conditionally.
       > make[1]: *** [Makefile:16550: configure-target-libatomic] Error 1
       > checking that generated files are newer than configure... done
       > configure: error: conditional "ENABLE_DARWIN_AT_RPATH" was never defined.
       > Usually this means the macro was only invoked conditionally.
       > make[1]: *** [Makefile:15634: configure-target-libgomp] Error 1
       > make[1]: Leaving directory '/private/tmp/nix-build-aarch64-unknown-linux-gnu-stage-final-gcc-debug-11.2.0.drv-0/build'
       > make: *** [Makefile:974: all] Error 2
       For full logs, run 'nix log /nix/store/m0fhn8c51q9qjshi7y9m56yl3pif91d1-aarch64-unknown-linux-gnu-stage-final-gcc-debug-11.2.0.drv'.
error: 1 dependencies of derivation '/nix/store/0y5qy1pn3lm4xbgq15002vh3dgqk114y-aarch64-unknown-linux-gnu-stage-final-gcc-debug-wrapper-11.2.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/rgjwzj4kb6w722ld004x6i89a3wqvryz-m1n1-unstable-2022-03-27.drv' failed to build 
dejanr commented 2 years ago

Seems to work fine on my x86 machine.

tpwrules commented 2 years ago

It looks like you are trying to build on Darwin but there’s an issue somewhere in Nixpkgs with building the compiler. Is the x86 machine Darwin or Linux? I know it builds on x86 Linux and am 99% sure it builds on aarch64 Linux.

I don’t claim support for using Nix on Darwin to build any of this. But m1n1 can be built on Darwin upstream so it would be nice to fix this issue. I think it uses clang, and the issue here is with building a component of GCC, so maybe the derivation will have to be modified.

dejanr commented 2 years ago

Thanks, will close this for the time being, and let see if i can nail down and improve the derivation for darwin. Best. Dejan.