Bug 185902 - Ports lang/gccNN are missing runpath (-Wl,-rpath), and cause conflicts with the base system
Ports lang/gccNN are missing runpath (-Wl,-rpath), and cause conflicts with t...
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Gerald Pfeifer
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-20 06:00 UTC by yuri
Modified: 2014-04-30 15:28 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yuri 2014-01-20 06:00:00 UTC
Recent system update introduced this failure:
$ qbittorrent
/usr/lib/libstdc++.so.6: version GLIBCXX_3.4.15 required by /usr/local/lib/libtorrent-rasterbar.so.7 not found

System libstdc++.so.6 is picked up instead of the one from lang/gcc47

All lang/gccNN are missing runpath (-Wl,-rpath) to force their own shared libaries, opening the possibilities of such conflicts with the base system.

lang/gcc-aux is an example of how this should be done.
Comment 1 Mark Linimon freebsd_committer 2014-01-20 18:02:42 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gerald

Over to maintainer.
Comment 2 Gerald Pfeifer freebsd_committer 2014-02-10 00:36:50 UTC
State Changed
From-To: open->suspended

This should not be necessary by virtue of us setting CFLAGS, CXXFLAGS, 
LDFLAGS in Mk/bsd.gcc.mk when USE_GCC is used in a port. 

That said, this is an interesting idea for uses of these ports outside 
the Ports Collection framework and I am planning to revisit and having 
finished an updated of USE_GCC=yes to GCC 4.7 and then a next one to 
GCC 4.8.  After those two rounds, the first of which should be nearly 
done, we'll have fixed general problems with (lack of) using those 
standard flags.  Something which identifies itself in a similar manner 
but needs to be fixed more generally.
Comment 3 dfilter freebsd_committer 2014-04-13 00:36:27 UTC
Author: gerald
Date: Sat Apr 12 23:36:24 2014
New Revision: 351159
URL: http://svnweb.freebsd.org/changeset/ports/351159
QAT: https://qat.redports.org/buildarchive/r351159/

Log:
  Update to the 20140406 snapshot of GCC 4.9.0.
  
  Add pkg-message that references the need to use -Wl,-rpath=... . [1]
  
  No longer install rebuild-gcj-db49 (which requires bash among others)
  and its man page.
  
  PR:		185902 [1]

Added:
  head/lang/gcc49/files/pkg-message.in   (contents, props changed)
Modified:
  head/lang/gcc49/Makefile
  head/lang/gcc49/distinfo
  head/lang/gcc49/pkg-plist

Modified: head/lang/gcc49/Makefile
==============================================================================
--- head/lang/gcc49/Makefile	Sat Apr 12 23:35:44 2014	(r351158)
+++ head/lang/gcc49/Makefile	Sat Apr 12 23:36:24 2014	(r351159)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	gcc49
-PORTVERSION=	4.9.0.20140330
+PORTVERSION=	4.9.0.20140406
 CATEGORIES=	lang java
 MASTER_SITES=	${MASTER_SITE_GCC}
 MASTER_SITE_SUBDIR=	snapshots/${DISTVERSION}
@@ -99,6 +99,8 @@ INFO=		gcc${SUFFIX}/cpp \
 INFO+=		gcc${SUFFIX}/libquadmath \
 		gcc${SUFFIX}/libitm
 .endif
+SUB_FILES=	pkg-message
+SUB_LIST+=	TARGLIB=${TARGLIB}
 
 .if ${PORT_OPTIONS:MJAVA}
 ECJ_JAR=	${LOCALBASE}/share/java/ecj-4.5.jar
