Diff glibc-2.42-r7 with a glibc-2.43

/usr/portage/sys-libs/glibc/glibc-2.43.ebuild 2026-06-11 19:17:05.707800416 +0300
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=9
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
	SRC_URI+=" https://distfiles.gentoo.org/pub/proj/toolchain/glibc/patches/${P}-patches-${PATCH_VER}.tar.xz"
49 48
	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 50
fi
51 51

  
52 52
SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_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+="
......
376 387
					[[ ${t} == "x86_64" ]] && t="x86-64"
377 388
					filter-flags '-march=*'
378 389
					# ugly, ugly, ugly.  ugly.
379
					CFLAGS_x86=$(
380
						CFLAGS=${CFLAGS_x86}
381
						filter-flags '-march=*'
382
						is-flagq '-mfpmath=sse' && append-cflags -msse
383
						echo "${CFLAGS}"
384
					)
390
					CFLAGS_x86=$(CFLAGS=${CFLAGS_x86}; filter-flags '-march=*'; echo "${CFLAGS}")
385 391
					export CFLAGS_x86="${CFLAGS_x86} -march=${t}"
386 392
					einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})"
387 393
				fi
388 394
				# For compatibility with older binaries at slight performance cost.
389 395
				use stack-realign && export CFLAGS_x86+=" -mstackrealign"
390 396
			fi
397

  
398
			if is_hurd ; then
399
				# doesnt build with -march=native and probably other values, debugging required
400
				filter-flags '-march=*'
401
			fi
391 402
		;;
392 403
		mips)
393 404
			# The mips abi cannot support the GNU style hashes. #233233
......
494 505
		append-ldflags '-Wl,--hash-style=both'
495 506
	fi
496 507

  
508
	# clang warns about linker flags unused during compilation, but we don't
509
	# want that to turn into errors!
510
	# Let's turn the warning off entirely since it spams.
511
	append-flags -Wno-unused-command-line-argument
512

  
497 513
	# #492892
498 514
	filter-flags -frecord-gcc-switches
499 515

  
......
506 522
	# #829583
507 523
	filter-lfs-flags
508 524

  
525
	case ${CTARGET} in
526
		*-linux*)
527
			;;
528
		*-gnu)
529
			# -g3 confuses MIG which relies on preprocessed input
530
			replace-flags -ggdb[3-9] -ggdb2
531
			replace-flags -g3 -g
532
			;;
533
	esac
534

  
509 535
	unset CBUILD_OPT CTARGET_OPT
510 536
	if use multilib ; then
511 537
		CTARGET_OPT=$(get_abi_CTARGET)
......
625 651
	export glibc__ORIG_CXX=${CXX}
626 652
	export glibc__ORIG_CPP=${CPP}
627 653

  
628
	if tc-is-clang && ! use custom-cflags && ! is_crosscompile ; then
654
	if tc-is-clang && ! ( use clang || use custom-cflags ) && ! is_crosscompile ; then
629 655
		export glibc__force_gcc=yes
630 656
		# once this is toggled on, it needs to stay on, since with CPP manipulated
631 657
		# tc-is-clang does not work correctly anymore...
......
636 662
		# recover the proper gcc and binutils settings here, at least until glibc
637 663
		# is finally building with clang. So let's override everything that is
638 664
		# set in the clang profiles.
639
		# Want to shoot yourself into the foot? Set USE=custom-cflags, that's always
640
		# a good start into that direction.
641
		# Also, if you're crosscompiling, let's assume you know what you are doing.
665
		# Want to shoot yourself into the foot? Set USE="clang" or USE="custom-cflags".
666
		# Also, if you are crosscompiling, let's assume you know what you are doing.
642 667
		# Hopefully.
643 668
		# Last, we need the settings of the *build* environment, not of the
644 669
		# target environment...
......
667 692
		filter-flags '-D_FORTIFY_SOURCE=*'
668 693

  
669 694
	else
670

  
671 695
		# this is the "normal" case
672 696

  
673
		export CC="$(tc-getCC ${CTARGET})"
674
		export CXX="$(tc-getCXX ${CTARGET})"
675
		export CPP="$(tc-getCPP ${CTARGET})"
