| 6 |
6 |
# Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc
|
| 7 |
7 |
# Please read & adapt the page as necessary if obsolete.
|
| 8 |
8 |
|
| 9 |
|
PYTHON_COMPAT=( python3_{11..14} )
|
|
9 |
PYTHON_COMPAT=( python3_{10..14} )
|
| 10 |
10 |
TMPFILES_OPTIONAL=1
|
| 11 |
11 |
|
| 12 |
12 |
EMULTILIB_PKG="true"
|
| 13 |
13 |
|
| 14 |
14 |
# Gentoo patchset (ignored for live ebuilds)
|
| 15 |
|
PATCH_VER=7
|
|
15 |
PATCH_VER=1
|
| 16 |
16 |
PATCH_DEV=dilfridge
|
| 17 |
17 |
|
| 18 |
18 |
# gcc mulitilib bootstrap files version
|
| ... | ... | |
| 43 |
43 |
if [[ ${PV} == *9999 ]]; then
|
| 44 |
44 |
inherit git-r3
|
| 45 |
45 |
else
|
| 46 |
|
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86"
|
|
46 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
| 47 |
47 |
SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
|
| 48 |
48 |
SRC_URI+=" verify-sig? ( mirror://gnu/glibc/${P}.tar.xz.sig )"
|
| 49 |
49 |
SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
|
| ... | ... | |
| 54 |
54 |
|
| 55 |
55 |
LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
|
| 56 |
56 |
SLOT="2.2"
|
| 57 |
|
IUSE="audit caps cet compile-locales custom-cflags doc gd hash-sysv-compat headers-only +multiarch multilib multilib-bootstrap nscd perl profile selinux sframe +ssp stack-realign +static-libs suid systemd systemtap test vanilla"
|
|
57 |
IUSE="audit caps cet clang compile-locales custom-cflags doc gd hash-sysv-compat headers-only +multiarch multilib multilib-bootstrap nscd perl profile selinux sframe +ssp stack-realign +static-libs suid systemd systemtap test vanilla"
|
| 58 |
58 |
|
| 59 |
59 |
# Here's how the cross-compile logic breaks down ...
|
| 60 |
60 |
# CTARGET - machine that will target the binaries
|
| ... | ... | |
| 151 |
151 |
>=${CATEGORY}/binutils-2.27
|
| 152 |
152 |
>=${CATEGORY}/gcc-6.2
|
| 153 |
153 |
)"
|
| 154 |
|
[[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
|
|
154 |
|
|
155 |
case ${CATEGORY} in
|
|
156 |
*-linux*)
|
|
157 |
DEPEND+=" ${CATEGORY}/linux-headers"
|
|
158 |
;;
|
|
159 |
*-gnu)
|
|
160 |
DEPEND+=" ${CATEGORY}/gnumach[-headers-only]"
|
|
161 |
;;
|
|
162 |
esac
|
| 155 |
163 |
else
|
| 156 |
164 |
BDEPEND+="
|
| 157 |
165 |
>=sys-devel/binutils-2.27
|
| 158 |
|
>=sys-devel/gcc-6.2
|
|
166 |
clang? ( || ( ( >=sys-devel/gcc-6.2 )
|
|
167 |
( >=sys-devel/gcc-6.2 >=llvm-core/clang-18 )
|
|
168 |
( >=llvm-core/clang-18 >=llvm-runtimes/libgcc-18 ) ) )
|
|
169 |
!clang? ( >=sys-devel/gcc-6.2 )
|
| 159 |
170 |
"
|
| 160 |
171 |
DEPEND+=" virtual/os-headers "
|
| 161 |
172 |
RDEPEND+="
|
| ... | ... | |
| 479 |
490 |
append-ldflags '-Wl,--hash-style=both'
|
| 480 |
491 |
fi
|
| 481 |
492 |
|
|
493 |
# clang warns about linker flags unused during compilation, but we don't
|
|
494 |
# want that to turn into errors!
|
|
495 |
# Let's turn the warning off entirely since it spams.
|
|
496 |
append-flags -Wno-unused-command-line-argument
|
|
497 |
|
| 482 |
498 |
# #492892
|
| 483 |
499 |
filter-flags -frecord-gcc-switches
|
| 484 |
500 |
|
| ... | ... | |
| 491 |
507 |
# #829583
|
| 492 |
508 |
filter-lfs-flags
|
| 493 |
509 |
|
|
510 |
case ${CTARGET} in
|
|
511 |
*-linux*)
|
|
512 |
;;
|
|
513 |
*-gnu)
|
|
514 |
# -g3 confuses MIG which relies on preprocessed input
|
|
515 |
replace-flags -ggdb[3-9] -ggdb2
|
|
516 |
replace-flags -g3 -g
|
|
517 |
;;
|
|
518 |
esac
|
|
519 |
|
| 494 |
520 |
unset CBUILD_OPT CTARGET_OPT
|
| 495 |
521 |
if use multilib ; then
|
| 496 |
522 |
CTARGET_OPT=$(get_abi_CTARGET)
|
| ... | ... | |
| 610 |
636 |
export glibc__ORIG_CXX=${CXX}
|
| 611 |
637 |
export glibc__ORIG_CPP=${CPP}
|
| 612 |
638 |
|
| 613 |
|
if tc-is-clang && ! use custom-cflags && ! is_crosscompile ; then
|
|
639 |
if tc-is-clang && ! ( use clang || use custom-cflags ) && ! is_crosscompile ; then
|
| 614 |
640 |
export glibc__force_gcc=yes
|
| 615 |
641 |
# once this is toggled on, it needs to stay on, since with CPP manipulated
|
| 616 |
642 |
# tc-is-clang does not work correctly anymore...
|
| ... | ... | |
| 621 |
647 |
# recover the proper gcc and binutils settings here, at least until glibc
|
| 622 |
648 |
# is finally building with clang. So let's override everything that is
|
| 623 |
649 |
# set in the clang profiles.
|
| 624 |
|
# Want to shoot yourself into the foot? Set USE=custom-cflags, that's always
|
| 625 |
|
# a good start into that direction.
|
| 626 |
|
# Also, if you're crosscompiling, let's assume you know what you are doing.
|
|
650 |
# Want to shoot yourself into the foot? Set USE="clang" or USE="custom-cflags".
|
|
651 |
# Also, if you are crosscompiling, let's assume you know what you are doing.
|
| 627 |
652 |
# Hopefully.
|
| 628 |
653 |
# Last, we need the settings of the *build* environment, not of the
|
| 629 |
654 |
# target environment...
|
| ... | ... | |
| 652 |
677 |
filter-flags '-D_FORTIFY_SOURCE=*'
|
| 653 |
678 |
|
| 654 |
679 |
else
|
| 655 |
|
|
| 656 |
680 |
# this is the "normal" case
|
| 657 |
681 |
|
| 658 |
|
export CC="$(tc-getCC ${CTARGET})"
|
| 659 |
|
export CXX="$(tc-getCXX ${CTARGET})"
|
| 660 |
|
export CPP="$(tc-getCPP ${CTARGET})"
|
| 661 |
|
|
| 662 |
682 |
# Always use tuple-prefixed toolchain. For non-native ABI glibc's configure
|
| 663 |
683 |
# can't detect them automatically due to ${CHOST} mismatch and fallbacks
|
| 664 |
684 |
# to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup().
|
|
685 |
export CC="$(tc-getCC ${CTARGET})"
|
|
686 |
export CXX="$(tc-getCXX ${CTARGET})"
|
|
687 |
export CPP="$(tc-getCPP ${CTARGET})"
|
| 665 |
688 |
export NM="$(tc-getNM ${CTARGET})"
|
| 666 |
689 |
export READELF="$(tc-getREADELF ${CTARGET})"
|
| 667 |
690 |
|
| 668 |
691 |
fi
|
| 669 |
692 |
|
| 670 |
|
# We need to export CFLAGS with abi information in them because glibc's
|
| 671 |
|
# configure script checks CFLAGS for some targets (like mips). Keep
|
| 672 |
|
# around the original clean value to avoid appending multiple ABIs on
|
| 673 |
|
# top of each other. (Why does the comment talk about CFLAGS if the code
|
| 674 |
|
# acts on CC?)
|
|
693 |
# We need to move CFLAGS with abi information into CC etc per glibc upstream
|
|
694 |
# requirement. Keep around the original clean value to avoid appending
|
|
695 |
# multiple ABIs on top of each other.
|
| 675 |
696 |
export glibc__GLIBC_CC=${CC}
|
| 676 |
697 |
export glibc__GLIBC_CXX=${CXX}
|
| 677 |
698 |
export glibc__GLIBC_CPP=${CPP}
|
| ... | ... | |
| 989 |
1010 |
einfo "Applying Gentoo Glibc patchset ${patchsetname}"
|
| 990 |
1011 |
eapply "${WORKDIR}"/patches
|
| 991 |
1012 |
einfo "Done."
|
|
1013 |
|
|
1014 |
# TODO: Put into our patchset
|
|
1015 |
eapply "${FILESDIR}"/glibc-2.43-hurd-link-helpers.patch
|
| 992 |
1016 |
fi
|
| 993 |
1017 |
|
| 994 |
1018 |
case ${CTARGET} in
|
| ... | ... | |
| 1094 |
1118 |
--with-bugurl=https://bugs.gentoo.org/
|
| 1095 |
1119 |
--with-pkgversion="$(glibc_banner)"
|
| 1096 |
1120 |
$(use_multiarch || echo --disable-multi-arch)
|
| 1097 |
|
$(use_enable systemtap)
|
| 1098 |
1121 |
$(use_enable nscd)
|
| 1099 |
1122 |
|
| 1100 |
1123 |
# /usr/bin/mtrace has a Perl shebang. Gentoo Prefix QA checks fail if
|
| ... | ... | |
| 1120 |
1143 |
# We rely on sys-libs/timezone-data for timezone tools normally.
|
| 1121 |
1144 |
myconf+=( $(use_enable vanilla timezone-tools) )
|
| 1122 |
1145 |
|
|
1146 |
if is_crosscompile ; then
|
|
1147 |
myconf+=( --disable-systemtap )
|
|
1148 |
else
|
|
1149 |
myconf+=( $(use_enable systemtap) )
|
|
1150 |
fi
|
|
1151 |
|
| 1123 |
1152 |
# These libs don't have configure flags.
|
| 1124 |
1153 |
ac_cv_lib_audit_audit_log_user_avc_message=$(usex audit || echo no)
|
| 1125 |
1154 |
ac_cv_lib_cap_cap_init=$(usex caps || echo no)
|