ci: Fix selection of linker in Android builds
[platform/upstream/mesa.git] / .gitlab-ci / container / create-android-cross-file.sh
1 #!/bin/bash
2
3 ndk=$1
4 arch=$2
5 cpu_family=$3
6 cpu=$4
7 cross_file="/cross_file-$arch.txt"
8
9 # armv7 has the toolchain split between two names.
10 arch2=${5:-$2}
11
12 # Note that we disable C++ exceptions, because Mesa doesn't use exceptions,
13 # and allowing it in code generation means we get unwind symbols that break
14 # the libEGL and driver symbol tests.
15
16 cat >$cross_file <<EOF
17 [binaries]
18 ar = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$arch-ar'
19 c = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}29-clang', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables']
20 cpp = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}29-clang++', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
21 c_ld = 'lld'
22 cpp_ld = 'lld'
23 strip = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$arch-strip'
24 pkgconfig = ['/usr/bin/pkg-config']
25
26 [host_machine]
27 system = 'linux'
28 cpu_family = '$cpu_family'
29 cpu = '$cpu'
30 endian = 'little'
31
32 [properties]
33 needs_exe_wrapper = true
34
35 EOF