summaryrefslogtreecommitdiffstats
path: root/pkgs/development/androidndk-pkgs
diff options
context:
space:
mode:
authorcidkidnix <cidkidnix@protonmail.com>2022-09-21 09:31:09 -0500
committercidkidnix <cidkidnix@protonmail.com>2022-09-23 10:10:44 -0500
commit20b67d38c727b0c02efac117d403f6cd68f77546 (patch)
tree0792641a8f7a68def434eebc5c0641a96e822249 /pkgs/development/androidndk-pkgs
parent52117cce92412a2b921449e11cd3d4716e56f382 (diff)
Add muldefs to ld-flags
Diffstat (limited to 'pkgs/development/androidndk-pkgs')
-rw-r--r--pkgs/development/androidndk-pkgs/androidndk-pkgs.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix b/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix
index 2d5619620417..7fcf2b672518 100644
--- a/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix
+++ b/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix
@@ -50,6 +50,7 @@ let
# different from what we use. We make it four parts to conform with the existing
# standard more properly.
targetConfig = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) (stdenv.targetPlatform.config);
+ prefix = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) (stdenv.targetPlatform.config + "-");
in
rec {
@@ -60,6 +61,7 @@ rec {
nativeBuildInputs = [ makeWrapper autoPatchelfHook ];
propagatedBuildInputs = [ androidndk ];
passthru = {
+ targetPrefix = prefix;
isClang = true; # clang based cc, but bintools ld
};
dontUnpack = true;
@@ -131,7 +133,7 @@ rec {
# Android needs executables linked with -pie since version 5.0
# Use -fPIC for compilation, and link with -pie if no -shared flag used in ldflags
echo "-target ${targetInfo.triple} -fPIC" >> $out/nix-support/cc-cflags
- echo "-z,noexecstack -z,relro -z,now" >> $out/nix-support/cc-ldflags
+ echo "-z,noexecstack -z,relro -z,now -z,muldefs" >> $out/nix-support/cc-ldflags
echo 'if [[ ! " $@ " =~ " -shared " ]]; then NIX_LDFLAGS_${suffixSalt}+=" -pie"; fi' >> $out/nix-support/add-flags.sh
echo "-Xclang -mnoexecstack" >> $out/nix-support/cc-cxxflags
if [ ${targetInfo.triple} == arm-linux-androideabi ]; then