summaryrefslogtreecommitdiff
path: root/lang/gcc48
diff options
context:
space:
mode:
authormaya <maya@pkgsrc.org>2019-09-08 14:47:52 +0000
committermaya <maya@pkgsrc.org>2019-09-08 14:47:52 +0000
commit31ce94372a5c8e3f1435c7ae0e50cd7bdd080061 (patch)
tree9afe91785cc6a6f1c303d70f21be70e7435b2536 /lang/gcc48
parentbdeaab7b6acd5f155be8f57a81613519812b1d38 (diff)
downloadpkgsrc-31ce94372a5c8e3f1435c7ae0e50cd7bdd080061.tar.gz
gcc{48,49,5,6,7,8}: In the case of a "system GCC", detect if the system
libgcc is newer than the one about to be installed. If so, don't install the libgcc. Having an older libgcc appear in the lookup may result in binaries not running, as they need symbols from the newer libgcc. Such a case is PR pkg/54506. Leaves SunOS unchanged, by request from jperkin.
Diffstat (limited to 'lang/gcc48')
-rw-r--r--lang/gcc48/options.mk37
1 files changed, 34 insertions, 3 deletions
diff --git a/lang/gcc48/options.mk b/lang/gcc48/options.mk
index 56de642807a..4ff3eb6ed38 100644
--- a/lang/gcc48/options.mk
+++ b/lang/gcc48/options.mk
@@ -1,17 +1,22 @@
-# $NetBSD: options.mk,v 1.11 2016/09/30 13:16:59 sevan Exp $
+# $NetBSD: options.mk,v 1.12 2019/09/08 14:47:53 maya Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.${GCC_PKGNAME}
PKG_SUPPORTED_OPTIONS= nls gcc-inplace-math gcc-c++ gcc-fortran gcc-java \
- gcc-go gcc-objc gcc-objc++ gcc-graphite
+ gcc-go gcc-objc gcc-objc++ gcc-graphite always-libgcc
PKG_SUGGESTED_OPTIONS= gcc-c++ gcc-fortran gcc-objc gcc-objc++ gcc-graphite
PKG_SUGGESTED_OPTIONS.DragonFly+= nls
PKG_SUGGESTED_OPTIONS.Linux+= nls
PKG_SUGGESTED_OPTIONS.NetBSD+= nls
-PKG_SUGGESTED_OPTIONS.SunOS+= gcc-inplace-math
+PKG_SUGGESTED_OPTIONS.SunOS+= gcc-inplace-math always-libgcc
# gcc-java was dropped from PKG_SUGGESTED_OPTIONS to spare legacy systems attempting bulkbuilds
# For example on Darwin/PowerPC this option adds another 24 hours to build time on a G4.
+.include "../../mk/compiler.mk"
+.if empty(PKGSRC_COMPILER:Mgcc)
+PKG_SUGGESTED_OPTIONS+= always-libgcc
+.endif
+
###
### Determine if multilib is avalible.
###
@@ -55,6 +60,32 @@ CONFIGURE_ARGS+= --disable-multilib
.endif
###
+### Don't install libgcc if it's older than the system one
+###
+.if empty(PKG_OPTIONS:Malways-libgcc)
+
+.for _libdir_ in ${_OPSYS_LIB_DIRS}
+. if exists(${_libdir_})
+BASE_LIBGCC!= find ${_libdir_} -name libgcc_s.so
+BASE_LIBGCC_MATCH_STRING!= ${ECHO} ${BASE_LIBGCC} ${GCC48_DIST_VERSION} | \
+ ${AWK} -f ../../mk/scripts/larger_symbol_version.awk
+. if ${BASE_LIBGCC_MATCH_STRING:Mnewer}
+DELETE_INSTALLED_LIBGCC= yes
+. endif
+. endif
+.endfor
+
+.if ${DELETE_INSTALLED_LIBGCC:Uno}
+post-install: delete-installed-libgcc
+
+delete-installed-libgcc:
+ ${FIND} ${DESTDIR} -name 'libgcc_s.so*' -delete
+
+.endif
+
+.endif
+
+###
### Build math libraries in place
###
.if !empty(PKG_OPTIONS:Mgcc-inplace-math)