wok-next view gcc/stuff/patches/205-nopie.patch @ rev 21159
updated diffutils (3.6 -> 3.7)
author | Hans-G?nter Theisgen |
---|---|
date | Wed Feb 20 08:46:59 2019 +0100 (2019-02-20) |
parents | |
children |
line source
1 From b6015aca9c9cc83739fd0ed637a835119b2c4e34 Mon Sep 17 00:00:00 2001
2 From: Szabolcs Nagy <nsz@port70.net>
3 Date: Sat, 7 Nov 2015 02:08:05 +0000
4 Subject: [PATCH 5/6] nopie
6 ---
7 gcc/configure | 27 +++++++++++++++++++++++++++
8 gcc/configure.ac | 13 +++++++++++++
9 2 files changed, 40 insertions(+)
11 diff --git a/gcc/configure b/gcc/configure
12 index 1c6e340..7e8b5d6 100755
13 --- a/gcc/configure
14 +++ b/gcc/configure
15 @@ -29390,6 +29390,33 @@ fi
16 $as_echo "$gcc_cv_no_pie" >&6; }
17 if test "$gcc_cv_no_pie" = "yes"; then
18 NO_PIE_FLAG="-no-pie"
19 +else
20 + # Check if -nopie works.
21 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -nopie option" >&5
22 +$as_echo_n "checking for -nopie option... " >&6; }
23 +if test "${gcc_cv_nopie+set}" = set; then :
24 + $as_echo_n "(cached) " >&6
25 +else
26 + saved_LDFLAGS="$LDFLAGS"
27 + LDFLAGS="$LDFLAGS -nopie"
28 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29 +/* end confdefs.h. */
30 +int main(void) {return 0;}
31 +_ACEOF
32 +if ac_fn_cxx_try_link "$LINENO"; then :
33 + gcc_cv_nopie=yes
34 +else
35 + gcc_cv_nopie=no
36 +fi
37 +rm -f core conftest.err conftest.$ac_objext \
38 + conftest$ac_exeext conftest.$ac_ext
39 + LDFLAGS="$saved_LDFLAGS"
40 +fi
41 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nopie" >&5
42 +$as_echo "$gcc_cv_nopie" >&6; }
43 + if test "$gcc_cv_nopie" = "yes"; then
44 + NO_PIE_FLAG="-nopie"
45 + fi
46 fi
49 diff --git a/gcc/configure.ac b/gcc/configure.ac
50 index 6c1dcd9..0ca7647 100644
51 --- a/gcc/configure.ac
52 +++ b/gcc/configure.ac
53 @@ -6098,6 +6098,19 @@ AC_CACHE_CHECK([for -no-pie option],
54 LDFLAGS="$saved_LDFLAGS"])
55 if test "$gcc_cv_no_pie" = "yes"; then
56 NO_PIE_FLAG="-no-pie"
57 +else
58 + # Check if -nopie works.
59 + AC_CACHE_CHECK([for -nopie option],
60 + [gcc_cv_nopie],
61 + [saved_LDFLAGS="$LDFLAGS"
62 + LDFLAGS="$LDFLAGS -nopie"
63 + AC_LINK_IFELSE([int main(void) {return 0;}],
64 + [gcc_cv_nopie=yes],
65 + [gcc_cv_nopie=no])
66 + LDFLAGS="$saved_LDFLAGS"])
67 + if test "$gcc_cv_nopie" = "yes"; then
68 + NO_PIE_FLAG="-nopie"
69 + fi
70 fi
71 AC_SUBST([NO_PIE_FLAG])
73 --
74 2.8.1