676

  
677 697
		# Always use tuple-prefixed toolchain. For non-native ABI glibc's configure
678 698
		# can't detect them automatically due to ${CHOST} mismatch and fallbacks
679 699
		# to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup().
700
		export CC="$(tc-getCC ${CTARGET})"
701
		export CXX="$(tc-getCXX ${CTARGET})"
702
		export CPP="$(tc-getCPP ${CTARGET})"
680 703
		export NM="$(tc-getNM ${CTARGET})"
681 704
		export READELF="$(tc-getREADELF ${CTARGET})"
682 705

  
683 706
	fi
684 707

  
685
	# We need to export CFLAGS with abi information in them because glibc's
686
	# configure script checks CFLAGS for some targets (like mips).  Keep
687
	# around the original clean value to avoid appending multiple ABIs on
688
	# top of each other. (Why does the comment talk about CFLAGS if the code
689
	# acts on CC?)
708
	# We need to move CFLAGS with abi information into CC etc per glibc upstream
709
	# requirement. Keep around the original clean value to avoid appending
710
	# multiple ABIs on top of each other.
690 711
	export glibc__GLIBC_CC=${CC}
691 712
	export glibc__GLIBC_CXX=${CXX}
692 713
	export glibc__GLIBC_CPP=${CPP}
......
1004 1025
		einfo "Applying Gentoo Glibc patchset ${patchsetname}"
1005 1026
		eapply "${WORKDIR}"/patches
1006 1027
		einfo "Done."
1028

  
1029
		# Patches we should apply only for Hurd to be conservative
1030
		if is_hurd ; then
1031
			eapply "${FILESDIR}"/glibc-2.43-hurd-link-helpers.patch
1032
			eapply "${FILESDIR}"/glibc-2.43-hurd-CLOCK_MONOTONIC.patch
1033
			eapply "${FILESDIR}"/glibc-2.43-hurd-ldconfig.patch
1034
		fi
1007 1035
	fi
1008 1036

  
1009 1037
	case ${CTARGET} in
......
1109 1137
		--with-bugurl=https://bugs.gentoo.org/
1110 1138
		--with-pkgversion="$(glibc_banner)"
1111 1139
		$(use_multiarch || echo --disable-multi-arch)
1112
		$(use_enable systemtap)
1113 1140
		$(use_enable nscd)
1114 1141

  
1115 1142
		# /usr/bin/mtrace has a Perl shebang. Gentoo Prefix QA checks fail if
......
1135 1162
	# We rely on sys-libs/timezone-data for timezone tools normally.
1136 1163
	myconf+=( $(use_enable vanilla timezone-tools) )
1137 1164

  
1165
	if is_crosscompile ; then
1166
		myconf+=( --disable-systemtap )
1167
	else
1168
		myconf+=( $(use_enable systemtap) )
1169
	fi
1170

  
1138 1171
	# These libs don't have configure flags.
1139 1172
	ac_cv_lib_audit_audit_log_user_avc_message=$(usex audit || echo no)
1140 1173
	ac_cv_lib_cap_cap_init=$(usex caps || echo no)
......
1562 1595

  
1563 1596
	if is_hurd && has amd64 $(get_install_abis) ; then
1564 1597
		# First, let's check for sanity
1565
		if [[ -f "${D}/$(alt_prefix)/lib/ld-x86-64.so.1" ]] ; then
1598
		if [[ -f "$(alt_prefix)/lib/ld-x86-64.so.1" ]] ; then
1566 1599
			die "Somehow your amd64 hurd glibc installed /lib/ld-x86-64.so.1 ... this should not happen."
1567 1600
		fi
1568 1601

  
......
1572 1605

  
1573 1606
	if is_hurd && has x86 $(get_install_abis) ; then
1574 1607
		# First, let's check for sanity
1575
		if [[ -f "${D}/$(alt_prefix)/$(get_abi_LIBDIR x86)/ld.so" ]] ; then
1608
		if [[ -f "$(alt_prefix)/$(get_abi_LIBDIR x86)/ld.so" ]] ; then
1576 1609
			die "Somehow your x86 hurd glibc installed ld.so ... this should not happen."
1577 1610
		fi
1578 1611

  
Thank you!