summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2021-11-20 23:15:43 +0100
committerAndreas K. Hüttel <dilfridge@gentoo.org>2021-11-21 00:15:24 +0100
commit39ae8d6b8204cbf27dbf98a41f9f045317ec771c (patch)
tree348c3f91234c13ccfe4b50d325eacd649d91dcf5 /eclass/toolchain.eclass
parentnet-im/discord-bin: re-add libXScrnSaver dependency (diff)
downloadgentoo-39ae8d6b8204cbf27dbf98a41f9f045317ec771c.tar.gz
gentoo-39ae8d6b8204cbf27dbf98a41f9f045317ec771c.tar.bz2
gentoo-39ae8d6b8204cbf27dbf98a41f9f045317ec771c.zip
sys-devel/gcc: import musl mechanisms prepared by sam_ from ::musl overlay
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Diffstat (limited to 'eclass/toolchain.eclass')
-rw-r--r--eclass/toolchain.eclass18
1 files changed, 17 insertions, 1 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 5a272a209361..627531f2765a 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -291,7 +291,8 @@ 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~sam/distfiles/URI HTTP~slyfox/distfiles/URI"
+ HTTP~tamiko/distfiles/URI HTTP~sam/distfiles/URI
+ HTTP~sam/distfiles/sys-devel/gcc/URI HTTP~slyfox/distfiles/URI"
devspace=${devspace//HTTP/https:\/\/dev.gentoo.org\/}
echo mirror://gentoo/$1 ${devspace//URI/$1}
}
@@ -354,6 +355,7 @@ gentoo_urls() {
get_gcc_src_uri() {
export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}}
export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}}
+ export MUSL_GCC_VER=${MUSL_GCC_VER:-${PATCH_GCC_VER}}
export PIE_GCC_VER=${PIE_GCC_VER:-${GCC_RELEASE_VER}}
export HTB_GCC_VER=${HTB_GCC_VER:-${GCC_RELEASE_VER}}
export SPECS_GCC_VER=${SPECS_GCC_VER:-${GCC_RELEASE_VER}}
@@ -379,6 +381,8 @@ get_gcc_src_uri() {
GCC_SRC_URI+=" $(gentoo_urls gcc-${UCLIBC_GCC_VER}-uclibc-patches-${UCLIBC_VER}.tar.bz2)"
[[ -n ${PATCH_VER} ]] && \
GCC_SRC_URI+=" $(gentoo_urls gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.bz2)"
+ [[ -n ${MUSL_VER} ]] && \
+ GCC_SRC_URI+=" $(gentoo_urls gcc-${MUSL_GCC_VER}-musl-patches-${MUSL_VER}.tar.bz2)"
[[ -n ${PIE_VER} ]] && \
PIE_CORE=${PIE_CORE:-gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.bz2} && \
@@ -547,9 +551,21 @@ do_gcc_gentoo_patches() {
tc_apply_patches "Applying Gentoo patches ..." "${WORKDIR}"/patch/*.patch
BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION} p${PATCH_VER}"
fi
+
if [[ -n ${UCLIBC_VER} ]] ; then
tc_apply_patches "Applying uClibc patches ..." "${WORKDIR}"/uclibc/*.patch
fi
+
+ if [[ -n ${MUSL_VER} ]] && [[ ${CTARGET} == *musl* ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ # We don't want to apply some patches when cross-compiling.
+ if [[ -d "${WORKDIR}"/musl/nocross ]] ; then
+ rm -fv "${WORKDIR}"/musl/nocross/*.patch || die
+ fi
+ fi
+
+ tc_apply_patches "Applying musl patches ..." "${WORKDIR}"/musl/{,nocross/}*.patch
+ fi
fi
}