public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Aric Belsito" <lluixhi@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/musl:master commit in: eclass/
Date: Mon, 26 Dec 2016 00:04:31 +0000 (UTC)	[thread overview]
Message-ID: <1482710611.d245318d8912a6fef051fe1bdfbee626af72a742.lluixhi@gentoo> (raw)

commit:     d245318d8912a6fef051fe1bdfbee626af72a742
Author:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Mon Dec 26 00:01:52 2016 +0000
Commit:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Mon Dec 26 00:03:31 2016 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=d245318d

eclass: Synchronize toolchain.eclass with upstream.

musl supports __cxa_atexit, and --enable-__cxa_atexit is passed by default, but
it appears that upstream has a convention of including this in the
toolchain.eclass

 eclass/toolchain.eclass | 143 +++++++++++++++++++++++++++++++-----------------
 1 file changed, 94 insertions(+), 49 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 1192f62..a6034d3 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -131,7 +131,7 @@ else
 	LICENSE="GPL-2+ LGPL-2.1+ FDL-1.1+"
 fi
 
-IUSE="multislot regression-test vanilla"
+IUSE="regression-test vanilla"
 IUSE_DEF=( nls nptl )
 
 if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
@@ -152,9 +152,9 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
 	# versions which we dropped.  Since graphite was also experimental in
 	# the older versions, we don't want to bother supporting it.  #448024
 	tc_version_is_at_least 4.8 && IUSE+=" graphite" IUSE_DEF+=( sanitize )
-	tc_version_is_at_least 4.9 && IUSE+=" cilk"
-	tc_version_is_at_least 5.0 && IUSE+=" jit pch"
-	tc_version_is_at_least 6.0 && IUSE+=" pie +ssp"
+	tc_version_is_at_least 4.9 && IUSE+=" cilk +vtv"
+	tc_version_is_at_least 5.0 && IUSE+=" jit mpx"
+	tc_version_is_at_least 6.0 && IUSE+=" pie ssp +pch"
 fi
 
 IUSE+=" ${IUSE_DEF[*]/#/+}"
@@ -627,20 +627,47 @@ do_gcc_PIE_patches() {
 # configure to build with the hardened GCC specs as the default
 make_gcc_hard() {
 
-	# Gcc >= 6.X we don't need to sed in Makefile
-	# It have configurations options to turn pie/ssp on as default
+	local gcc_hard_flags=""
+	# Gcc >= 6.X we can use configuration options to turn pie/ssp on as default
 	if tc_version_is_at_least 6.0 ; then
-		if use hardened ; then
-			# rebrand to make bug reports easier
-			BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened}
-		fi
 		if use pie ; then
 			einfo "Updating gcc to use automatic PIE building ..."
 		fi
 		if use ssp ; then
 			einfo "Updating gcc to use automatic SSP building ..."
 		fi
-		return 1
+		if use hardened ; then
+			# Will add some optimizations by default.
+			gcc_hard_flags+=" -DEXTRA_OPTIONS"
+			# rebrand to make bug reports easier
+			BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened}
+		fi
+	else
+		if use hardened ; then
+			# rebrand to make bug reports easier
+			BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened}
+			if hardened_gcc_works ; then
+				einfo "Updating gcc to use automatic PIE + SSP building ..."
+				gcc_hard_flags+=" -DEFAULT_PIE_SSP"
+			elif hardened_gcc_works pie ; then
+				einfo "Updating gcc to use automatic PIE building ..."
+				ewarn "SSP has not been enabled by default"
+				gcc_hard_flags+=" -DEFAULT_PIE"
+			elif hardened_gcc_works ssp ; then
+				einfo "Updating gcc to use automatic SSP building ..."
+				ewarn "PIE has not been enabled by default"
+				gcc_hard_flags+=" -DEFAULT_SSP"
+			else
+				# do nothing if hardened isn't supported, but don't die either
+				ewarn "hardened is not supported for this arch in this gcc version"
+				return 0
+			fi
+		else
+			if hardened_gcc_works ssp ; then
+				einfo "Updating gcc to use automatic SSP building ..."
+				gcc_hard_flags+=" -DEFAULT_SSP"
+			fi
+		fi
 	fi
 
 	# we want to be able to control the pie patch logic via something other
