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