aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2017-12-12 15:56:47 -0500
committerAnthony G. Basile <blueness@gentoo.org>2017-12-12 15:57:20 -0500
commitdf8d9caa171abe98f105241aaf1e3351d118a319 (patch)
tree12905d8c46195358e2b3a0aa2910658b99d5810d
parentmedia-libs/mesa: fix patch (diff)
downloadmusl-df8d9caa.tar.gz
musl-df8d9caa.tar.bz2
musl-df8d9caa.zip
toolchain.eclass: bring into line with in tree versions
-rw-r--r--eclass/toolchain.eclass39
1 files changed, 24 insertions, 15 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index a07863c6..e3011d6a 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -90,8 +90,6 @@ if [[ ${SNAPSHOT} == [56789].0-* ]] ; then
SNAPSHOT=${SNAPSHOT/.0}
fi
-export GCC_FILESDIR=${GCC_FILESDIR:-${FILESDIR}}
-
PREFIX=${TOOLCHAIN_PREFIX:-${EPREFIX}/usr}
if tc_version_is_at_least 3.4.0 ; then
@@ -141,6 +139,7 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
[[ -n ${D_VER} ]] && IUSE+=" d"
[[ -n ${SPECS_VER} ]] && IUSE+=" nossp"
tc_version_is_at_least 3 && IUSE+=" doc gcj awt hardened multilib objc"
+ tc_version_is_at_least 3.3 && IUSE+=" pgo"
tc_version_is_at_least 4.0 && IUSE+=" objc-gc"
tc_version_is_between 4.0 4.9 && IUSE+=" mudflap"
tc_version_is_at_least 4.1 && IUSE+=" libssp objc++"
@@ -240,7 +239,7 @@ S=$(
gentoo_urls() {
local devspace="HTTP~vapier/dist/URI HTTP~rhill/dist/URI
HTTP~zorry/patches/gcc/URI HTTP~blueness/dist/URI
- HTTP~tamiko/distfiles/URI"
+ HTTP~tamiko/distfiles/URI HTTP~slyfox/distfiles/URI"
devspace=${devspace//HTTP/https:\/\/dev.gentoo.org\/}
echo mirror://gentoo/$1 ${devspace//URI/$1}
}
@@ -379,9 +378,6 @@ toolchain_pkg_pretend() {
"in your make.conf if you want to use this version."
fi
- [[ -z ${UCLIBC_VER} ]] && [[ ${CTARGET} == *-uclibc* ]] && \
- die "Sorry, this version does not support uClibc"
-
if ! use_if_iuse cxx ; then
use_if_iuse go && ewarn 'Go requires a C++ compiler, disabled due to USE="-cxx"'
use_if_iuse objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="-cxx"'
@@ -581,14 +577,14 @@ toolchain_src_prepare() {
einfo "Fixing misc issues in configure files"
for f in $(grep -l 'autoconf version 2.13' $(find "${S}" -name configure)) ; do
ebegin " Updating ${f/${S}\/} [LANG]"
- patch "${f}" "${GCC_FILESDIR}"/gcc-configure-LANG.patch >& "${T}"/configure-patch.log \
+ patch "${f}" "${FILESDIR}"/gcc-configure-LANG.patch >& "${T}"/configure-patch.log \
|| eerror "Please file a bug about this"
eend $?
done
sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk #215828
# Prevent new texinfo from breaking old versions (see #198182, #464008)
- tc_version_is_at_least 4.1 && epatch "${GCC_FILESDIR}"/gcc-configure-texinfo.patch
+ tc_version_is_at_least 4.1 && epatch "${FILESDIR}"/gcc-configure-texinfo.patch
if [[ -x contrib/gcc_update ]] ; then
einfo "Touching generated files"
@@ -642,7 +638,15 @@ do_gcc_PIE_patches() {
make_gcc_hard() {
local gcc_hard_flags=""
- # Gcc >= 6.X we can use configuration options to turn pie/ssp on as default
+
+ # If we use gcc-6 or newer with pie enable to compile older gcc we need to pass -no-pie
+ # to stage1; bug 618908
+ if ! tc_version_is_at_least 6.0 && [[ $(gcc-major-version) -ge 6 ]] ; then
+ einfo "Disabling PIE in stage1 (only) ..."
+ sed -i -e "/^STAGE1_LDFLAGS/ s/$/ -no-pie/" "${S}"/Makefile.in || die
+ fi
+
+ # Gcc >= 6.X we can use configurations options to turn pie/ssp on as default
if tc_version_is_at_least 6.0 ; then
if use pie ; then
einfo "Updating gcc to use automatic PIE building ..."
@@ -651,7 +655,7 @@ make_gcc_hard() {
einfo "Updating gcc to use automatic SSP building ..."
fi
if use hardened ; then
- # Will add some optimizations by default.
+ # Will add some optimatizion as default.
gcc_hard_flags+=" -DEXTRA_OPTIONS"
# rebrand to make bug reports easier
BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened}
@@ -1481,7 +1485,8 @@ gcc_do_filter_flags() {
FFLAGS=${CFLAGS}
FCFLAGS=${CFLAGS}
- local VAR="CFLAGS_"${CTARGET//-/_}
+ # "hppa2.0-unknown-linux-gnu" -> hppa2_0_unknown_linux_gnu
+ local VAR="CFLAGS_"${CTARGET//[-.]/_}
CXXFLAGS=${!VAR}
fi
@@ -1573,7 +1578,11 @@ gcc_do_make() {
# resulting binaries natively ^^;
GCC_MAKE_TARGET=${GCC_MAKE_TARGET-all}
else
- GCC_MAKE_TARGET=${GCC_MAKE_TARGET-bootstrap-lean}
+ if tc_version_is_at_least 3.3 && use pgo; then
+ GCC_MAKE_TARGET=${GCC_MAKE_TARGET-profiledbootstrap}
+ else
+ GCC_MAKE_TARGET=${GCC_MAKE_TARGET-bootstrap-lean}
+ fi
fi
# Older versions of GCC could not do profiledbootstrap in parallel due to
@@ -1782,10 +1791,10 @@ toolchain_src_install() {
# between binary and source package borks things ....
if ! is_crosscompile ; then
insinto "${DATAPATH#${EPREFIX}}"
- newins "$(prefixify_ro "${GCC_FILESDIR}"/awk/fixlafiles.awk-no_gcc_la)" fixlafiles.awk || die
+ newins "$(prefixify_ro "${FILESDIR}"/awk/fixlafiles.awk-no_gcc_la)" fixlafiles.awk || die
exeinto "${DATAPATH#${EPREFIX}}"
- doexe "$(prefixify_ro "${GCC_FILESDIR}"/fix_libtool_files.sh)" || die
- doexe "${GCC_FILESDIR}"/c{89,99} || die
+ doexe "$(prefixify_ro "${FILESDIR}"/fix_libtool_files.sh)" || die
+ doexe "${FILESDIR}"/c{89,99} || die
fi
# libstdc++.la: Delete as it doesn't add anything useful: g++ itself