@@ -651,36 +678,8 @@ make_gcc_hard() {
 	# Need to add HARD_CFLAGS to ALL_CXXFLAGS on >= 4.7
 	if tc_version_is_at_least 4.7 ; then
 		sed -e '/^ALL_CXXFLAGS/iHARD_CFLAGS = ' \
-                        -e 's|^ALL_CXXFLAGS = |ALL_CXXFLAGS = $(HARD_CFLAGS) |' \
-                        -i "${S}"/gcc/Makefile.in
-	fi
-
-	# defaults to enable for all toolchains
-	local gcc_hard_flags=""
-	if use hardened ; then
-		if hardened_gcc_works ; then
-			einfo "Updating gcc to use automatic PIE + SSP building ..."
-			gcc_hard_flags+=" -DEFAULT_PIE_SSP"
-		elif hardened_gcc_works pie ; then
-			einfo "Updating gcc to use automatic PIE building ..."
-			ewarn "SSP has not been enabled by default"
-			gcc_hard_flags+=" -DEFAULT_PIE"
-		elif hardened_gcc_works ssp ; then
-			einfo "Updating gcc to use automatic SSP building ..."
-			ewarn "PIE has not been enabled by default"
-			gcc_hard_flags+=" -DEFAULT_SSP"
-		else
-			# do nothing if hardened isn't supported, but don't die either
-			ewarn "hardened is not supported for this arch in this gcc version"
-			return 0
-		fi
-		# rebrand to make bug reports easier
-		BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened}
-	else
-		if hardened_gcc_works ssp ; then
-			einfo "Updating gcc to use automatic SSP building ..."
-			gcc_hard_flags+=" -DEFAULT_SSP"
-		fi
+			-e 's|^ALL_CXXFLAGS = |ALL_CXXFLAGS = $(HARD_CFLAGS) |' \
+			-i "${S}"/gcc/Makefile.in
 	fi
 
 	sed -i \
