diff options
author | cidkidnix <cidkidnix@protonmail.com> | 2022-09-21 09:31:09 -0500 |
---|---|---|
committer | cidkidnix <cidkidnix@protonmail.com> | 2022-09-23 10:10:44 -0500 |
commit | 20b67d38c727b0c02efac117d403f6cd68f77546 (patch) | |
tree | 0792641a8f7a68def434eebc5c0641a96e822249 | |
parent | 52117cce92412a2b921449e11cd3d4716e56f382 (diff) | |
download | nixpkgs-20b67d38c727b0c02efac117d403f6cd68f77546.tar nixpkgs-20b67d38c727b0c02efac117d403f6cd68f77546.tar.gz nixpkgs-20b67d38c727b0c02efac117d403f6cd68f77546.tar.bz2 nixpkgs-20b67d38c727b0c02efac117d403f6cd68f77546.tar.lz nixpkgs-20b67d38c727b0c02efac117d403f6cd68f77546.tar.xz nixpkgs-20b67d38c727b0c02efac117d403f6cd68f77546.tar.zst nixpkgs-20b67d38c727b0c02efac117d403f6cd68f77546.zip |
Add muldefs to ld-flags
-rw-r--r-- | pkgs/development/androidndk-pkgs/androidndk-pkgs.nix | 4 |
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 2d561962041..7fcf2b67251 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 |