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

gcc fails to build on OS X #16806

Closed
rprechelt opened this issue Jul 9, 2016 · 6 comments
Closed

gcc fails to build on OS X #16806

rprechelt opened this issue Jul 9, 2016 · 6 comments
Labels
0.kind: bug Something is broken 6.topic: darwin Running or building packages on Darwin

Comments

@rprechelt
Copy link

rprechelt commented Jul 9, 2016

Issue description

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

Steps to reproduce

nix-env -i nixpkgs.gcc6 on OS X 10.11.

Technical details

  • System: OS X 10.11 - completely fresh install (wiped, and then reinstalled)
  • Nix version: nix-env (Nix) 1.11.2
  • Nixpkgs version: 16.09pre83147.df89584
@vcunat vcunat added 6.topic: darwin Running or building packages on Darwin 0.kind: bug Something is broken labels Jul 9, 2016
@matthewbauer
Copy link
Member

So, you should be able to build it on the latest Git master version, but it looks like there's some issue on Hydra:

http://hydra.nixos.org/build/37137502/nixlog/2/tail-reload

@rprechelt
Copy link
Author

rprechelt commented Jul 22, 2016

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?

@knedlsepp
Copy link
Member

knedlsepp commented Jul 31, 2016

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

See: #14907

@knedlsepp
Copy link
Member

Just tried this and gcc6 compiles fine for me on 10.11.6. @rprechelt: Can you confirm this is not an issue anymore?

@matthewbauer
Copy link
Member

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

@matthewbauer
Copy link
Member

We fixed this in recent master I believe.

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: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

4 participants