Module: Mesa
Branch: master
Commit: a4cb96d12b38c663533f135ae4259d8bd56f6a75
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a4cb96d12b38c663533f135ae4259d8bd56f6a75

Author: Tomeu Vizoso <[email protected]>
Date:   Thu Jan 28 08:27:06 2021 +0100

ci: Fix selection of linker in Android builds

Otherwise, Clang will error out when it doesn't link:

Compiler stderr:
 clang: error: argument unused during compilation: '-fuse-ld=lld' 
[-Werror,-Wunused-command-line-argument]

When that happens when Meson is checking for the presence of macros in
sys/sysmacros.h, that file won't be included resulting in the following
errors:

ld.lld: error: undefined symbol: makedev
ld.lld: error: undefined symbol: major
ld.lld: error: undefined symbol: minor

Signed-off-by: Tomeu Vizoso <[email protected]>
Acked-by: Michel Dänzer <[email protected]>
Acked-by: Eric Anholt <[email protected]>
Gitlab: #4137
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8757>

---

 .gitlab-ci/create-android-cross-file.sh | 6 ++++--
 docs/android.rst                        | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci/create-android-cross-file.sh 
b/.gitlab-ci/create-android-cross-file.sh
index 4590ce172a9..99ad5b98b46 100644
--- a/.gitlab-ci/create-android-cross-file.sh
+++ b/.gitlab-ci/create-android-cross-file.sh
@@ -16,8 +16,10 @@ arch2=${5:-$2}
 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', 
'-fuse-ld=lld', '-fno-exceptions', '-fno-unwind-tables', 
'-fno-asynchronous-unwind-tables']
-cpp = ['ccache', 
'$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}29-clang++', 
'-fuse-ld=lld', '-fno-exceptions', '-fno-unwind-tables', 
'-fno-asynchronous-unwind-tables', '-static-libstdc++']
+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++']
+c_ld = 'lld'
+cpp_ld = 'lld'
 strip = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$arch-strip'
 pkgconfig = ['/usr/bin/pkg-config']
 
diff --git a/docs/android.rst b/docs/android.rst
index 1d41d32878e..f08c4fb1729 100644
--- a/docs/android.rst
+++ b/docs/android.rst
@@ -20,8 +20,10 @@ Then, create your meson cross file to use it, something like 
this
 
     [binaries]
     ar = 
'NDKDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar'
-    c = ['ccache', 
'NDKDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang',
 '-fuse-ld=lld']
-    cpp = ['ccache', 
'NDKDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++',
 '-fuse-ld=lld', '-fno-exceptions', '-fno-unwind-tables', 
'-fno-asynchronous-unwind-tables', '-static-libstdc++']
+    c = ['ccache', 
'NDKDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang']
+    cpp = ['ccache', 
'NDKDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++',
 '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', 
'-static-libstdc++']
+    c_ld = 'lld'
+    cpp_ld = 'lld'
     strip = 
'NDKDIR/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip'
     # Android doesn't come with a pkg-config, but we need one for meson to be 
happy not
     # finding all the optional deps it looks for.  Use system pkg-config 
pointing at a

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to