Skip to content

Commit

Permalink
haskell.compiler.ghc865-binary: strip to fix aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Jun 23, 2020
1 parent a0fe522 commit b930b2d
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions pkgs/development/compilers/ghc/8.6.5-binary.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,6 @@ stdenv.mkDerivation rec {
patchShebangs ghc-${version}/configure
'' +

# Strip is harmful, see also below. It's important that this happens
# first. The GHC Cabal build system makes use of strip by default and
# has hardcoded paths to /usr/bin/strip in many places. We replace
# those below, making them point to our dummy script.
''
mkdir "$TMP/bin"
for i in strip; do
echo '#! ${stdenv.shell}' > "$TMP/bin/$i"
chmod +x "$TMP/bin/$i"
done
PATH="$TMP/bin:$PATH"
'' +
# We have to patch the GMP paths for the integer-gmp package.
''
find . -name integer-gmp.buildinfo \
Expand Down Expand Up @@ -125,17 +113,13 @@ stdenv.mkDerivation rec {
] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"
++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";

# Stripping combined with patchelf breaks the executables (they die
# with a segfault or the kernel even refuses the execve). (NIXPKGS-85)
dontStrip = true;

# No building is necessary, but calling make without flags ironically
# calls install-strip ...
dontBuild = true;

# On Linux, use patchelf to modify the executables so that they can
# find editline/gmp.
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
postFixup = stdenv.lib.optionalString stdenv.isLinux ''
for p in $(find "$out" -type f -executable); do
if isELF "$p"; then
echo "Patchelfing $p"
Expand Down

0 comments on commit b930b2d

Please sign in to comment.