Eric Anholt | 0767af3 | 2020-09-09 16:37:54 -0700 | [diff] [blame] | 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', '-fuse-ld=lld', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables'] |
| 20 | 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++'] |
| 21 | strip = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$arch-strip' |
| 22 | pkgconfig = ['/usr/bin/pkg-config'] |
| 23 | |
| 24 | [host_machine] |
| 25 | system = 'linux' |
| 26 | cpu_family = '$cpu_family' |
| 27 | cpu = '$cpu' |
| 28 | endian = 'little' |
| 29 | |
| 30 | [properties] |
| 31 | needs_exe_wrapper = true |
| 32 | |
| 33 | EOF |