Skip to content

Commit

Permalink
Revert "gcc: fix clang build"
Browse files Browse the repository at this point in the history
This fixes the gcc build but results in a gcc that doesn't generate
valid binaries.

gcc -o hello hello.c
./hello
Killed: 9

This reverts commit 2adf36a.
  • Loading branch information
LnL7 committed Aug 9, 2017
1 parent 6225f1b commit d93c636
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkgs/development/compilers/gcc/5/default.nix
Expand Up @@ -325,13 +325,7 @@ stdenv.mkDerivation ({

NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";

preConfigure =
# Not sure why this is causing problems, now that the stdenv
# exports CPP=cpp the build fails with strange errors on darwin.
# https://github.com/NixOS/nixpkgs/issues/27889
stdenv.lib.optionalString stdenv.cc.isClang ''
unset CPP
'' + stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
Expand Down

2 comments on commit d93c636

@matthewbauer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LnL7 Can this be unreverted now that bf8c125 seems to fix the original problem?

@LnL7
Copy link
Member Author

@LnL7 LnL7 commented on d93c636 Aug 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I didn't want to confuse people by having a gcc that didn't actually work.

Please sign in to comment.