diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2024-03-10 23:34:31 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2024-03-10 23:35:31 +0100 |
commit | a9de2770f26f3e76ae9f4552867623d1c7866618 (patch) | |
tree | 441523c4f5048994ddd5b7d78cb1b4aac3cad5bf /gcc | |
parent | acd9cdbb8fe24046f661a304830f7be0c2a0fa46 (diff) | |
parent | 33ebb0dff9bb022f1e0709e0e73faabfc3df7931 (diff) | |
download | gcc-a9de2770f26f3e76ae9f4552867623d1c7866618.zip gcc-a9de2770f26f3e76ae9f4552867623d1c7866618.tar.gz gcc-a9de2770f26f3e76ae9f4552867623d1c7866618.tar.bz2 |
Merge commit '33ebb0dff9bb022f1e0709e0e73faabfc3df7931' into HEAD
Diffstat (limited to 'gcc')
-rwxr-xr-x | gcc/configure | 20 | ||||
-rw-r--r-- | gcc/configure.ac | 13 | ||||
-rw-r--r-- | gcc/doc/install.texi | 6 |
3 files changed, 36 insertions, 3 deletions
diff --git a/gcc/configure b/gcc/configure index 8703c42..1218019 100755 --- a/gcc/configure +++ b/gcc/configure @@ -635,6 +635,7 @@ CET_HOST_FLAGS LD_PICFLAG PICFLAG enable_default_pie +enable_host_bind_now enable_host_pie enable_host_shared enable_plugin @@ -1034,6 +1035,7 @@ enable_version_specific_runtime_libs enable_plugin enable_host_shared enable_host_pie +enable_host_bind_now enable_libquadmath_support with_linker_hash_style with_diagnostics_color @@ -1797,6 +1799,7 @@ Optional Features: --enable-plugin enable plugin support --enable-host-shared build host code as shared libraries --enable-host-pie build host code as PIE + --enable-host-bind-now link host code as BIND_NOW --disable-libquadmath-support disable libquadmath support for Fortran --enable-default-pie enable Position Independent Executable as default @@ -19861,7 +19864,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19864 "configure" +#line 19867 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19967,7 +19970,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19970 "configure" +#line 19973 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -32117,6 +32120,14 @@ fi +# Enable --enable-host-bind-now +# Check whether --enable-host-bind-now was given. +if test "${enable_host_bind_now+set}" = set; then : + enableval=$enable_host_bind_now; +fi + + + # Check whether --enable-libquadmath-support was given. if test "${enable_libquadmath_support+set}" = set; then : enableval=$enable_libquadmath_support; ENABLE_LIBQUADMATH_SUPPORT=$enableval @@ -32303,6 +32314,8 @@ else PICFLAG= fi + + if test x$enable_host_pie = xyes; then LD_PICFLAG=-pie elif test x$gcc_cv_no_pie = xyes; then @@ -32311,6 +32324,9 @@ else LD_PICFLAG= fi +if test x$enable_host_bind_now = xyes; then + LD_PICFLAG="$LD_PICFLAG -Wl,-z,now" +fi diff --git a/gcc/configure.ac b/gcc/configure.ac index af9033f..aff5fbf 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -7439,6 +7439,12 @@ AC_ARG_ENABLE(host-pie, [build host code as PIE])]) AC_SUBST(enable_host_pie) +# Enable --enable-host-bind-now +AC_ARG_ENABLE(host-bind-now, +[AS_HELP_STRING([--enable-host-bind-now], + [link host code as BIND_NOW])]) +AC_SUBST(enable_host_bind_now) + AC_ARG_ENABLE(libquadmath-support, [AS_HELP_STRING([--disable-libquadmath-support], [disable libquadmath support for Fortran])], @@ -7580,6 +7586,8 @@ else PICFLAG= fi +AC_SUBST([PICFLAG]) + if test x$enable_host_pie = xyes; then LD_PICFLAG=-pie elif test x$gcc_cv_no_pie = xyes; then @@ -7588,7 +7596,10 @@ else LD_PICFLAG= fi -AC_SUBST([PICFLAG]) +if test x$enable_host_bind_now = xyes; then + LD_PICFLAG="$LD_PICFLAG -Wl,-z,now" +fi + AC_SUBST([LD_PICFLAG]) # Enable Intel CET on Intel CET enabled host if jit is enabled. diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index a38d293..e099cd0 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1095,6 +1095,12 @@ protection against Return Oriented Programming (ROP) attacks. in which case @option{-fPIC} is used when compiling, and @option{-pie} when linking. +@item --enable-host-bind-now +Specify that the @emph{host} executables should be linked with the option +@option{-Wl,-z,now}, which means that the dynamic linker will resolve all +symbols when the executables are started, and that in turn allows RELRO to +mark the GOT read-only, resulting in better security. + @item @anchor{with-gnu-as}--with-gnu-as Specify that the compiler should assume that the assembler it finds is the GNU assembler. However, this does not modify |