@@ -917,7 +916,7 @@ toolchain_src_configure() {
 	fi
 
 	# Support to disable pch when building libstdcxx
-	if tc_version_is_at_least 5.0 && ! use pch ; then
+	if tc_version_is_at_least 6.0 && ! use pch ; then
 		confgcc+=( --disable-libstdcxx-pch )
 	fi
 
@@ -1022,6 +1021,9 @@ toolchain_src_configure() {
 	*-elf|*-eabi)
 		confgcc+=( --with-newlib )
 		;;
+	*-musl*)
+		confgcc+=( --enable-__cxa_atexit )
+		;;
 	*-gnu*)
 		confgcc+=(
 			--enable-__cxa_atexit
@@ -1187,6 +1189,17 @@ toolchain_src_configure() {
 		confgcc+=( $(use_enable cilk libcilkrts) )
 	fi
 
+	if in_iuse mpx ; then
+		confgcc+=( $(use_enable mpx libmpx) )
+	fi
+
+	if in_iuse vtv ; then
+		confgcc+=(
+			$(use_enable vtv vtable-verify)
+			$(use_enable vtv libvtv)
+		)
+	fi
+
 	# newer gcc's come with libquadmath, but only fortran uses
 	# it, so auto punt it when we don't care
 	if tc_version_is_at_least 4.6 && ! is_fortran ; then
@@ -1756,13 +1769,49 @@ toolchain_src_install() {
 	if ! is_crosscompile ; then
 		insinto "${DATAPATH}"
 		newins "${GCC_FILESDIR}"/awk/fixlafiles.awk-no_gcc_la fixlafiles.awk || die
-		find "${D}/${LIBPATH}" -name libstdc++.la -type f -delete
-		find "${D}/${LIBPATH}" -name 'lib*san.la' -type f -delete #487550 #546700
 		exeinto "${DATAPATH}"
 		doexe "${GCC_FILESDIR}"/fix_libtool_files.sh || die
 		doexe "${GCC_FILESDIR}"/c{89,99} || die
 	fi
 
+	# libstdc++.la: Delete as it doesn't add anything useful: g++ itself
+	# handles linkage correctly in the dynamic & static case.  It also just
+	# causes us pain: any C++ progs/libs linking with libtool will gain a
+	# reference to the full libstdc++.la file which is gcc version specific.
+	# libstdc++fs.la: It doesn't link against anything useful.
+	# libsupc++.la: This has no dependencies.
+	# libcc1.la: There is no static library, only dynamic.
+	# libcc1plugin.la: Same as above, and it's loaded via dlopen.
+	# libgomp.la: gcc itself handles linkage (libgomp.spec).
+	# libgomp-plugin-*.la: Same as above, and it's an internal plugin only
+	# loaded via dlopen.
+	# libgfortran.la: gfortran itself handles linkage correctly in the
+	# dynamic & static case (libgfortran.spec). #573302
+	# libgfortranbegin.la: Same as above, and it's an internal lib.
+	# libmpx.la: gcc itself handles linkage correctly (libmpx.spec).
+	# libmpxwrappers.la: See above.
+	# libitm.la: gcc itself handles linkage correctly (libitm.spec).
+	# libvtv.la: gcc itself handles linkage correctly.
+	# lib*san.la: Sanitizer linkage is handled internally by gcc, and they
+	# do not support static linking. #487550 #546700
+	find "${D}/${LIBPATH}" \
+		'(' \
+			-name libstdc++.la -o \
+			-name libstdc++fs.la -o \
+			-name libsupc++.la -o \
+			-name libcc1.la -o \
+			-name libcc1plugin.la -o \
+			-name 'libgomp.la' -o \
+			-name 'libgomp-plugin-*.la' -o \
+			-name libgfortran.la -o \
+			-name libgfortranbegin.la -o \
+			-name libmpx.la -o \
+			-name libmpxwrappers.la -o \
+			-name libitm.la -o \
+			-name libvtv.la -o \
+			-name 'lib*san.la' \
+		')' -type f -delete
+
 	# Use gid of 0 because some stupid ports don't have
 	# the group 'root' set to gid 0.  Send to /dev/null
 	# for people who are testing as non-root.
@@ -2122,10 +2171,6 @@ should_we_gcc_config() {
 
 	local curr_branch_ver=$(get_version_component_range 1-2 ${curr_config_ver})
 
-	# If we're using multislot, just run gcc-config if we're installing
-	# to the same profile as the current one.
-	use multislot && return $([[ ${curr_config_ver} == ${GCC_CONFIG_VER} ]])
-
 	if [[ ${curr_branch_ver} == ${GCC_BRANCH_VER} ]] ; then
 		return 0
 	else


             reply	other threads:[~2016-12-26  0:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-26  0:04 Aric Belsito [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-20 23:24 [gentoo-commits] proj/musl:master commit in: eclass/ Sam James
2021-11-17 11:48 Sam James
2021-11-17 11:47 Sam James
2019-08-28 21:29 Jory Pratt
2019-05-20 21:04 Jory Pratt
2019-05-05 16:49 Jory Pratt
2019-04-11 12:55 Anthony G. Basile
2019-02-24 17:14 Anthony G. Basile
2019-01-05  0:44 Anthony G. Basile
2018-05-17 18:15 Aric Belsito
2018-05-03 18:31 Aric Belsito
2018-04-14 17:41 Aric Belsito
2018-01-25 19:48 Aric Belsito
2018-01-06 22:38 Aric Belsito
2017-12-12 20:58 Anthony G. Basile
2017-11-29 20:00 Aric Belsito
2017-09-05 19:13 Aric Belsito
2017-05-06 21:30 Aric Belsito
2016-05-03  8:51 Anthony G. Basile
2016-05-03  8:32 Anthony G. Basile
2015-10-02 21:30 Anthony G. Basile
2015-08-30 15:32 Anthony G. Basile
2015-06-12 20:09 Anthony G. Basile

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1482710611.d245318d8912a6fef051fe1bdfbee626af72a742.lluixhi@gentoo \
    --to=lluixhi@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox