Mesa (main): meson: Check arguments before adding.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 9 21:21:40 UTC 2021


Module: Mesa
Branch: main
Commit: 22673a980f30cf71ea1d7e3d4feb161c549d48a4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=22673a980f30cf71ea1d7e3d4feb161c549d48a4

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Tue Oct 26 00:27:53 2021 +0200

meson: Check arguments before adding.

-static-libstdc++ doesn't exist on the Android NDK, casuing all
later has_argument calls to return false even though the compiler
supports that argument.

Fixes: 3aee462781a "meson: add windows compiler checks and libraries"
Reviewed-by: Eric Engestrom <eric at engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>

---

 .gitlab-ci.yml                                    |  2 +-
 .gitlab-ci/container/create-android-cross-file.sh |  2 +-
 meson.build                                       | 21 ++++++++++++++++-----
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fc3509ccfd0..af39d7693ca 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -376,7 +376,7 @@ debian/android_build:
   extends:
     - .use-debian/x86_build-base
   variables:
-    MESA_IMAGE_TAG: &debian-android_build "2021-10-02-libelf-2"
+    MESA_IMAGE_TAG: &debian-android_build "2021-10-26-static-libstdcxx"
 
 .use-debian/android_build:
   extends:
diff --git a/.gitlab-ci/container/create-android-cross-file.sh b/.gitlab-ci/container/create-android-cross-file.sh
index 99ad5b98b46..ac07ca11f98 100644
--- a/.gitlab-ci/container/create-android-cross-file.sh
+++ b/.gitlab-ci/container/create-android-cross-file.sh
@@ -17,7 +17,7 @@ cat >$cross_file <<EOF
 [binaries]
 ar = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$arch-ar'
 c = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}29-clang', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables']
-cpp = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}29-clang++', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
+cpp = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}29-clang++', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables']
 c_ld = 'lld'
 cpp_ld = 'lld'
 strip = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$arch-strip'
diff --git a/meson.build b/meson.build
index e1f5fb30db8..51392ee264f 100644
--- a/meson.build
+++ b/meson.build
@@ -1213,11 +1213,22 @@ if host_machine.system() == 'windows'
     endif
   else
     add_project_link_arguments(
-      '-Wl,--nxcompat',
-      '-Wl,--dynamicbase',
-      '-static-libgcc',
-      '-static-libstdc++',
-      language : ['c', 'cpp'],
+      cc.get_supported_arguments(
+        '-Wl,--nxcompat',
+        '-Wl,--dynamicbase',
+        '-static-libgcc',
+        '-static-libstdc++',
+      ),
+      language : ['c'],
+    )
+    add_project_link_arguments(
+      cpp.get_supported_arguments(
+        '-Wl,--nxcompat',
+        '-Wl,--dynamicbase',
+        '-static-libgcc',
+        '-static-libstdc++',
+      ),
+      language : ['cpp'],
     )
   endif
 endif



More information about the mesa-commit mailing list