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

nixpkgs.gcc fails to build on OS X #6148

Closed
tel opened this issue Feb 4, 2015 · 29 comments
Closed

nixpkgs.gcc fails to build on OS X #6148

tel opened this issue Feb 4, 2015 · 29 comments
Labels
6.topic: darwin Running or building packages on Darwin

Comments

@tel
Copy link
Contributor

tel commented Feb 4, 2015

Full log is here. Abbreviated it's

$ nix-env -iA nixpkgs.gcc 2> gcc.log

[...]

building libstdc++-symbols.explist
perl /private/var/folders/lj/655x29_s66718hvw6bdcvy1w0000gn/T/nix-build-gcc-4.8.4.drv-0/gcc-4.8.4/libstdc++-v3/scripts/make_exports.pl \
  libstdc++-symbols.ver \
  .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o \
 `echo  ../libsupc++/libsupc++convenience.la ../src/c++98/libc++98convenience.la ../src/c++11/libc++11convenience.la | \
    sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
 > libstdc++-symbols.explist || (rm -f libstdc++-symbols.explist ; exit 1)
nm -P .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o ../libsupc++/.libs/libsupc++convenience.a ../src/c++98/.libs/libc++98convenience.a ../src/c++11/.libs/libc++11convenience.a|Can't exec "c++filt": No such file or directory at /nix/store/j56d7hhhshcykma3bbfsb5zih8ckyqwm-perl-5.20.1/lib/perl5/5.20.1/IPC/Open3.pm line 280.
open2: exec of c++filt -_ failed at /private/var/folders/lj/655x29_s66718hvw6bdcvy1w0000gn/T/nix-build-gcc-4.8.4.drv-0/gcc-4.8.4/libstdc++-v3/scripts/make_exports.pl line 95.
warning: nm: no name list
warning: nm: no name list
make[6]: *** [libstdc++-symbols.explist] Error 1
make[6]: Leaving directory `/private/var/folders/lj/655x29_s66718hvw6bdcvy1w0000gn/T/nix-build-gcc-4.8.4.drv-0/build/x86_64-apple-darwin14.1.0/libstdc++-v3/src'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/private/var/folders/lj/655x29_s66718hvw6bdcvy1w0000gn/T/nix-build-gcc-4.8.4.drv-0/build/x86_64-apple-darwin14.1.0/libstdc++-v3/src'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/private/var/folders/lj/655x29_s66718hvw6bdcvy1w0000gn/T/nix-build-gcc-4.8.4.drv-0/build/x86_64-apple-darwin14.1.0/libstdc++-v3'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/private/var/folders/lj/655x29_s66718hvw6bdcvy1w0000gn/T/nix-build-gcc-4.8.4.drv-0/build/x86_64-apple-darwin14.1.0/libstdc++-v3'
make[2]: *** [all-stage1-target-libstdc++-v3] Error 2
make[2]: Leaving directory `/private/var/folders/lj/655x29_s66718hvw6bdcvy1w0000gn/T/nix-build-gcc-4.8.4.drv-0/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/private/var/folders/lj/655x29_s66718hvw6bdcvy1w0000gn/T/nix-build-gcc-4.8.4.drv-0/build'
make: *** [bootstrap] Error 2
builder for ‘/nix/store/2hykvq6nlbcjkvgz757lb729slslgk6r-gcc-4.8.4.drv’ failed with exit code 2
cannot build derivation ‘/nix/store/0bq7kidq56r16gvj8xx07wwsnrpb72mc-gcc-wrapper-4.8.4.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/0bq7kidq56r16gvj8xx07wwsnrpb72mc-gcc-wrapper-4.8.4.drv’ failed
@copumpkin
Copy link
Member

Yeah, building gcc is kind of tricky on recent Mac OS, I think. It's on our todo list.

@copumpkin
Copy link
Member

On the other hand, if it's just a missing c++filt, we can provide that easily.

@tel
Copy link
Contributor Author

tel commented Feb 4, 2015

I think that may be sufficient. I wasn't sure how to get nix to drop me into the proper shell to poke around, so the best I've got is the log.

@tel
Copy link
Contributor Author

tel commented Feb 4, 2015

nix-shell '<nixpkgs>' -A gcc is what I thought would work, but it tries to compile gcc first, fails, and then drops me back in my normal shell.

@domenkozar domenkozar added the 6.topic: darwin Running or building packages on Darwin label Feb 5, 2015
@gridaphobe
Copy link
Contributor

@tel nix-shell '<nixpkgs>' -A gcc will put you in a shell for gcc-wrapper, which requires a fully-built gcc. Try nix-shell '<nixpkgs>' -A gcc.cc instead.

@tel
Copy link
Contributor Author

tel commented Feb 11, 2015

@gridaphobe Thanks, worked perfectly!

@copumpkin I haven't completed the build yet, but it does look like all that's needed is to drop a c++filt in.

@tel
Copy link
Contributor Author

tel commented Feb 11, 2015

Build completed with no errors. checkPhase failed, though

check flags: SHELL=/nix/store/gyf26bzshpjzv5vs1xlk1ykj9r6j6r5q-bash-4.3-p33/bin/bash SHELL=/nix/store/gyf26bzshpjzv5vs1xlk1ykj9r6j6r5q-bash-4.3-p33/bin/bash SHELL=/nix/store/gyf26bzshpjzv5vs1xlk1ykj9r6j6r5q-bash-4.3-p33/bin/bash  CFLAGS_FOR_BUILD=-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks CFLAGS_FOR_TARGET=-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks FLAGS_FOR_TARGET=-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks
make[1]: Entering directory `/Users/tel/tmp/gcc-4.8.4'
make[2]: Entering directory `/Users/tel/tmp/gcc-4.8.4/host-x86_64-apple-darwin14.1.0/fixincludes'
autogen -T ../.././fixincludes/check.tpl ../.././fixincludes/inclhack.def
/nix/store/gyf26bzshpjzv5vs1xlk1ykj9r6j6r5q-bash-4.3-p33/bin/bash: autogen: command not found
make[2]: *** [check] Error 127
make[2]: Leaving directory `/Users/tel/tmp/gcc-4.8.4/host-x86_64-apple-darwin14.1.0/fixincludes'
make[1]: *** [check-fixincludes] Error 2
make[1]: Leaving directory `/Users/tel/tmp/gcc-4.8.4'
make: *** [do-check] Error 2

Not sure if that matters.

@copumpkin
Copy link
Member

@tel cool! I also put some time against gcc4.8 on pure-darwin, and encountered more issues. It looks like the purification phase that tells gcc not to look in system include directories doesn't work properly on darwin, and I put that work on pause for other reasons.

In the meantime, I'd be happy to merge any changes you've found were necessary. Also note that the gnu binutils (containing c++filt among other things) work on pure-darwin now.

@tel
Copy link
Contributor Author

tel commented Feb 11, 2015

I'm not sure of what a proper fix would be. The current gcc derivation includes a notion of binutils but only for cross compilation

  buildInputs = [ gmp mpfr libmpc libelf ]
    ++ (optional (cloog != null) cloog)
    ++ (optional (isl != null) isl)
    ++ (optional (zlib != null) zlib)
    ++ (optionals langJava [ boehmgc zip unzip ])
    ++ (optionals javaAwtGtk ([ gtk libart_lgpl ] ++ xlibs))
    ++ (optionals (cross != null) [binutilsCross])
    ++ (optionals langAda [gnatboot])
    ++ (optionals langVhdl [gnat])

I'm not sure what that means, exactly. Is the right resolution to just add binutils directly? Should this be a Darwin flag?

@copumpkin
Copy link
Member

No, the real issue is copumpkin#53, I think.

@tel
Copy link
Contributor Author

tel commented Feb 12, 2015

Hm, well I'll patch it personally by just adding binutils I suppose. I think with this fix I'll get ghcjs and be able to ditch my experiments in js_of_ocaml, haha.

@copumpkin
Copy link
Member

If you just want ghcjs, I think the dependency on gcc is spurious. Check hoogle for an unnecessary dependency on it?

On Feb 12, 2015, at 11:40, Joseph Abrahamson notifications@github.com wrote:

Hm, well I'll patch it personally by just adding binutils I suppose. I think with this fix I'll get ghcjs and be able to ditch my experiments in js_of_ocaml, haha.


Reply to this email directly or view it on GitHub.

@tel
Copy link
Contributor Author

tel commented Feb 12, 2015

Hoogle has this info? I was wondering about it being possibly unnecessary, but I'm not sure how to track back derivations to determine where deps are being pulled in except by hand.

@copumpkin
Copy link
Member

No, I mean that the hoogle package expression at some point had a spurious gcc dependency, and the ghcjs bundle included hoogle.

@Profpatsch
Copy link
Member

(triage) might be solved already?

@matthewbauer
Copy link
Member

@Profpatsch it will build if you have the command line tools installed. It's not ideal, but if someone really needs gcc it may be helpful.

@copumpkin
Copy link
Member

Huh, so it's impure? 😢

@matthewbauer
Copy link
Member

matthewbauer commented Sep 1, 2016

^ Yeah, it's confusing though because it gets pretty far in its bootstrapping then spits out this:

if [ -d ../prev-gcc ]; then \
  cd ../prev-gcc && \
  make real-install-headers-tar DESTDIR=`pwd`/../gcc/ \
    libsubdir=. ; \
else \
  set -e; for ml in `cat fixinc_list`; do \
    sysroot_headers_suffix=`echo ${ml} | sed -e 's/;.*$//'`; \
    multi_dir=`echo ${ml} | sed -e 's/^[^;]*;//'`; \
    fix_dir=include-fixed${multi_dir}; \
    if ! false && test ! -d `echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`; then \
      echo The directory that should contain system headers does not exist: >&2 ; \
      echo "  `echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`" >&2 ; \
      tooldir_sysinc=`echo "/nix/store/snh0ydmnwr34zmdri4gzhl56x1pra610-gcc-5.4.0/lib/gcc/x86_64-apple-darwin15.2.0/5.4.0/../../../../x86_64-apple-darwin15.2.0/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \
      if test "x`echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`" = "x${tooldir_sysinc}"; \
      then sleep 1; else exit 1; fi; \
    fi; \
    /nix/store/psyci5sp00dixlnm1f5z0maq2zn12qai-bash-4.3-p46/bin/bash ../../gcc-5.4.0/gcc/../mkinstalldirs ${fix_dir}; \
    chmod a+rx ${fix_dir} || true; \
    (TARGET_MACHINE='x86_64-apple-darwin15.2.0'; srcdir=`cd ../../gcc-5.4.0/gcc; ${PWDCMD-pwd}`; \
      SHELL='/nix/store/psyci5sp00dixlnm1f5z0maq2zn12qai-bash-4.3-p46/bin/bash'; MACRO_LIST=`${PWDCMD-pwd}`/macro_list ; \
      gcc_dir=`${PWDCMD-pwd}` ; \
      export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
      cd ../build-x86_64-apple-darwin15.2.0/fixincludes && \
      /nix/store/psyci5sp00dixlnm1f5z0maq2zn12qai-bash-4.3-p46/bin/bash ./fixinc.sh "${gcc_dir}/${fix_dir}" \
        `echo /usr/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`  ); \
    rm -f ${fix_dir}/syslimits.h; \
    if [ -f ${fix_dir}/limits.h ]; then \
      mv ${fix_dir}/limits.h ${fix_dir}/syslimits.h; \
    else \
      cp ../../gcc-5.4.0/gcc/gsyslimits.h ${fix_dir}/syslimits.h; \
    fi; \
    chmod a+r ${fix_dir}/syslimits.h; \
  done; \
