Merge pull request from angerman/angerman/androidndk-response-params

android-ndk: allow -no-pie
This commit is contained in:
John Ericson 2023-02-19 19:04:28 -05:00 committed by GitHub
commit f36a9f98f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,7 +133,8 @@ rec {
# 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 -z,muldefs" >> $out/nix-support/cc-ldflags
echo 'if [[ ! " $@ " =~ " -shared " ]]; then NIX_LDFLAGS_${suffixSalt}+=" -pie"; fi' >> $out/nix-support/add-flags.sh
echo 'expandResponseParams "$@"' >> $out/nix-support/add-flags.sh
echo 'if [[ ! (" ''${params[@]} " =~ " -shared ") && ! (" ''${params[@]} " =~ " -no-pie ") ]]; 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
# https://android.googlesource.com/platform/external/android-cmake/+/refs/heads/cmake-master-dev/android.toolchain.cmake