| 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_{10..14} )
|
|
9 |
PYTHON_COMPAT=( python3_{11..14} )
|
| 10 |
10 |
TMPFILES_OPTIONAL=1
|
| 11 |
11 |
|
| 12 |
12 |
EMULTILIB_PKG="true"
|
| 13 |
13 |
|
| 14 |
14 |
# Gentoo patchset (ignored for live ebuilds)
|
| 15 |
15 |
PATCH_VER=1
|
| 16 |
|
PATCH_DEV=dilfridge
|
| 17 |
16 |
|
| 18 |
17 |
# gcc mulitilib bootstrap files version
|
| 19 |
18 |
GCC_BOOTSTRAP_VER=20201208
|
| ... | ... | |
| 21 |
20 |
# systemd integration version
|
| 22 |
21 |
GLIBC_SYSTEMD_VER=20210729
|
| 23 |
22 |
|
| 24 |
|
# Minimum kernel version that glibc requires
|
| 25 |
|
MIN_KERN_VER="3.2.0"
|
|
23 |
# Minimum kernel version that glibc requires (used with USE=old-kernel)
|
|
24 |
MIN_KERN_VER_UPSTREAM="3.2.0"
|
|
25 |
|
|
26 |
# Minimum kernel version that Gentoo recommends (oldest in the tree)
|
|
27 |
MIN_KERN_VER_GENTOO="6.1.0"
|
| 26 |
28 |
|
| 27 |
29 |
# Minimum pax-utils version needed (which contains any new syscall changes for
|
| 28 |
30 |
# its seccomp filter!). Please double check this!
|
| ... | ... | |
| 43 |
45 |
if [[ ${PV} == *9999 ]]; then
|
| 44 |
46 |
inherit git-r3
|
| 45 |
47 |
else
|
| 46 |
|
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
|
48 |
#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
| 47 |
49 |
SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
|
|
50 |
SRC_URI+=" https://distfiles.gentoo.org/pub/proj/toolchain/glibc/patches/${P}-patches-${PATCH_VER}.tar.xz"
|
| 48 |
51 |
SRC_URI+=" verify-sig? ( mirror://gnu/glibc/${P}.tar.xz.sig )"
|
| 49 |
|
SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
|
| 50 |
52 |
fi
|
| 51 |
53 |
|
| 52 |
54 |
SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )"
|
| ... | ... | |
| 54 |
56 |
|
| 55 |
57 |
LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
|
| 56 |
58 |
SLOT="2.2"
|
| 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"
|
|
59 |
IUSE="audit caps cet clang compile-locales custom-cflags doc gd hash-sysv-compat headers-only +multiarch multilib multilib-bootstrap nscd old-kernel perl profile selinux sframe +ssp stack-realign +static-libs suid systemd systemtap test vanilla"
|
| 58 |
60 |
|
| 59 |
61 |
# Here's how the cross-compile logic breaks down ...
|
| 60 |
62 |
# CTARGET - machine that will target the binaries
|
| ... | ... | |
| 223 |
225 |
tst-aarch64-pkey
|
| 224 |
226 |
tst-bz21269
|
| 225 |
227 |
tst-mlock2
|
|
228 |
tst-mseal-pkey
|
| 226 |
229 |
tst-ntp_gettime
|
| 227 |
230 |
tst-ntp_gettime-time64
|
| 228 |
231 |
tst-ntp_gettimex
|
| ... | ... | |
| 356 |
359 |
just_headers && return 0
|
| 357 |
360 |
|
| 358 |
361 |
case $(tc-arch) in
|
|
362 |
alpha)
|
|
363 |
# glibc selects its hand-written assembly mem*/str* routines by the
|
|
364 |
# host triplet's machine prefix (sysdeps/alpha/preconfigure does
|
|
365 |
# machine=alpha/$machine), NOT by the -mcpu codegen flag. With the
|
|
366 |
# bare alpha-*-* CHOST only the generic C is built. Map -mcpu to the
|
|
367 |
# most specific sysdeps/alpha/alphaev* dir that exists (Implies chain
|
|
368 |
# alphaev67 -> alphaev6 -> alphaev5) so the tuned asm is selected.
|
|
369 |
local cpu
|
|
370 |
case $(get-flag mcpu) in
|
|
371 |
21264a|ev67) cpu="alphaev67" ;;
|
|
372 |
21264|ev6) cpu="alphaev6" ;;
|
|
373 |
21164*|ev5|ev56|pca56) cpu="alphaev5" ;;
|
|
374 |
esac
|
|
375 |
[[ -n ${cpu} ]] && CTARGET_OPT="${cpu}-${CTARGET#*-}"
|
|
376 |
;;
|
| 359 |
377 |
x86)
|
| 360 |
378 |
# -march needed for #185404 #199334
|
| 361 |
379 |
# TODO: When creating the first glibc cross-compile, this test will
|
| ... | ... | |
| 387 |
405 |
[[ ${t} == "x86_64" ]] && t="x86-64"
|
| 388 |
406 |
filter-flags '-march=*'
|
| 389 |
407 |
# ugly, ugly, ugly. ugly.
|
| 390 |
|
CFLAGS_x86=$(CFLAGS=${CFLAGS_x86}; filter-flags '-march=*'; echo "${CFLAGS}")
|
|
408 |
CFLAGS_x86=$(
|
|
409 |
CFLAGS=${CFLAGS_x86}
|
|
410 |
filter-flags '-march=*'
|
|
411 |
is-flagq '-mfpmath=sse' && append-cflags -msse
|
|
412 |
echo "${CFLAGS}"
|
|
413 |
)
|
| 391 |
414 |
export CFLAGS_x86="${CFLAGS_x86} -march=${t}"
|
| 392 |
415 |
einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})"
|
| 393 |
416 |
fi
|
| ... | ... | |
| 846 |
869 |
[[ ${I_ALLOW_TO_BREAK_MY_SYSTEM} = yes ]] || die "Aborting to save your system."
|
| 847 |
870 |
fi
|
| 848 |
871 |
|
| 849 |
|
if ! do_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n' ; then
|
|
872 |
if is_linux && ! do_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n' ; then
|
| 850 |
873 |
eerror "Your old kernel is broken. You need to update it to a newer"
|
| 851 |
874 |
eerror "version as syscall(<bignum>) will break. See bug 279260."
|
| 852 |
875 |
[[ ${I_ALLOW_TO_BREAK_MY_SYSTEM} = yes ]] || die "Old and broken kernel."
|
| ... | ... | |
| 903 |
926 |
die "Found directory (${ESYSROOT}/usr/lib/include) which will break build (bug #833620)!"
|
| 904 |
927 |
fi
|
| 905 |
928 |
|
| 906 |
|
if [[ ${CTARGET} == *-linux* ]] ; then
|
|
929 |
if is_linux ; then
|
|
930 |
if use old-kernel ; then
|
|
931 |
MIN_KERN_VER=${MIN_KERN_VER_UPSTREAM}
|
|
932 |
else
|
|
933 |
MIN_KERN_VER=${MIN_KERN_VER_GENTOO}
|
|
934 |
fi
|
|
935 |
|
| 907 |
936 |
local run_kv build_kv want_kv
|
| 908 |
937 |
|
| 909 |
938 |
run_kv=$(g_get_running_KV)
|
| ... | ... | |
| 917 |
946 |
eend 1
|
| 918 |
947 |
echo
|
| 919 |
948 |
eerror "You need a kernel of at least ${want_kv}!"
|
| 920 |
|
die "Kernel version too low!"
|
|
949 |
die "Kernel version too low! Maybe setting USE=old-kernel helps."
|
| 921 |
950 |
fi
|
| 922 |
951 |
eend 0
|
| 923 |
952 |
fi
|
| ... | ... | |
| 1028 |
1057 |
|
| 1029 |
1058 |
# Patches we should apply only for Hurd to be conservative
|
| 1030 |
1059 |
if is_hurd ; then
|
| 1031 |
|
eapply "${FILESDIR}"/glibc-2.43-hurd-link-helpers.patch
|
| 1032 |
1060 |
eapply "${FILESDIR}"/glibc-2.43-hurd-CLOCK_MONOTONIC.patch
|
| 1033 |
|
eapply "${FILESDIR}"/glibc-2.43-hurd-ldconfig.patch
|
| 1034 |
1061 |
fi
|
| 1035 |
1062 |
fi
|
| 1036 |
1063 |
|
| ... | ... | |
| 1090 |
1117 |
|
| 1091 |
1118 |
[[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp )
|
| 1092 |
1119 |
|
|
1120 |
if use old-kernel ; then
|
|
1121 |
MIN_KERN_VER=${MIN_KERN_VER_UPSTREAM}
|
|
1122 |
else
|
|
1123 |
MIN_KERN_VER=${MIN_KERN_VER_GENTOO}
|
|
1124 |
fi
|
| 1093 |
1125 |
myconf+=( --enable-kernel=${MIN_KERN_VER} )
|
| 1094 |
1126 |
|
| 1095 |
1127 |
# Since SELinux support is only required for nscd, only enable it if:
|
| ... | ... | |
| 1368 |
1400 |
done
|
| 1369 |
1401 |
fi
|
| 1370 |
1402 |
|
|
1403 |
# https://inbox.sourceware.org/libc-alpha/lhuikb5ibey.fsf@oldenburg.str.redhat.com/
|
|
1404 |
local -x GAWK_GNU_MATCHERS=1
|
|
1405 |
|
| 1371 |
1406 |
# sandbox does not understand unshare() and prevents
|
| 1372 |
1407 |
# writes to /proc/, which makes many tests fail
|
| 1373 |
1408 |
|
| ... | ... | |
| 1595 |
1630 |
|
| 1596 |
1631 |
if is_hurd && has amd64 $(get_install_abis) ; then
|
| 1597 |
1632 |
# First, let's check for sanity
|
| 1598 |
|
if [[ -f "$(alt_prefix)/lib/ld-x86-64.so.1" ]] ; then
|
|
1633 |
if [[ -f "${D}/$(alt_prefix)/lib/ld-x86-64.so.1" ]] ; then
|
| 1599 |
1634 |
die "Somehow your amd64 hurd glibc installed /lib/ld-x86-64.so.1 ... this should not happen."
|
| 1600 |
1635 |
fi
|
| 1601 |
1636 |
|
| ... | ... | |
| 1605 |
1640 |
|
| 1606 |
1641 |
if is_hurd && has x86 $(get_install_abis) ; then
|
| 1607 |
1642 |
# First, let's check for sanity
|
| 1608 |
|
if [[ -f "$(alt_prefix)/$(get_abi_LIBDIR x86)/ld.so" ]] ; then
|
|
1643 |
if [[ -f "${D}/$(alt_prefix)/$(get_abi_LIBDIR x86)/ld.so" ]] ; then
|
| 1609 |
1644 |
die "Somehow your x86 hurd glibc installed ld.so ... this should not happen."
|
| 1610 |
1645 |
fi
|
| 1611 |
1646 |
|