With a completely fresh install of OS X 10.11, nixpkgs.gcc6, nixpkgs.gcc46, nixpkgs.gcc48, nixpkgs.gcc49 and nixpkgs.gcc fail to build. In fact, I've been unable to get any gcc package to build successfully. I tried before and after installing XCode and the command line tools, and regenerating the locate database with no changes in the results.
Attempting nix-env -iA nixpkgs.gcc6 results in the following error:
ld: library not found for -lc
collect2: error: ld returned 1 exit status
Makefile:945: recipe for target 'libgcc_s.dylib' failed
make[3]: *** [libgcc_s.dylib] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/private/var/folders/mt/c_dppb2s51bbvm3yy67mns080000gn/T/nix-build-gcc-6.1.0.drv-0/build/x86_64-apple-darwin15.5.0/libgcc'
and
make[3]: Leaving directory '/private/var/folders/mt/c_dppb2s51bbvm3yy67mns080000gn/T/nix-build-gcc-6.1.0.drv-0/build/x86_64-apple-darwin15.5.0/libgcc'
Makefile:14906: recipe for target 'all-stage1-target-libgcc' failed
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory '/private/var/folders/mt/c_dppb2s51bbvm3yy67mns080000gn/T/nix-build-gcc-6.1.0.drv-0/build'
Makefile:19116: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/private/var/folders/mt/c_dppb2s51bbvm3yy67mns080000gn/T/nix-build-gcc-6.1.0.drv-0/build'
Makefile:19420: recipe for target 'bootstrap' failed
make: *** [bootstrap] Error 2
yet locate libc.dylib returns
/nix/store/d6pmsgblamr0wfvpdzikv8xnlfs5sjym-Libsystem-osx-10.9.5/lib/libc.dylib
/nix/store/w090w1675pg26kcwj7ka9f42c0a87wg9-Libsystem-osx-10.9.5/lib/libc.dylib
/usr/lib/libc.dylib
nix-env -i nixpkgs.gcc6 on OS X 10.11.
So, you should be able to build it on the latest Git master version, but it looks like there's some issue on Hydra:
I ran a nix-channel --update today and then re-ran nix-env -iA nixpkgs.gcc6, and it got further in the installation process, but it finished with this error:
installing ‘gcc-wrapper-6.1.0’
building path(s) ‘/nix/store/mc7nx4j4y4ffyf1i97nn91skl5bak37l-user-environment’
Wide character in die at /nix/store/64jc9gd2rkbgdb4yjx3nrgc91bpjj5ky-buildenv.pl line 87.
error creating link ‘/nix/store/mc7nx4j4y4ffyf1i97nn91skl5bak37l-user-environment/share’: File exists at /nix/store/64jc9gd2rkbgdb4yjx3nrgc91bpjj5ky-buildenv.pl line 87.
builder for ‘/nix/store/j9lw52i3km4f4ghrnlilnyzh2a5sxb8n-user-environment.drv’ failed with exit code 17
error: build of ‘/nix/store/j9lw52i3km4f4ghrnlilnyzh2a5sxb8n-user-environment.drv’ failed
Any ideas?
For me it fails trying to do some odd variable name substitution in setup.sh:
building path(s) ‘/nix/store/bix7wn2c1cy4bmcpm6558cac7z10z5dh-gcc-wrapper-6.1.0’
WARNING: substitution variables should be valid bash names,
"ccLDFlags+" isn't and therefore was skipped; it might be caused
by multi-line phases in variables - see #14907 for details.
WARNING: substitution variables should be valid bash names,
"ccCFlags+" isn't and therefore was skipped; it might be caused
by multi-line phases in variables - see #14907 for details.
...
Just tried this and gcc6 compiles fine for me on 10.11.6. @rprechelt: Can you confirm this is not an issue anymore?
@knedlsepp It compiles fine if you have the "Command Line Tools" installed. If you don't (which includes Hydra), it fails with
The directory that should contain system headers does not exist:
/usr/include
I've got it working in #18327 but it's not a very elegant solution.
We fixed this in recent master I believe.
Most helpful comment
@knedlsepp It compiles fine if you have the "Command Line Tools" installed. If you don't (which includes Hydra), it fails with
I've got it working in #18327 but it's not a very elegant solution.