fi
The directory that should contain system headers does not exist:
  /usr/include

http://hydra.nixos.org/build/39395200/nixlog/2/raw

@copumpkin
Copy link
Member

I wonder what broke it. It worked in a pure environment for a while...

@matthewbauer
Copy link
Member

I think it has broke around April: http://hydra.nixos.org/build/39409734. It might have been related to the closure size stuff: http://hydra.nixos.org/api/scmdiff?type=git&uri=https%3A%2F%2Fgithub.com%2FNixOS%2Fnixpkgs.git&rev1=81cedab4f1fe9578e004ce03de5630a25c737a9e&rev2=39ebb01d6e8d19b042fe65d303234d0db27877eb.

I ended up adding the "--disable-bootstrap" flag in gcc because that's the only way to get it to compile. Perhaps that flag is inherently impure? I'm trying to build it now without that flag but if I recall it gives some very unclear error.

@matthewbauer
Copy link
Member

Here's the output without --disable-bootstrap:

In file included from /private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/bits/stringfwd.h:40:0,
                 from /private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:39,
                 from /nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:34,
                 from /nix/store/kia5ixq75mj3668mmm87dvb1maylj22p-isl-0.14.1/include/isl/val_gmp.h:4,
                 from ../../gcc-5.4.0/gcc/graphite-isl-ast-to-gimple.c:35:
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/bits/memoryfwd.h:63:3: error: template with C linkage
   template<typename>
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/bits/memoryfwd.h:66:3: error: template specialization with C linkage
   template<>
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/bits/memoryfwd.h:70:3: error: template with C linkage
   template<typename, typename>
   ^
