From 76e8a7588c7cdbdfe96be81366fe9ef43960423f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 24 Sep 2009 00:04:37 +0200 Subject: [PATCH] Move "-z relro" out of $LDFLAGS so it's not in `guile-2.0.pc'. * acinclude.m4 (GUILE_GNU_LD_RELRO): Substitute `GNU_LD_FLAGS'. * libguile/Makefile.am (libguile_la_LDFLAGS): Add $(GNU_LD_FLAGS). * srfi/Makefile.am (AM_LDFLAGS): New. --- acinclude.m4 | 12 +++++++++--- libguile/Makefile.am | 6 +++++- srfi/Makefile.am | 3 ++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index edabf24a2..1b836ccbd 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -317,16 +317,22 @@ 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. +dnl garbage collector. Substitute `GNU_LD_FLAGS' with the relevant +dnl flags. AC_DEFUN([GUILE_GNU_LD_RELRO], [ AC_MSG_CHECKING([whether the linker understands `-z relro']) + GNU_LD_FLAGS="-Wl,-z -Wl,relro" + save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -Wl,-z -Wl,relro" + LDFLAGS="$LDFLAGS $GNU_LD_FLAGS" AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) - LDFLAGS="$save_LDFLAGS"]) + GNU_LD_FLAGS=""]) + LDFLAGS="$save_LDFLAGS" + + AC_SUBST([GNU_LD_FLAGS]) ]) dnl GUILE_READLINE diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 8f4b976ff..acb26d9ec 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -433,7 +433,11 @@ noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c libguile_la_DEPENDENCIES = @LIBLOBJS@ libguile_la_LIBADD = @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP) $(LTLIBUNISTRING) -libguile_la_LDFLAGS = @LTLIBINTL@ -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ -export-dynamic -no-undefined +libguile_la_LDFLAGS = \ + @LTLIBINTL@ \ + -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ \ + -export-dynamic -no-undefined \ + $(GNU_LD_FLAGS) if HAVE_LD_VERSION_SCRIPT diff --git a/srfi/Makefile.am b/srfi/Makefile.am index 648603007..459d60633 100644 --- a/srfi/Makefile.am +++ b/srfi/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with Automake to create Makefile.in ## -## Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +## Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ## ## This file is part of GUILE. ## @@ -30,6 +30,7 @@ AM_CPPFLAGS = -I.. -I$(srcdir)/.. \ -I$(top_srcdir)/lib -I$(top_builddir)/lib AM_CFLAGS = $(GCC_CFLAGS) +AM_LDFLAGS = $(GNU_LD_FLAGS) srfiincludedir = $(pkgincludedir)/srfi