termux-packages/scripts/clang-pie-wrapper
Fredrik Fornwall 07884eae94 Fix arm issue with clang-pie-wrapper
We need to wrap arm-linux-androideabi, not arm-linux-android.

Also, specify armv7a as clang cpu target and not just arm.
2017-01-17 17:31:24 +01:00

33 lines
747 B
Bash
Executable File

#!/bin/bash
force_fPIE=1
force_pie=1
for opt; do
case "$opt" in
-fno-PIC|-fno-pic|-fno-PIE|-fno-pie|-nopie|-static|--static|-shared|--shared|-D__KERNEL__|-nostdlib|-nostartfiles|-mcmodel=kernel|-v|--version|-M*)
force_fPIE=0
force_pie=0
;;
-fPIC|-fpic|-fPIE|-fpie)
force_fPIE=0
;;
-c|-E|-S)
force_pie=0
;;
esac
done
arguments=()
(( $force_fPIE )) && arguments+=(-fPIE)
(( $force_pie )) && arguments+=(-pie)
# The ordinary wrapper from a NDK standalone toolchain
# with "${arguments[@]}" added.
if [ "$1" != "-cc1" ]; then
`dirname $0`/COMPILER -target CLANG_TARGET --sysroot `dirname $0`/../sysroot "${arguments[@]}" "$@"
else
# target/triple already spelled out.
`dirname $0`/COMPILER "${arguments[@]}" "$@"
fi