diff options
author | Niklas Hambüchen <mail@nh2.me> | 2021-07-04 23:56:19 +0000 |
---|---|---|
committer | Niklas Hambüchen <mail@nh2.me> | 2021-07-05 16:38:24 +0200 |
commit | a666b155725da3033fbfae99834bec0b6752911c (patch) | |
tree | 96885a11fc65d277d3ec7f18eebc72910ed8fb41 /pkgs/development/libraries/argp-standalone | |
parent | 8d11c1380a8b750bc15641f61590ebc313d754df (diff) |
argp-standalone: Add `-fPIC`.
Fixes `pkgsMusl.elfutils` failing with `recompile with -fPIC`. This was discovered trying to build `pkgsMusl.haskell.compiler.ghcHEAD`.
Diffstat (limited to 'pkgs/development/libraries/argp-standalone')
-rw-r--r-- | pkgs/development/libraries/argp-standalone/default.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/development/libraries/argp-standalone/default.nix b/pkgs/development/libraries/argp-standalone/default.nix index 33b253718a7fb..bb987d069a77f 100644 --- a/pkgs/development/libraries/argp-standalone/default.nix +++ b/pkgs/development/libraries/argp-standalone/default.nix @@ -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 |