config.gcc: Use the secure-plt on FreeBSD 13 and upwards for 32-bit PowerPC.
authorAndreas Tobler <andreast@gcc.gnu.org>
Mon, 30 Sep 2019 07:54:52 +0000 (09:54 +0200)
committerAndreas Tobler <andreast@gcc.gnu.org>
Mon, 30 Sep 2019 07:54:52 +0000 (09:54 +0200)
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.

From-SVN: r276295

gcc/ChangeLog
gcc/config.gcc
gcc/config/rs6000/t-freebsd64

index c93ea904c08710c73b4e57d3c6fb4c170ddd52fa..099d1b9a89fbcf6c62db7ee2addfda7ae4b50e6f 100644 (file)
@@ -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
index 69d0a024d850c7f7a7b6faa7975fc581c36f4a2c..481bc9586a7bddd6088d2ae0a12f9d6b8f50cdab 100644 (file)
@@ -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
index 3f44bfefb143a034ae9baf7e21ed2e389a40a894..dd0d5bb8ee2b50f785287ed687c404e431646dfd 100644 (file)
@@ -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)