diff --git a/build/unix/mozconfig.lto b/build/unix/mozconfig.lto index d825ac6158a7..c62104f8c857 100644 --- a/build/unix/mozconfig.lto +++ b/build/unix/mozconfig.lto @@ -17,5 +17,8 @@ if [ -e "$topsrcdir/gcc/bin/ld" ]; then fi ac_add_options --enable-lto +# Until it's either made the default or we figure a way to remove the +# copy locations that LTO induces in non-PIE executables. +ac_add_options --enable-pie . "$topsrcdir/build/unix/mozconfig.stdcxx" diff --git a/js/src/old-configure.in b/js/src/old-configure.in index ba016082eec6..70dd46dc7319 100644 --- a/js/src/old-configure.in +++ b/js/src/old-configure.in @@ -485,6 +485,13 @@ if test "$GNU_CC"; then AC_MSG_RESULT([no]) LDFLAGS=$_SAVE_LDFLAGS) + AC_MSG_CHECKING([for -z nocopyreloc option to ld]) + _SAVE_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-z,nocopyreloc" + AC_TRY_LINK(,,AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no]) + LDFLAGS=$_SAVE_LDFLAGS) + AC_MSG_CHECKING([for --build-id option to ld]) _SAVE_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--build-id" diff --git a/old-configure.in b/old-configure.in index 30ed601d8423..880def074ddc 100644 --- a/old-configure.in +++ b/old-configure.in @@ -545,6 +545,13 @@ if test "$GNU_CC"; then AC_MSG_RESULT([no]) LDFLAGS=$_SAVE_LDFLAGS) + AC_MSG_CHECKING([for -z nocopyreloc option to ld]) + _SAVE_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-z,nocopyreloc" + AC_TRY_LINK(,,AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no]) + LDFLAGS=$_SAVE_LDFLAGS) + AC_MSG_CHECKING([for --build-id option to ld]) _SAVE_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--build-id"