argp-standalone: Add -fPIC.

Fixes `pkgsMusl.elfutils` failing with `recompile with -fPIC`.

This was discovered trying to build `pkgsMusl.haskell.compiler.ghcHEAD`.
This commit is contained in:
Niklas Hambüchen 2021-07-04 23:56:19 +00:00
parent 8d11c1380a
commit a666b15572

View file

@ -33,7 +33,11 @@ stdenv.mkDerivation {
patchFlags = lib.optional stdenv.hostPlatform.isDarwin "-p0";
preConfigure = lib.optionalString stdenv.hostPlatform.isLinux "export CFLAGS='-fgnu89-inline'";
# For currently unknown reason, `-fPIC` has to be passed explicitly, otherwise
# downstream software like `elfutils` will get `recompile errors like:
# libargp.a(argp-help.o): relocation R_X86_64_PC32 against symbol `program_invocation_short_name' can not be used when making a shared object; recompile with -fPIC
# It seems that nixpkgs's on-by-default `-fPIC` is not in effect here.
preConfigure = lib.optionalString stdenv.hostPlatform.isLinux "export CFLAGS='-fgnu89-inline -fPIC'";
postInstall = ''
mkdir -p $out/lib $out/include