@@ -133,6 +135,8 @@ full-regression-test: build
 post-install:
 	${RM} -f ${STAGEDIR}${TARGLIB}/*.la
 	${RM} -f ${STAGEDIR}${PREFIX}/man/man7/*
+	${RM} -f ${STAGEDIR}${PREFIX}/bin/rebuild-gcj-db${SUFFIX} \
+	         ${STAGEDIR}${PREFIX}/man/man1/rebuild-gcj-db${SUFFIX}.1
 	# Add target libraries and include files to packaging list.
 	${RM} -f ${WRKDIR}/PLIST.lib
 .for d in ${TARGLIB:S/^${PREFIX}\///} ${LIBEXEC:S/^${PREFIX}\///} include/gcj include/gnu include/java include/javax

Modified: head/lang/gcc49/distinfo
==============================================================================
--- head/lang/gcc49/distinfo	Sat Apr 12 23:35:44 2014	(r351158)
+++ head/lang/gcc49/distinfo	Sat Apr 12 23:36:24 2014	(r351159)
@@ -1,2 +1,2 @@
-SHA256 (gcc-4.9-20140330.tar.bz2) = 34374d87b1a58bf5d11d7bc53b921088281c731bc141907049f2f57f453af104
-SIZE (gcc-4.9-20140330.tar.bz2) = 85486216
+SHA256 (gcc-4.9-20140406.tar.bz2) = 5f9e1c96b5bc000456b7fe7805dca90866cd18b6fbe00e26f3f3e8236d07d0a3
+SIZE (gcc-4.9-20140406.tar.bz2) = 85440592

Added: head/lang/gcc49/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/gcc49/files/pkg-message.in	Sat Apr 12 23:36:24 2014	(r351159)
@@ -0,0 +1,6 @@
+To ensure binaries built with this toolchain find appropriate versions
+of the necessary run-time libraries, you may want to link using
+
+  -Wl,-rpath=%%TARGLIB%%
+
+For ports leveraging USE_GCC or USES=compiler this happens transparently.

Modified: head/lang/gcc49/pkg-plist
==============================================================================
--- head/lang/gcc49/pkg-plist	Sat Apr 12 23:35:44 2014	(r351158)
+++ head/lang/gcc49/pkg-plist	Sat Apr 12 23:36:24 2014	(r351159)
@@ -52,7 +52,6 @@ share/gcc-%%GCC_VERSION%%/python/libstdc
 %%JAVA%%bin/gtnameserv%%SUFFIX%%
 %%JAVA%%bin/jcf-dump%%SUFFIX%%
 %%JAVA%%bin/jv-convert%%SUFFIX%%
-%%JAVA%%bin/rebuild-gcj-db%%SUFFIX%%
 %%JAVA%%libdata/pkgconfig/libgcj-4.9.pc
 %%JAVA%%man/man1/aot-compile%%SUFFIX%%.1.gz
 %%JAVA%%man/man1/gappletviewer%%SUFFIX%%.1.gz
@@ -75,7 +74,6 @@ share/gcc-%%GCC_VERSION%%/python/libstdc
 %%JAVA%%man/man1/gtnameserv%%SUFFIX%%.1.gz
 %%JAVA%%man/man1/jcf-dump%%SUFFIX%%.1.gz
 %%JAVA%%man/man1/jv-convert%%SUFFIX%%.1.gz
-%%JAVA%%man/man1/rebuild-gcj-db%%SUFFIX%%.1.gz
 %%JAVA%%share/java/libgcj-%%GCC_VERSION%%.jar
 %%JAVA%%share/java/libgcj-tools-%%GCC_VERSION%%.jar
 @exec if type ccache-update-links >/dev/null 2>&1; then ccache-update-links -v; fi
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 dfilter freebsd_committer 2014-04-13 02:18:18 UTC
Author: gerald
Date: Sun Apr 13 01:18:14 2014
New Revision: 351167
URL: http://svnweb.freebsd.org/changeset/ports/351167
QAT: https://qat.redports.org/buildarchive/r351167/

Log:
  Update to the 20140410 snapshot of GCC 4.8.3.
  
  Add pkg-message that references the need to use -Wl,-rpath=... . [1]
  
  PR:		185902 [1]

Added:
  head/lang/gcc48/files/pkg-message.in   (contents, props changed)
Modified:
  head/lang/gcc48/Makefile
  head/lang/gcc48/distinfo

Modified: head/lang/gcc48/Makefile
==============================================================================
--- head/lang/gcc48/Makefile	Sun Apr 13 00:19:47 2014	(r351166)
+++ head/lang/gcc48/Makefile	Sun Apr 13 01:18:14 2014	(r351167)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	gcc48
-PORTVERSION=	4.8.3.s20140320
+PORTVERSION=	4.8.3.s20140410
 CATEGORIES=	lang java
 MASTER_SITES=	${MASTER_SITE_GCC}
 MASTER_SITE_SUBDIR=	snapshots/${DISTVERSION}
@@ -99,6 +99,8 @@ INFO=		gcc${SUFFIX}/cpp \
 INFO+=		gcc${SUFFIX}/libquadmath \
 		gcc${SUFFIX}/libitm
 .endif
+SUB_FILES=	pkg-message
+SUB_LIST+=	TARGLIB=${TARGLIB}
 
 .if ${PORT_OPTIONS:MJAVA}
 ECJ_JAR=	${LOCALBASE}/share/java/ecj-4.5.jar

Modified: head/lang/gcc48/distinfo
==============================================================================
--- head/lang/gcc48/distinfo	Sun Apr 13 00:19:47 2014	(r351166)
+++ head/lang/gcc48/distinfo	Sun Apr 13 01:18:14 2014	(r351167)
@@ -1,2 +1,2 @@
-SHA256 (gcc-4.8-20140320.tar.bz2) = 22f7ca105d75bdff37d7a402295d908620badee7b6c7baa4ca2ad5234a5809bb
-SIZE (gcc-4.8-20140320.tar.bz2) = 81776915
+SHA256 (gcc-4.8-20140410.tar.bz2) = f9fb81bc6ca7582ad4caa36e59a70844307c28b183d1dfc20b6e16646aab30f7
+SIZE (gcc-4.8-20140410.tar.bz2) = 82009401

Added: head/lang/gcc48/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/gcc48/files/pkg-message.in	Sun Apr 13 01:18:14 2014	(r351167)
@@ -0,0 +1,6 @@
+To ensure binaries built with this toolchain find appropriate versions
+of the necessary run-time libraries, you may want to link using
+
+  -Wl,-rpath=%%TARGLIB%%
+
+For ports leveraging USE_GCC or USES=compiler this happens transparently.
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 dfilter freebsd_committer 2014-04-21 04:13:30 UTC
Author: gerald
Date: Mon Apr 21 03:13:26 2014
New Revision: 351667
URL: http://svnweb.freebsd.org/changeset/ports/351667
QAT: https://qat.redports.org/buildarchive/r351667/

Log:
  Update to the 20140419 snapshot of GCC 4.7.4.
  
  Add pkg-message that references the need to use -Wl,-rpath=... . [1]
  
  PR:		185902 [1]

Added:
  head/lang/gcc47/files/pkg-message.in   (contents, props changed)
Modified:
  head/lang/gcc47/Makefile
  head/lang/gcc47/distinfo

Modified: head/lang/gcc47/Makefile
==============================================================================
--- head/lang/gcc47/Makefile	Mon Apr 21 02:45:32 2014	(r351666)
+++ head/lang/gcc47/Makefile	Mon Apr 21 03:13:26 2014	(r351667)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	gcc47
-PORTVERSION=	4.7.4.20140412
+PORTVERSION=	4.7.4.20140419
 CATEGORIES=	lang java
 MASTER_SITES=	${MASTER_SITE_GCC}
 MASTER_SITE_SUBDIR=	snapshots/${DISTVERSION}
@@ -101,6 +101,8 @@ INFO=		gcc${SUFFIX}/cpp \
 INFO+=		gcc${SUFFIX}/libquadmath \
 		gcc${SUFFIX}/libitm
 .endif
+SUB_FILES=	pkg-message
+SUB_LIST+=	TARGLIB=${TARGLIB}
 
 .if ${PORT_OPTIONS:MJAVA}
 ECJ_JAR=	${LOCALBASE}/share/java/ecj-4.5.jar

Modified: head/lang/gcc47/distinfo
==============================================================================
--- head/lang/gcc47/distinfo	Mon Apr 21 02:45:32 2014	(r351666)
+++ head/lang/gcc47/distinfo	Mon Apr 21 03:13:26 2014	(r351667)
@@ -1,2 +1,2 @@
-SHA256 (gcc-4.7-20140412.tar.bz2) = c4e747ed56323987e231a4b0c482b9594a2ac2be0b0fa8798aea267c06ff4612
-SIZE (gcc-4.7-20140412.tar.bz2) = 78901897
+SHA256 (gcc-4.7-20140419.tar.bz2) = a3678fc0d5d61fed33e84a9bcb5be700115009bb5e5dff8ce76ef9d501c8be72
+SIZE (gcc-4.7-20140419.tar.bz2) = 78907262

Added: head/lang/gcc47/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/gcc47/files/pkg-message.in	Mon Apr 21 03:13:26 2014	(r351667)
@@ -0,0 +1,7 @@
+To ensure binaries built with this toolchain find appropriate versions
+of the necessary run-time libraries, you may want to link using
+
+  -Wl,-rpath=%%TARGLIB%%
+
+For ports leveraging USE_GCC, USES=compiler, or USES=fortran this happens
+transparently.
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 dfilter freebsd_committer 2014-04-30 00:53:11 UTC
Author: gerald
Date: Tue Apr 29 23:53:07 2014
New Revision: 352664
URL: http://svnweb.freebsd.org/changeset/ports/352664
QAT: https://qat.redports.org/buildarchive/r352664/

Log:
  Merge updates from lang/gcc47 (and similarly lang/gcc48):
  
   - Add pkg-message that references the need to use -Wl,-rpath=... . [1]
  
   - Replace USE_BZIP2 by USES=tar:bzip2.
  
   - No longer install rebuild-gcj-db47 (which requires bash among others)
     and its man page.
  
  Bump PORTREVISION.
  
  PR:		185902 [1]

Added:
  head/lang/gcc/files/pkg-message.in   (contents, props changed)
Modified:
  head/lang/gcc/Makefile
  head/lang/gcc/pkg-plist

Modified: head/lang/gcc/Makefile
==============================================================================
--- head/lang/gcc/Makefile	Tue Apr 29 23:45:55 2014	(r352663)
+++ head/lang/gcc/Makefile	Tue Apr 29 23:53:07 2014	(r352664)
@@ -3,6 +3,7 @@
 
 PORTNAME=	gcc
 PORTVERSION=	4.7.3
+PORTREVISION=	1
 CATEGORIES=	lang java
 MASTER_SITES=	${MASTER_SITE_GCC}
 MASTER_SITE_SUBDIR=	releases/gcc-${DISTVERSION}
@@ -31,9 +32,8 @@ DISTVERSION=	${PORTVERSION}
 GCC_VERSION=	${PORTVERSION:C/(.+)\.[0-9]{8}/\1/}
 SUFFIX=		${PORTVERSION:C/([0-9]+).([0-9]+).*/\1\2/}
 ONLY_FOR_ARCHS=	amd64 i386 powerpc powerpc64 sparc64
