aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config.gcc6
-rw-r--r--gcc/config/rs6000/t-freebsd643
3 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c93ea90..099d1b9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2019-09-30 Andreas Tobler <andreast@gcc.gnu.org>
+
+ * config.gcc: Use the secure-plt on FreeBSD 13 and upwards for
+ 32-bit PowerPC.
+ Define TARGET_FREEBSD32_SECURE_PLT for 64-bit PowerPC.
+ * config/rs6000/t-freebsd64: Make use of the above define and build
+ the 32-bit libraries with secure-plt.
+
2019-09-30 Jakub Jelinek <jakub@redhat.com>
PR target/91931
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 69d0a02..481bc95 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2687,8 +2687,14 @@ powerpc*-*-freebsd*)
tm_file="${tm_file} rs6000/default64.h rs6000/freebsd64.h"
tmake_file="${tmake_file} rs6000/t-freebsd64"
extra_options="${extra_options} rs6000/linux64.opt"
+ if test $fbsd_major -ge 13; then
+ tm_defines="${tm_defines} TARGET_FREEBSD32_SECURE_PLT=1"
+ fi
;;
*)
+ if test $fbsd_major -ge 13; then
+ tm_file="rs6000/secureplt.h ${tm_file}"
+ fi
tm_file="${tm_file} rs6000/freebsd.h"
;;
esac
diff --git a/gcc/config/rs6000/t-freebsd64 b/gcc/config/rs6000/t-freebsd64
index 3f44bfe..dd0d5bb 100644
--- a/gcc/config/rs6000/t-freebsd64
+++ b/gcc/config/rs6000/t-freebsd64
@@ -27,3 +27,6 @@ MULTILIB_EXTRA_OPTS = fPIC mstrict-align
MULTILIB_EXCEPTIONS =
MULTILIB_OSDIRNAMES = ../lib32
+SECURE_PLT = $(if $(filter TARGET_FREEBSD32_SECURE_PLT=1, $(tm_defines)),msecure-plt)
+
+MULTILIB_EXTRA_OPTS += $(SECURE_PLT)