diff options
author | 2015-06-12 16:11:21 -0400 | |
---|---|---|
committer | 2015-06-12 16:11:21 -0400 | |
commit | aee379fa9eb0bcee1126dff5568b16e8d119835d (patch) | |
tree | 49b6466ed69bcc5dc5ed359c3841f6ea2a734a76 | |
parent | dev-util/strace: in tree version 4.9 works. (diff) | |
download | musl-aee379fa.tar.gz musl-aee379fa.tar.bz2 musl-aee379fa.zip |
eclass/toolchain.eclass: follow tree version.
-rw-r--r-- | eclass/toolchain.eclass | 153 |
1 files changed, 78 insertions, 75 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index f6e451a7..f4e651c5 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.635 2014/08/05 01:41:01 floppym Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.675 2015/06/01 16:05:43 vapier Exp $ # Maintainer: Toolchain Ninjas <toolchain@gentoo.org> @@ -26,7 +26,7 @@ FEATURES=${FEATURES/multilib-strict/} EXPORTED_FUNCTIONS="pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm" case ${EAPI:-0} in - 0|1) ;; + 0|1) die "Need to upgrade to at least EAPI=2";; 2|3) EXPORTED_FUNCTIONS+=" src_prepare src_configure" ;; 4*|5*) EXPORTED_FUNCTIONS+=" pkg_pretend src_prepare src_configure" ;; *) die "I don't speak EAPI ${EAPI}." @@ -37,8 +37,8 @@ EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} export CTARGET=${CTARGET:-${CHOST}} if [[ ${CTARGET} = ${CHOST} ]] ; then - if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then - export CTARGET=${CATEGORY/cross-} + if [[ ${CATEGORY} == cross-* ]] ; then + export CTARGET=${CATEGORY#cross-} fi fi : ${TARGET_ABI:=${ABI}} @@ -86,9 +86,9 @@ elif [[ ${GCC_PV} == *_rc* ]] ; then SNAPSHOT=${GCC_PV%_rc*}-RC-${GCC_PV##*_rc} fi -if [[ ${SNAPSHOT} == 5.0-* ]] ; then - # The gcc-5 release has dropped the .0 for some reason. - SNAPSHOT=${SNAPSHOT/5.0/5} +if [[ ${SNAPSHOT} == [56789].0-* ]] ; then + # The gcc-5+ releases have dropped the .0 for some reason. + SNAPSHOT=${SNAPSHOT/.0} fi export GCC_FILESDIR=${GCC_FILESDIR:-${FILESDIR}} @@ -134,7 +134,7 @@ IUSE="multislot regression-test vanilla" IUSE_DEF=( nls nptl ) if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then - IUSE+=" altivec" + IUSE+=" altivec debug" IUSE_DEF+=( cxx fortran ) [[ -n ${PIE_VER} ]] && IUSE+=" nopie" [[ -n ${HTB_VER} ]] && IUSE+=" boundschecking" @@ -146,16 +146,19 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then tc_version_is_at_least 4.1 && IUSE+=" libssp objc++" tc_version_is_at_least 4.2 && IUSE_DEF+=( openmp ) tc_version_is_at_least 4.3 && IUSE+=" fixed-point" - tc_version_is_at_least 4.6 && IUSE+=" graphite" tc_version_is_at_least 4.7 && IUSE+=" go" - tc_version_is_at_least 4.8 && IUSE_DEF+=( sanitize ) + # Note: while <=gcc-4.7 also supported graphite, it required forked ppl + # 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 6.0 && IUSE+=" pie" fi -[[ ${EAPI:-0} != 0 ]] && IUSE_DEF=( "${IUSE_DEF[@]/#/+}" ) -IUSE+=" ${IUSE_DEF[*]}" +IUSE+=" ${IUSE_DEF[*]/#/+}" # Support upgrade paths here or people get pissed -if ! tc_version_is_at_least 4.7 || use multislot ; then +if ! tc_version_is_at_least 4.7 || is_crosscompile || use multislot || [[ ${GCC_PV} == *_alpha* ]] ; then SLOT="${GCC_CONFIG_VER}" else SLOT="${GCC_BRANCH_VER}" @@ -180,18 +183,14 @@ fi tc_version_is_at_least 4.5 && RDEPEND+=" >=dev-libs/mpc-0.8.1" if in_iuse graphite ; then - if tc_version_is_at_least 4.8 ; then + if tc_version_is_at_least 5.0 ; then + RDEPEND+=" graphite? ( >=dev-libs/isl-0.14 )" + elif tc_version_is_at_least 4.8 ; then RDEPEND+=" graphite? ( >=dev-libs/cloog-0.18.0 >=dev-libs/isl-0.11.1 )" - else - RDEPEND+=" - graphite? ( - >=dev-libs/cloog-ppl-0.15.10 - >=dev-libs/ppl-0.11 - )" fi fi @@ -242,7 +241,7 @@ S=$( gentoo_urls() { local devspace="HTTP~vapier/dist/URI HTTP~rhill/dist/URI - HTTP~halcy0n/patches/URI HTTP~zorry/patches/gcc/URI" + HTTP~zorry/patches/gcc/URI HTTP~blueness/dist/URI" devspace=${devspace//HTTP/http:\/\/dev.gentoo.org\/} echo mirror://gentoo/$1 ${devspace//URI/$1} } @@ -392,8 +391,8 @@ toolchain_pkg_pretend() { #---->> pkg_setup <<---- toolchain_pkg_setup() { - case "${EAPI:-0}" in - 0|1|2|3) toolchain_pkg_pretend ;; + case ${EAPI} in + 2|3) toolchain_pkg_pretend ;; esac # we dont want to use the installed compiler's specs to build gcc @@ -409,10 +408,6 @@ toolchain_src_unpack() { else gcc_quick_unpack fi - - case ${EAPI:-0} in - 0|1) toolchain_src_prepare ;; - esac } gcc_quick_unpack() { @@ -886,10 +881,8 @@ toolchain_src_configure() { # Use the default ("release") checking because upstream usually neglects # to test "disabled" so it has a history of breaking. #317217 - if tc_version_is_at_least 4 || [[ -n ${GCC_CHECKS_LIST} ]] ; then - confgcc+=( --enable-checking=${GCC_CHECKS_LIST:-release} ) - else - confgcc+=( --disable-checking ) + if tc_version_is_at_least 3.4 ; then + confgcc+=( --enable-checking="${GCC_CHECKS_LIST:-$(usex debug yes release)}" ) fi # Branding @@ -1040,9 +1033,9 @@ toolchain_src_configure() { *) # If they've explicitly opt-ed in, do hardfloat, # otherwise let the gcc default kick in. - [[ ${CTARGET//_/-} == *-hardfloat-* ]] \ - && confgcc+=( --with-float=hard ) - ;; + case ${CTARGET//_/-} in + *-hardfloat-*|*eabihf) confgcc+=( --with-float=hard ) ;; + esac esac local with_abi_map=() @@ -1088,7 +1081,7 @@ toolchain_src_configure() { amd64) # drop the older/ABI checks once this get's merged into some # version of gcc upstream - if tc_version_is_at_least 4.7 && has x32 $(get_all_abis TARGET) ; then + if tc_version_is_at_least 4.8 && has x32 $(get_all_abis TARGET) ; then confgcc+=( --with-abi=$(gcc-abi-map ${TARGET_DEFAULT_ABI}) ) fi ;; @@ -1167,7 +1160,10 @@ toolchain_src_configure() { fi confgcc+=( --disable-libssp ) fi + fi + if in_iuse cilk ; then + confgcc+=( $(use_enable cilk libcilkrts) ) fi # newer gcc's come with libquadmath, but only fortran uses @@ -1182,27 +1178,26 @@ toolchain_src_configure() { confgcc+=( --disable-lto ) fi - # graphite was added in 4.4 but we only support it in 4.6+ due to external - # library issues. 4.6/4.7 uses cloog-ppl which is a fork of CLooG with a - # PPL backend. 4.8+ uses upstream CLooG with the ISL backend. We install - # cloog-ppl into a non-standard location to prevent collisions. - if tc_version_is_at_least 4.8 ; then - confgcc+=( $(use_with graphite cloog) ) + # graphite was added in 4.4 but we only support it in 4.8+ due to external + # library issues. #448024 + if tc_version_is_at_least 5.0 ; then + confgcc+=( $(use_with graphite isl) ) use graphite && confgcc+=( --disable-isl-version-check ) - elif tc_version_is_at_least 4.6 ; then + elif tc_version_is_at_least 4.8 ; then confgcc+=( $(use_with graphite cloog) ) - confgcc+=( $(use_with graphite ppl) ) - use graphite && confgcc+=( --with-cloog-include=/usr/include/cloog-ppl ) - use graphite && confgcc+=( --disable-ppl-version-check ) + use graphite && confgcc+=( --disable-isl-version-check ) elif tc_version_is_at_least 4.4 ; then - confgcc+=( --without-cloog ) - confgcc+=( --without-ppl ) + confgcc+=( --without-{cloog,ppl} ) fi if tc_version_is_at_least 4.8 ; then confgcc+=( $(use_enable sanitize libsanitizer) ) fi + if tc_version_is_at_least 6.0 ; then + confgcc+=( $(use_enable pie default-pie) ) + fi + # Disable gcc info regeneration -- it ships with generated info pages # already. Our custom version/urls/etc... trigger it. #464008 export gcc_cv_prog_makeinfo_modern=no @@ -1235,7 +1230,10 @@ toolchain_src_configure() { # and now to do the actual configuration addwrite /dev/zero echo "${S}"/configure "${confgcc[@]}" - "${S}"/configure "${confgcc[@]}" || die "failed to run configure" + # Older gcc versions did not detect bash and re-exec itself, so force the + # use of bash. Newer ones will auto-detect, but this is not harmeful. + CONFIG_SHELL="/bin/bash" \ + bash "${S}"/configure "${confgcc[@]}" || die "failed to run configure" # return to whatever directory we were in before popd > /dev/null @@ -1474,7 +1472,7 @@ gcc-multilib-configure() { if [[ -n ${list} ]] ; then case ${CTARGET} in x86_64*) - tc_version_is_at_least 4.7 && confgcc+=( --with-multilib-list=${list:1} ) + tc_version_is_at_least 4.8 && confgcc+=( --with-multilib-list=${list:1} ) ;; esac fi @@ -1498,10 +1496,6 @@ gcc-abi-map() { #----> src_compile <---- toolchain_src_compile() { - case ${EAPI:-0} in - 0|1) toolchain_src_configure ;; - esac - touch "${S}"/gcc/c-gperf.h # Do not make manpages if we do not have perl ... @@ -1576,6 +1570,13 @@ gcc_do_make() { cd "${CTARGET}"/libstdc++-v3 emake doxygen-man || ewarn "failed to make docs" fi + # Clean bogus manpages. #113902 + find -name '*_build_*' -delete + # Blow away generated directory references. Newer versions of gcc + # have gotten better at this, but not perfect. This is easier than + # backporting all of the various doxygen patches. #486754 + find -name '*_.3' -exec grep -l ' Directory Reference ' {} + | \ + xargs rm -f else ewarn "Skipping libstdc++ manpage generation since you don't have doxygen installed" fi @@ -1611,8 +1612,12 @@ toolchain_src_install() { fi done - # Remove generated headers, as they can cause things to break - # (ncurses, openssl, etc). + # We remove the generated fixincludes, as they can cause things to break + # (ncurses, openssl, etc). We do not prevent them from being built, as + # in the following commit which we revert: + # http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?r1=1.647&r2=1.648 + # This is because bsd userland needs fixedincludes to build gcc, while + # linux does not. Both can dispose of them afterwards. while read x ; do grep -q 'It has been auto-edited by fixincludes from' "${x}" \ && rm -f "${x}" @@ -1687,8 +1692,6 @@ toolchain_src_install() { if tc_version_is_at_least 3.0 ; then local cxx_mandir=$(find "${WORKDIR}/build/${CTARGET}/libstdc++-v3" -name man) if [[ -d ${cxx_mandir} ]] ; then - # clean bogus manpages #113902 - find "${cxx_mandir}" -name '*_build_*' -exec rm {} \; cp -r "${cxx_mandir}"/man? "${D}/${DATAPATH}"/man/ fi fi @@ -1714,13 +1717,9 @@ toolchain_src_install() { # between binary and source package borks things .... if ! is_crosscompile ; then insinto "${DATAPATH}" - if tc_version_is_at_least 4.0 ; then - newins "${GCC_FILESDIR}"/awk/fixlafiles.awk-no_gcc_la fixlafiles.awk || die - find "${D}/${LIBPATH}" -name libstdc++.la -type f -exec rm "{}" \; - find "${D}/${LIBPATH}" -name "lib?san.la" -type f -exec rm "{}" \; # 487550 - else - doins "${GCC_FILESDIR}"/awk/fixlafiles.awk || die - fi + 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 @@ -1784,7 +1783,7 @@ gcc_movelibs() { if [[ ${FROMDIR} != "${TODIR}" && -d ${FROMDIR} ]] ; then local files=$(find "${FROMDIR}" -maxdepth 1 ! -type d 2>/dev/null) if [[ -n ${files} ]] ; then - mv ${files} "${TODIR}" + mv ${files} "${TODIR}" || die fi fi done @@ -1794,7 +1793,7 @@ gcc_movelibs() { FROMDIR="${PREFIX}/lib/${OS_MULTIDIR}" for x in "${D}${FROMDIR}"/pkgconfig/libgcj*.pc ; do [[ -f ${x} ]] || continue - sed -i "/^libdir=/s:=.*:=${LIBPATH}/${MULTIDIR}:" "${x}" + sed -i "/^libdir=/s:=.*:=${LIBPATH}/${MULTIDIR}:" "${x}" || die mv "${x}" "${D}${FROMDIR}"/pkgconfig/libgcj-${GCC_PV}.pc || die done done @@ -1813,21 +1812,25 @@ gcc_movelibs() { # -are-, and not where they -used- to be. also, any dependencies we have # on our own .la files need to be updated. fix_libtool_libdir_paths() { + local libpath="$1" + pushd "${D}" >/dev/null - pushd "./${1}" >/dev/null + pushd "./${libpath}" >/dev/null local dir="${PWD#${D%/}}" local allarchives=$(echo *.la) allarchives="\(${allarchives// /\\|}\)" popd >/dev/null - sed -i \ - -e "/^libdir=/s:=.*:='${dir}':" \ - ./${dir}/*.la - sed -i \ - -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${LIBPATH}/\1:g" \ - $(find ./${PREFIX}/lib* -maxdepth 3 -name '*.la') \ - ./${dir}/*.la + # The libdir might not have any .la files. #548782 + find "./${dir}" -maxdepth 1 -name '*.la' \ + -exec sed -i -e "/^libdir=/s:=.*:='${dir}':" {} + || die + # Would be nice to combine these, but -maxdepth can not be specified + # on sub-expressions. + find "./${PREFIX}"/lib* -maxdepth 3 -name '*.la' \ + -exec sed -i -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${libpath}/\1:g" {} + || die + find "./${dir}/" -maxdepth 1 -name '*.la' \ + -exec sed -i -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${libpath}/\1:g" {} + || die popd >/dev/null } |