From d067ec29b6556708afca4b441ea8c11ec6d7f082 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 4 Jun 2009 19:09:04 +0000 Subject: [PATCH] - link binaries to produce position-independent executables, and strip the flags used to do so, and library path flags, from the output of krb5-config - install shared libraries with the execute bit set - we used to override RPATH here, but configure takes --disable-rpath now --- krb5-1.7-buildconf.patch | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 krb5-1.7-buildconf.patch diff --git a/krb5-1.7-buildconf.patch b/krb5-1.7-buildconf.patch new file mode 100644 index 0000000..0319e50 --- /dev/null +++ b/krb5-1.7-buildconf.patch @@ -0,0 +1,31 @@ +Build binaries in this package as PIEs, install shared libraries with the +execute bit set on them, and prune out the -L/usr/lib* and PIE flags where they +might leak out and affect apps which want to link with the libraries. + +diff -up krb5-1.7/src/config/shlib.conf krb5-1.7/src/config/shlib.conf +--- krb5-1.7/src/config/shlib.conf 2008-12-08 17:33:07.000000000 -0500 ++++ krb5-1.7/src/config/shlib.conf 2009-06-04 14:01:28.000000000 -0400 +@@ -421,6 +421,8 @@ mips-*-netbsd*) + RPATH_FLAG='-Wl,-rpath -Wl,' + PROG_RPATH_FLAGS='$(RPATH_FLAG)$(PROG_RPATH)' + CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CFLAGS) $(LDFLAGS)' ++ CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CFLAGS) -pie $(LDFLAGS)' ++ INSTALL_SHLIB='${INSTALL} -m755' + CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) $(CFLAGS) $(LDFLAGS)' + CXX_LINK_SHARED='$(CXX) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CXXFLAGS) $(LDFLAGS)' + CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)' +diff -up krb5-1.7/src/krb5-config.in krb5-1.7/src/krb5-config.in +--- krb5-1.7/src/krb5-config.in 2009-06-04 14:01:28.000000000 -0400 ++++ krb5-1.7/src/krb5-config.in 2009-06-04 14:01:28.000000000 -0400 +@@ -189,6 +189,11 @@ if test -n "$do_libs"; then + -e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \ + -e 's#\$(CFLAGS)#'"$CFLAGS"'#'` + ++ if test `dirname $libdir` = /usr ; then ++ lib_flags=`echo $lib_flags | sed -e "s#-L$libdir##" -e "s#$RPATH_FLAG$libdir##"` ++ fi ++ lib_flags=`echo $lib_flags | sed -e "s#-fPIE##" -e "s#-pie##"` ++ + if test $library = 'kdb'; then + lib_flags="$lib_flags -lkdb5 $KDB5_DB_LIB" + library=krb5