rclone: Switch tarballs to signed (fixes #2382)
[termux-packages] / scripts / clang-pie-wrapper
CommitLineData
2f0de587
FF
1#!/bin/bash
2
3force_fPIE=1
4force_pie=1
5
6for opt; do
7 case "$opt" in
8 -fno-PIC|-fno-pic|-fno-PIE|-fno-pie|-nopie|-static|--static|-shared|--shared|-D__KERNEL__|-nostdlib|-nostartfiles|-mcmodel=kernel|-v|--version|-M*)
9 force_fPIE=0
10 force_pie=0
11 ;;
12 -fPIC|-fpic|-fPIE|-fpie)
13 force_fPIE=0
14 ;;
15 -c|-E|-S)
16 force_pie=0
17 ;;
18 esac
19done
20
21arguments=()
22(( $force_fPIE )) && arguments+=(-fPIE)
23(( $force_pie )) && arguments+=(-pie)
24
25# The ordinary wrapper from a NDK standalone toolchain
26# with "${arguments[@]}" added.
27if [ "$1" != "-cc1" ]; then
07884eae 28 `dirname $0`/COMPILER -target CLANG_TARGET --sysroot `dirname $0`/../sysroot "${arguments[@]}" "$@"
2f0de587
FF
29else
30 # target/triple already spelled out.
31 `dirname $0`/COMPILER "${arguments[@]}" "$@"
32fi