-USES=		gmake iconv perl5
+USES=		gmake iconv perl5 tar:bzip2
 USE_BINUTILS=	yes
-USE_BZIP2=	yes
 USE_PERL5=	build
 SSP_UNSAFE=	yes
 
@@ -99,6 +99,8 @@ INFO=		gcc${SUFFIX}/cpp \
 INFO+=		gcc${SUFFIX}/libquadmath \
 		gcc${SUFFIX}/libitm
 #.endif
+SUB_FILES=	pkg-message
+SUB_LIST+=	TARGLIB=${TARGLIB}
 
 .if ${PORT_OPTIONS:MJAVA}
 ECJ_JAR=	${LOCALBASE}/share/java/ecj-4.5.jar
@@ -133,6 +135,8 @@ full-regression-test: build
 post-install:
 	${RM} -f ${STAGEDIR}${TARGLIB}/*.la
 	${RM} -f ${STAGEDIR}${PREFIX}/man/man7/*
+	${RM} -f ${STAGEDIR}${PREFIX}/bin/rebuild-gcj-db${SUFFIX} \
+	         ${STAGEDIR}${PREFIX}/man/man1/rebuild-gcj-db${SUFFIX}.1
 	# Add target libraries and include files to packaging list.
 	${RM} -f ${WRKDIR}/PLIST.lib
 .for d in ${TARGLIB:S/^${PREFIX}\///} ${LIBEXEC:S/^${PREFIX}\///} include/gcj include/gnu include/java include/javax

Added: head/lang/gcc/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/gcc/files/pkg-message.in	Tue Apr 29 23:53:07 2014	(r352664)
@@ -0,0 +1,7 @@
+To ensure binaries built with this toolchain find appropriate versions
+of the necessary run-time libraries, you may want to link using
+
+  -Wl,-rpath=%%TARGLIB%%
+
+For ports leveraging USE_GCC, USES=compiler, or USES=fortran this happens
+transparently.

Modified: head/lang/gcc/pkg-plist
==============================================================================
--- head/lang/gcc/pkg-plist	Tue Apr 29 23:45:55 2014	(r352663)
+++ head/lang/gcc/pkg-plist	Tue Apr 29 23:53:07 2014	(r352664)
@@ -52,7 +52,6 @@ share/gcc-%%GCC_VERSION%%/python/libstdc
 %%JAVA%%bin/gtnameserv%%SUFFIX%%
 %%JAVA%%bin/jcf-dump%%SUFFIX%%
 %%JAVA%%bin/jv-convert%%SUFFIX%%
-%%JAVA%%bin/rebuild-gcj-db%%SUFFIX%%
 %%JAVA%%libdata/pkgconfig/libgcj-4.7.pc
 %%JAVA%%man/man1/aot-compile%%SUFFIX%%.1.gz
 %%JAVA%%man/man1/gappletviewer%%SUFFIX%%.1.gz
@@ -75,7 +74,6 @@ share/gcc-%%GCC_VERSION%%/python/libstdc
 %%JAVA%%man/man1/gtnameserv%%SUFFIX%%.1.gz
 %%JAVA%%man/man1/jcf-dump%%SUFFIX%%.1.gz
 %%JAVA%%man/man1/jv-convert%%SUFFIX%%.1.gz
-%%JAVA%%man/man1/rebuild-gcj-db%%SUFFIX%%.1.gz
 %%JAVA%%man/man3/ffi%%SUFFIX%%.3.gz
 %%JAVA%%man/man3/ffi_call%%SUFFIX%%.3.gz
 %%JAVA%%man/man3/ffi_prep_cif%%SUFFIX%%.3.gz
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 7 Gerald Pfeifer freebsd_committer 2014-04-30 15:27:03 UTC
State Changed
From-To: suspended->closed

Thanks for the report.  I have now added pkg-message notes for all 
lang/gcc* ports. 

Depending on the feedback we'll continue to get, we may want to give 
it a try and set -rpath for lang/gcc at least.