1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Link with `-z relro' when available.

* acinclude.m4 (GUILE_GNU_LD_RELRO): New macro.

* configure.in: Use `GUILE_GNU_LD_RELRO'.
This commit is contained in:
Ludovic Courtès 2009-02-12 23:20:15 +01:00
parent 7b96f3ddfd
commit 9d19a9d61c
2 changed files with 22 additions and 0 deletions

View file

@ -311,6 +311,24 @@ fi
AC_LANG_RESTORE
])dnl ACX_PTHREAD
dnl GUILE_GNU_LD_RELRO
dnl
dnl Check whether GNU ld's read-only relocations (the `PT_GNU_RELRO'
dnl ELF segment header) are supported. This allows things like
dnl statically allocated cells (1) to eventually be remapped read-only
dnl by the loader, and (2) to be identified as pointerless by the
dnl garbage collector.
AC_DEFUN([GUILE_GNU_LD_RELRO], [
AC_MSG_CHECKING([whether the linker understands `-z relro'])
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,-z -Wl,relro"
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
LDFLAGS="$save_LDFLAGS"])
])
dnl GUILE_READLINE
dnl
dnl Check all the things needed by `guile-readline', the Readline

View file

@ -1439,6 +1439,10 @@ esac
AC_SUBST(GCC_CFLAGS)
# Check for GNU ld's "-z relro".
GUILE_GNU_LD_RELRO
## If we're creating a shared library (using libtool!), then we'll
## need to generate a list of .lo files corresponding to the .o files
## given in LIBOBJS. We'll call it LIBLOBJS.