summaryrefslogtreecommitdiff
path: root/toolchain/3rd-party-g++.in
blob: f308016bd97a3a42fc0ae00c04250227d3695912 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# Reject attempts to include or link host paths.
if echo " $* " | grep -qE '[[:space:]]-[IL][[:space:]]*(/+usr)?/+((local|X11R6)/+)?(include|lib)'; then
  echo "$0: poisoned host path detected: $*" >&2
  exit 1
fi

# Android only supports PIEs, but they don't set the default PIE behavior in
# the compiler, so we need to manually add the flags.
case " $* " in
*" -fPIC "*|*" -fpic "*|*" -fPIE "*|*" -fpie "*|*" -shared "*|*" -static "*|*" -pie "*) ;;
*) set -- -fpie -pie "$@"
esac

exec \
	"${ANDROID_TOOLCHAIN}/@CXX@" \
	@CXXFLAGS@ \
	@LDFLAGS@ \
	--sysroot "${ANDROID_PRODUCT_OUT}/@ROOT_SUBDIR@" \
	-Wl,--enable-new-dtags,-rpath,/system/usr/@LIBDIR@ \
	-Wl,-lc++ \
	-frtti \
	"$@"