In file included from /private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:39:0,
                 from /nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:34,
                 from /nix/store/kia5ixq75mj3668mmm87dvb1maylj22p-isl-0.14.1/include/isl/val_gmp.h:4,
                 from ../../gcc-5.4.0/gcc/graphite-isl-ast-to-gimple.c:35:
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/bits/stringfwd.h:52:3: error: template with C linkage
   template<class _CharT>
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/bits/stringfwd.h:55:3: error: template specialization with C linkage
   template<> struct char_traits<char>;
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/bits/stringfwd.h:58:3: error: template specialization with C linkage
   template<> struct char_traits<wchar_t>;
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/bits/stringfwd.h:69:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT>,
   ^
In file included from /private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:40:0,
                 from /nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:34,
                 from /nix/store/kia5ixq75mj3668mmm87dvb1maylj22p-isl-0.14.1/include/isl/val_gmp.h:4,
                 from ../../gcc-5.4.0/gcc/graphite-isl-ast-to-gimple.c:35:
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/bits/postypes.h:111:3: error: template with C linkage
   template<typename _StateT>
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/bits/postypes.h:214:3: error: template with C linkage
   template<typename _StateT>
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/bits/postypes.h:219:3: error: template with C linkage
   template<typename _StateT>
   ^
In file included from /nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:34:0,
                 from /nix/store/kia5ixq75mj3668mmm87dvb1maylj22p-isl-0.14.1/include/isl/val_gmp.h:4,
                 from ../../gcc-5.4.0/gcc/graphite-isl-ast-to-gimple.c:35:
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:76:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT> >
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:79:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT> >
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:82:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT> >
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:85:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT> >
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:88:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT> >
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:94:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT>,
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:98:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT>,
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:102:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT>,
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:106:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT>,
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:112:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT> >
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:115:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT> >
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:118:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT> >
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:121:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT> >
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:124:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT> >
   ^
