openssl: Ensure that bin/openssl is a pie binary
[termux-packages] / packages / gcc / gcc-config-linux-android.h.patch
CommitLineData
b257fed9
FF
1diff -u -r ../gcc-6.1.0/gcc/config/linux-android.h ./gcc/config/linux-android.h
2--- ../gcc-6.1.0/gcc/config/linux-android.h 2016-01-04 09:30:50.000000000 -0500
3+++ ./gcc/config/linux-android.h 2016-04-29 05:09:14.697030172 -0400
4@@ -38,15 +38,18 @@
5 "%{" NOANDROID "|tno-android-ld:" LINUX_SPEC ";:" ANDROID_SPEC "}"
6
7 #define ANDROID_LINK_SPEC \
8- "%{shared: -Bsymbolic}"
9+ "%{shared: -Bsymbolic} -z noexecstack -z relro -z now"
10
11-#define ANDROID_CC1_SPEC \
12+#define ANDROID_CC1_SPEC(ANDROID_PIC_DEFAULT) \
13 "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} " \
14- "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
15+ "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: " ANDROID_PIC_DEFAULT "}}}}"
16
17 #define ANDROID_CC1PLUS_SPEC \
18- "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} " \
19- "%{!frtti:%{!fno-rtti: -fno-rtti}}"
20+ "%{!fexceptions:%{!fno-exceptions: -fexceptions}} " \
21+ "%{!frtti:%{!fno-rtti: -frtti}}"
22+
23+#define ANDROID_ASM_SPEC \
24+ "--noexecstack"
25
26 #define ANDROID_LIB_SPEC \
27 "%{!static: -ldl}"