23042115 compiler runpaths have returned to menace us all
authorShawn Walker-Salas <shawn.walker@oracle.com>
Fri, 01 Apr 2016 20:01:47 -0700
changeset 5717 0ce9ba275890
parent 5716 ffdc005c7dcc
child 5718 0ec11277a3e4
23042115 compiler runpaths have returned to menace us all 23042139 cups makefile sets flags that are ignored
components/cups/Makefile
components/fastcgi/Makefile
components/gnome/evince/Makefile
components/gnutls/Makefile
--- a/components/cups/Makefile	Fri Apr 01 19:25:24 2016 -0700
+++ b/components/cups/Makefile	Fri Apr 01 20:01:47 2016 -0700
@@ -38,6 +38,9 @@
 TEST_TARGET= $(NO_TESTS)
 include $(WS_MAKE_RULES)/common.mk
 
+# Ensure CC-based linking does not embed runpaths.
+LDFLAGS += $(studio_NORUNPATH)
+
 # don't use LD_Z_IGNORE: causes linker problems
 LD_Z_IGNORE=
 
@@ -51,10 +54,15 @@
 CXXFLAGS.stripped := $(patsubst -m32,,$(CXXFLAGS))
 CXXFLAGS= $(CXXFLAGS.stripped)
 
+CONFIGURE_ENV += "ac_cv_search_getifaddrs=no"
+CONFIGURE_ENV += "ac_cv_func_statfs=no"
+# Ensure dynamic shared objects are linked using same LDFLAGS as executables.
+CONFIGURE_ENV += DSOFLAGS="$(LDFLAGS)"
+
 CONFIGURE_OPTIONS +=	--localedir=$(USRSHARELOCALEDIR)
 CONFIGURE_OPTIONS +=	--sysconfdir=$(ETCDIR)
 CONFIGURE_OPTIONS +=	--localstatedir=$(VARDIR)
-CONFIGURE_OPTIONS +=	--with-fontpath=/usr/openwin/lib
+CONFIGURE_OPTIONS +=	--with-fontpath=$(USRSHAREFONTSDIR)
 CONFIGURE_OPTIONS +=	--with-logdir=$(VARDIR)/log/cups
 CONFIGURE_OPTIONS +=	--with-domainsocket=$(VARDIR)/run/cups-socket
 CONFIGURE_OPTIONS +=	--with-smfmanifestdir=$(LIBDIR)/svc/manifest/application
@@ -72,11 +80,6 @@
 CONFIGURE_OPTIONS +=	--enable-auditing
 CONFIGURE_OPTIONS +=	--without-php
 
-CONFIGURE_OPTIONS += 	ARCH64FLAGS=-m64
-CONFIGURE_OPTIONS += 	DSO64FLAGS="$(LDLIBS) -G"
-CONFIGURE_OPTIONS += 	"ac_cv_search_getifaddrs=no"
-CONFIGURE_OPTIONS += 	"ac_cv_func_statfs=no"
-
 $(BUILD_DIR)/%/.installed:	ENV +=	DSTROOT="$(PROTO_DIR)"
 
 PATCH_LEVEL =	0
--- a/components/fastcgi/Makefile	Fri Apr 01 19:25:24 2016 -0700
+++ b/components/fastcgi/Makefile	Fri Apr 01 20:01:47 2016 -0700
@@ -40,7 +40,10 @@
 TEST_TARGET= $(NO_TESTS)
 include $(WS_MAKE_RULES)/common.mk
 
-CONFIGURE_OPTIONS += --bindir=$(USRBINDIR)
+# Tell libtool to pass this flag through using -Wc.
+# https://www.gnu.org/software/libtool/manual/html_node/Stripped-link-flags.html
+LDFLAGS +=	-Wc,$(studio_NORUNPATH)
+
 CONFIGURE_OPTIONS += --disable-static
 CONFIGURE_OPTIONS += --with-pic
 CONFIGURE_OPTIONS += --includedir=$(CONFIGURE_INCLUDEDIR)/fastcgi
--- a/components/gnome/evince/Makefile	Fri Apr 01 19:25:24 2016 -0700
+++ b/components/gnome/evince/Makefile	Fri Apr 01 20:01:47 2016 -0700
@@ -51,6 +51,9 @@
 
 CFLAGS +=	"-I$(USRINCDIR)/libxml2"
 LDFLAGS +=	$(CC_BITS) -lgmodule-2.0 -lm
+# Tell libtool to pass this flag through using -Wc.
+# https://www.gnu.org/software/libtool/manual/html_node/Stripped-link-flags.html
+LDFLAGS +=	-Wc,$(studio_NORUNPATH)
 
 CONFIGURE_OPTIONS +=	--libexecdir="$(USRLIB)"
 CONFIGURE_OPTIONS +=	--sysconfdir="$(ETCDIR)"
@@ -60,8 +63,6 @@
 # Assumes GNU msgfmt is in PATH.
 COMPONENT_BUILD_ENV += PATH="$(PATH)"
 
-COMPONENT_BUILD_ENV += LDFLAGS="$(LDFLAGS) $(studio_NORUNPATH)"
-
 # Always show the build and link lines for easier debugging.
 COMPONENT_BUILD_ARGS += V=1
 
--- a/components/gnutls/Makefile	Fri Apr 01 19:25:24 2016 -0700
+++ b/components/gnutls/Makefile	Fri Apr 01 20:01:47 2016 -0700
@@ -36,6 +36,10 @@
 
 COMPONENT_BUILD_TARGETS = all info
 
+# Tell libtool to pass this flag through using -Wc.
+# https://www.gnu.org/software/libtool/manual/html_node/Stripped-link-flags.html
+studio_NORUNPATH := -Wc,$(studio_NORUNPATH)
+
 include $(WS_MAKE_RULES)/gnu-component.mk
 
 PATH=$(dir $(CC)):$(USRLIBDIR):$(USRBINDIR):$(USRSBINDIR):$(GNUBIN)
@@ -43,7 +47,7 @@
 CONFIGURE_OPTIONS  += --sysconfdir=$(ETCDIR)
 CONFIGURE_OPTIONS  += --infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS  += --localstatedir=$(VARDIR)
-CONFIGURE_OPTIONS  += --enable-guile=no 
+CONFIGURE_OPTIONS  += --disable-guile
 CONFIGURE_OPTIONS  += --disable-camellia
 
 ASLR_MODE = $(ASLR_ENABLE)