/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/prev-x86_64-apple-darwin15.6.0/libstdc++-v3/include/iosfwd:127:3: error: template with C linkage
   template<typename _CharT, typename _Traits = char_traits<_CharT> >
   ^
In file included from /nix/store/kia5ixq75mj3668mmm87dvb1maylj22p-isl-0.14.1/include/isl/val_gmp.h:4:0,
                 from ../../gcc-5.4.0/gcc/graphite-isl-ast-to-gimple.c:35:
/nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:2283:71: error: conflicting declaration of C function 'std::ostream& operator<<(std::ostream&, mpq_srcptr)'
 __GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpq_srcptr);
                                                                       ^
/nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:2282:33: note: previous declaration 'std::ostream& operator<<(std::ostream&, mpz_srcptr)'
 __GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpz_srcptr);
                                 ^
/nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:2284:71: error: conflicting declaration of C function 'std::ostream& operator<<(std::ostream&, mpf_srcptr)'
 __GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpf_srcptr);
                                                                       ^
/nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:2283:33: note: previous declaration 'std::ostream& operator<<(std::ostream&, mpq_srcptr)'
 __GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpq_srcptr);
                                 ^
/nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:2284:71: error: conflicting declaration of C function 'std::ostream& operator<<(std::ostream&, mpf_srcptr)'
 __GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpf_srcptr);
                                                                       ^
/nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:2282:33: note: previous declaration 'std::ostream& operator<<(std::ostream&, mpz_srcptr)'
 __GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpz_srcptr);
                                 ^
/nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:2286:68: error: conflicting declaration of C function 'std::istream& operator>>(std::istream&, mpq_ptr)'
 __GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpq_ptr);
                                                                    ^
/nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:2285:33: note: previous declaration 'std::istream& operator>>(std::istream&, mpz_ptr)'
 __GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpz_ptr);
                                 ^
/nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:2287:68: error: conflicting declaration of C function 'std::istream& operator>>(std::istream&, mpf_ptr)'
 __GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpf_ptr);
                                                                    ^
/nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:2286:33: note: previous declaration 'std::istream& operator>>(std::istream&, mpq_ptr)'
 __GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpq_ptr);
                                 ^
/nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:2287:68: error: conflicting declaration of C function 'std::istream& operator>>(std::istream&, mpf_ptr)'
 __GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpf_ptr);
                                                                    ^
/nix/store/d1ycid8cl2hf6dm3hp2jdx3rzhcnzjj2-gmp-6.1.1-dev/include/gmp.h:2285:33: note: previous declaration 'std::istream& operator>>(std::istream&, mpz_ptr)'
 __GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpz_ptr);
                                 ^
make[3]: *** [Makefile:1065: graphite-isl-ast-to-gimple.o] Error 1
rm gcc.pod
make[3]: Leaving directory '/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build/gcc'
make[2]: *** [Makefile:4436: all-stage2-gcc] Error 2
make[2]: Leaving directory '/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build'
make[1]: *** [Makefile:19148: stage2-bubble] Error 2
make[1]: Leaving directory '/private/var/folders/7t/4vz31njj37b8y_bg6z3t7tk00000gn/T/nix-build-gcc-5.4.0.drv-0/build'
make: *** [Makefile:19344: bootstrap] Error 2

@matthewbauer
Copy link
Member

matthewbauer commented Sep 1, 2016

This may be related: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65988. I'm trying to disable isl and see what happens.

@FlorentBecker
Copy link
Contributor

@matthewbauer Can you still reproduce this?

@matthewbauer
Copy link
Member

I think we fixed it. This can be closed unless it's been broken recently.

@anthonybrice
Copy link

anthonybrice commented Sep 1, 2017

Sorry to dredge this up, but I thought you might want to know it seems to be broken again. Here's the last of my output when I try to install. Let me know if I can provide any more info.

$ nix-env -i gcc
[...]
clang -c -DHAVE_CONFIG_H -g   -I. -I../../gcc-5.4.0/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  ../../gcc-5.4.0/libiberty/fdmatch.c -o fdmatch.o
if [ x"-fno-common" != x ]; then \
  clang -c -DHAVE_CONFIG_H -g   -I. -I../../gcc-5.4.0/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  -fno-common ../../gcc-5.4.0/libiberty/fibheap.c -o pic/fibheap.o; \
else true; fi
../../gcc-5.4.0/libiberty/fibheap.c:151:7: warning: implicit declaration of function 'free' is invalid in C99 [-Wimplicit-function-declaration]
      free (heapa);
      ^
../../gcc-5.4.0/libiberty/fibheap.c:151:7: warning: this function declaration is not a prototype [-Wstrict-prototypes]
../../gcc-5.4.0/libiberty/fibheap.c:220:30: error: use of undeclared identifier 'LONG_MIN'
  if (okey == key && okey != FIBHEAPKEY_MIN)
                             ^
../../gcc-5.4.0/libiberty/fibheap.c:38:24: note: expanded from macro 'FIBHEAPKEY_MIN'
#define FIBHEAPKEY_MIN  LONG_MIN
                        ^
../../gcc-5.4.0/libiberty/fibheap.c:261:36: error: use of undeclared identifier 'LONG_MIN'
  fibheap_replace_key (heap, node, FIBHEAPKEY_MIN);
                                   ^
../../gcc-5.4.0/libiberty/fibheap.c:38:24: note: expanded from macro 'FIBHEAPKEY_MIN'
#define FIBHEAPKEY_MIN  LONG_MIN
                        ^
../../gcc-5.4.0/libiberty/fibheap.c:265:7: warning: implicitly declaring library function 'abort' with type 'void (void) __attribute__((noreturn))' [-Wimplicit-function-declaration]
      abort ();
      ^
../../gcc-5.4.0/libiberty/fibheap.c:265:7: note: include the header <stdlib.h> or explicitly provide a declaration for 'abort'
../../gcc-5.4.0/libiberty/fibheap.c:368:3: warning: implicitly declaring library function 'memset' with type 'void *(void *, int, unsigned long)' [-Wimplicit-function-declaration]
  memset (a, 0, sizeof (fibnode_t) * D);
  ^
../../gcc-5.4.0/libiberty/fibheap.c:368:3: note: include the header <string.h> or explicitly provide a declaration for 'memset'
4 warnings and 2 errors generated.
make[3]: *** [Makefile:752: fibheap.o] Error 1
make[3]: Leaving directory '/private/tmp/nix-build-gcc-5.4.0.drv-0/build/libiberty'
make[2]: *** [Makefile:9595: all-stage1-libiberty] Error 2
make[2]: Leaving directory '/private/tmp/nix-build-gcc-5.4.0.drv-0/build'
make[1]: *** [Makefile:19039: stage1-bubble] Error 2
make[1]: Leaving directory '/private/tmp/nix-build-gcc-5.4.0.drv-0/build'
make: *** [Makefile:19344: bootstrap] Error 2
builder for ‘/nix/store/67k9dxxarnjmn80x02ix4lcwha73mbq5-gcc-5.4.0.drv’ failed with exit code 2
error: build of ‘/nix/store/67k9dxxarnjmn80x02ix4lcwha73mbq5-gcc-5.4.0.drv’ failed

@copumpkin
Copy link
Member

@Ericson2314 @LnL7 does this look familiar to either of you?

@Ericson2314
Copy link
Member

Oh! Yes! I just ran into that doing a linux stdenv build the other day. I am totally blanking but will remember.

@Ericson2314
Copy link
Member

In my case, it was because the configure script decided limits.h did not exist, and clobbered all such includes so things would fail in this far more confusing fashion, sigh. Weirder still, the underling gcc -E that configure used to test for the existence of the header, succeeded. @globin and @fpletz figured out that while the command succeeded, the wrapper scripts were pushing some extra stuff onto stderr, which caused the configure script to fail the test despite the happy exit status.

Yay.

@matthewbauer
Copy link
Member

I think that's the same as in issue #27889.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

9 participants