public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/5] toolchain-funcs.eclass: drop deprecated gen_usr_ldscript and multilib inherit
@ 2025-04-12 15:55 Sam James
  2025-04-12 15:55 ` [gentoo-dev] [PATCH 2/5] toolchain-funcs.eclass: update tc-get-cxx-stdlib for C++20 Sam James
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sam James @ 2025-04-12 15:55 UTC (permalink / raw
  To: gentoo-dev; +Cc: toolchain, Sam James

Drop toolchain-funcs.eclass's gen_usr_ldscript and along with it, inheriting
multilib. gen_usr_ldscript is itself deprecaated but the version in toolchain-funcs
doubly so, as it was replaced by the one in usr-ldscript.eclass.

Signed-off-by: Sam James <sam@gentoo.org>
---
Tested by `pkgcheck scan -k MissingInherits` and looking at gen_usr_ldscript
users for missing usr-ldscript.eclass inherits, though we're going to try
cull those too (most are already gone).

I plan on committing the series shortly.

 eclass/toolchain-funcs.eclass | 135 ----------------------------------
 1 file changed, 135 deletions(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 754d23f91c069..ae21a18a14c23 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -21,8 +21,6 @@ case ${EAPI} in
 	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-inherit multilib
-
 # tc-getPROG <VAR [search vars]> <default> [tuple]
 _tc-getPROG() {
 	local tuple=$1
@@ -1147,139 +1145,6 @@ tc-enables-ssp-all() {
 	tc-cpp-is-true "defined(__SSP_ALL__)" ${CPPFLAGS} ${CFLAGS} ${CXXFLAGS}
 }
 
-
-# @FUNCTION: gen_usr_ldscript
-# @USAGE: [-a] <list of libs to create linker scripts for>
-# @DESCRIPTION:
-# This function is deprecated. Use the version from
-# usr-ldscript.eclass instead.
-gen_usr_ldscript() {
-	ewarn "${FUNCNAME}: Please migrate to usr-ldscript.eclass"
-
-	local lib libdir=$(get_libdir) output_format="" auto=false suffix=$(get_libname)
-
-	tc-is-static-only && return
-	use prefix && return
-
-	# We only care about stuffing / for the native ABI, bug #479448
-	if [[ $(type -t multilib_is_native_abi) == "function" ]] ; then
-		multilib_is_native_abi || return 0
-	fi
-
-	# Eventually we'd like to get rid of this func completely, bug #417451
-	case ${CTARGET:-${CHOST}} in
-		*-darwin*) ;;
-		*-android*) return 0 ;;
-		*linux*) use prefix && return 0 ;;
-		*) return 0 ;;
-	esac
-
-	# Just make sure it exists
-	dodir /usr/${libdir}
-
-	if [[ $1 == "-a" ]] ; then
-		auto=true
-		shift
-		dodir /${libdir}
-	fi
-
-	# OUTPUT_FORMAT gives hints to the linker as to what binary format
-	# is referenced ... makes multilib saner
-	local flags=( ${CFLAGS} ${LDFLAGS} -Wl,--verbose )
-	if $(tc-getLD) --version | grep -q 'GNU gold' ; then
-		# If they're using gold, manually invoke the old bfd, bug #487696
-		local d="${T}/bfd-linker"
-		mkdir -p "${d}"
-		ln -sf $(type -P ${CHOST}-ld.bfd) "${d}"/ld
-		flags+=( -B"${d}" )
-	fi
-	output_format=$($(tc-getCC) "${flags[@]}" 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
-	[[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
-
-	for lib in "$@" ; do
-		local tlib
-		if ${auto} ; then
-			lib="lib${lib}${suffix}"
-		else
-			# Ensure /lib/${lib} exists to avoid dangling scripts/symlinks.
-			# This especially is for AIX where $(get_libname) can return ".a",
-			# so /lib/${lib} might be moved to /usr/lib/${lib} (by accident).
-			[[ -r ${ED}/${libdir}/${lib} ]] || continue
-			#TODO: better die here?
-		fi
-
-		case ${CTARGET:-${CHOST}} in
-		*-darwin*)
-			if ${auto} ; then
-				tlib=$(scanmacho -qF'%S#F' "${ED}"/usr/${libdir}/${lib})
-			else
-				tlib=$(scanmacho -qF'%S#F' "${ED}"/${libdir}/${lib})
-			fi
-			[[ -z ${tlib} ]] && die "unable to read install_name from ${lib}"
-			tlib=${tlib##*/}
-
-			if ${auto} ; then
-				mv "${ED}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die
-				# some install_names are funky: they encode a version
-				if [[ ${tlib} != ${lib%${suffix}}.*${suffix#.} ]] ; then
-					mv "${ED}"/usr/${libdir}/${tlib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die
-				fi
-				rm -f "${ED}"/${libdir}/${lib}
-			fi
-
-			# Mach-O files have an id, which is like a soname, it tells how
-			# another object linking against this lib should reference it.
-			# Since we moved the lib from usr/lib into lib this reference is
-			# wrong.  Hence, we update it here.  We don't configure with
-			# libdir=/lib because that messes up libtool files.
-			# Make sure we don't lose the specific version, so just modify the
-			# existing install_name
-			if [[ ! -w "${ED}/${libdir}/${tlib}" ]] ; then
-				chmod u+w "${ED}${libdir}/${tlib}" # needed to write to it
-				local nowrite=yes
-			fi
-			install_name_tool \
-				-id "${EPREFIX}"/${libdir}/${tlib} \
-				"${ED}"/${libdir}/${tlib} || die "install_name_tool failed"
-			[[ -n ${nowrite} ]] && chmod u-w "${ED}${libdir}/${tlib}"
-			# Now as we don't use GNU binutils and our linker doesn't
-			# understand linker scripts, just create a symlink.
-			pushd "${ED}/usr/${libdir}" > /dev/null
-			ln -snf "../../${libdir}/${tlib}" "${lib}"
-			popd > /dev/null
-			;;
-		*)
-			if ${auto} ; then
-				tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib})
-				[[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}"
-				mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die
-				# some SONAMEs are funky: they encode a version before the .so
-				if [[ ${tlib} != ${lib}* ]] ; then
-					mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}/ || die
-				fi
-				rm -f "${ED}"/${libdir}/${lib}
-			else
-				tlib=${lib}
-			fi
-			cat > "${ED}/usr/${libdir}/${lib}" <<-END_LDSCRIPT
-			/* GNU ld script
-			   Since Gentoo has critical dynamic libraries in /lib, and the static versions
-			   in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we
-			   run into linking problems.  This "fake" dynamic lib is a linker script that
-			   redirects the linker to the real lib.  And yes, this works in the cross-
-			   compiling scenario as the sysroot-ed linker will prepend the real path.
-
-			   See bug https://bugs.gentoo.org/4411 for more info.
-			 */
-			${output_format}
-			GROUP ( ${EPREFIX}/${libdir}/${tlib} )
-			END_LDSCRIPT
-			;;
-		esac
-		fperms a+x "/usr/${libdir}/${lib}" || die "could not change perms on ${lib}"
-	done
-}
-
 # @FUNCTION: tc-get-cxx-stdlib
 # @DESCRIPTION:
 # Attempt to identify the C++ standard library used by the compiler.
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-dev] [PATCH 2/5] toolchain-funcs.eclass: update tc-get-cxx-stdlib for C++20
  2025-04-12 15:55 [gentoo-dev] [PATCH 1/5] toolchain-funcs.eclass: drop deprecated gen_usr_ldscript and multilib inherit Sam James
@ 2025-04-12 15:55 ` Sam James
  2025-04-12 15:55 ` [gentoo-dev] [PATCH 3/5] app-arch/bzip2: drop gen_usr_ldscript from live too Sam James
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2025-04-12 15:55 UTC (permalink / raw
  To: gentoo-dev; +Cc: toolchain, Sam James

<ciso646> is gone from C++20, so use <version> for >= C++20.

See https://stackoverflow.com/a/31658120.

Signed-off-by: Sam James <sam@gentoo.org>
---
 eclass/toolchain-funcs.eclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index ae21a18a14c23..baf032bbd4ecc 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -1156,7 +1156,12 @@ tc-enables-ssp-all() {
 #
 # If the library is not recognized, the function returns 1.
 tc-get-cxx-stdlib() {
-	local code='#include <ciso646>
+	local code='
+#if __cplusplus >= 202002L
+	#include <version>
+#else
+	#include <ciso646>
+#endif
 
 #if defined(_LIBCPP_VERSION)
 	HAVE_LIBCXX
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-dev] [PATCH 3/5] app-arch/bzip2: drop gen_usr_ldscript from live too
  2025-04-12 15:55 [gentoo-dev] [PATCH 1/5] toolchain-funcs.eclass: drop deprecated gen_usr_ldscript and multilib inherit Sam James
  2025-04-12 15:55 ` [gentoo-dev] [PATCH 2/5] toolchain-funcs.eclass: update tc-get-cxx-stdlib for C++20 Sam James
@ 2025-04-12 15:55 ` Sam James
  2025-04-12 15:55 ` [gentoo-dev] [PATCH 4/5] x11-misc/bumblebee: inherit multilib for get_all_libdirs Sam James
  2025-04-12 15:55 ` [gentoo-dev] [PATCH 5/5] media-libs/qhull: inherit multilib for get_libname Sam James
  3 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2025-04-12 15:55 UTC (permalink / raw
  To: gentoo-dev; +Cc: toolchain, Sam James

Dropped from non-live some time ago. The live ebuild actually has
its own issues but we were/are waiting for a new upstream release
with autotools merged before it's worth fixing that.

Signed-off-by: Sam James <sam@gentoo.org>
---
 app-arch/bzip2/bzip2-9999.ebuild | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/app-arch/bzip2/bzip2-9999.ebuild b/app-arch/bzip2/bzip2-9999.ebuild
index da72a148ab56e..21942aa3ab6f6 100644
--- a/app-arch/bzip2/bzip2-9999.ebuild
+++ b/app-arch/bzip2/bzip2-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -33,14 +33,6 @@ multilib_src_configure() {
 	meson_src_configure
 }
 
-multilib_src_install() {
-	meson_src_install
-
-	if multilib_is_native_abi ; then
-		gen_usr_ldscript -a bz2
-	fi
-}
-
 multilib_src_install_all() {
 	dodir /bin
 	mv "${ED}"/usr/bin/bzip2 "${ED}"/bin/bzip2-reference || die
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-dev] [PATCH 4/5] x11-misc/bumblebee: inherit multilib for get_all_libdirs
  2025-04-12 15:55 [gentoo-dev] [PATCH 1/5] toolchain-funcs.eclass: drop deprecated gen_usr_ldscript and multilib inherit Sam James
  2025-04-12 15:55 ` [gentoo-dev] [PATCH 2/5] toolchain-funcs.eclass: update tc-get-cxx-stdlib for C++20 Sam James
  2025-04-12 15:55 ` [gentoo-dev] [PATCH 3/5] app-arch/bzip2: drop gen_usr_ldscript from live too Sam James
@ 2025-04-12 15:55 ` Sam James
  2025-04-12 15:55 ` [gentoo-dev] [PATCH 5/5] media-libs/qhull: inherit multilib for get_libname Sam James
  3 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2025-04-12 15:55 UTC (permalink / raw
  To: gentoo-dev; +Cc: toolchain, Sam James

We used to inherit multilib via systemd->toolchain-funcs->multilib so this
was only a missing direct inherit before.

Signed-off-by: Sam James <sam@gentoo.org>
---
 x11-misc/bumblebee/bumblebee-3.2.1_p20210112-r4.ebuild | 4 ++--
 x11-misc/bumblebee/bumblebee-9999.ebuild               | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/x11-misc/bumblebee/bumblebee-3.2.1_p20210112-r4.ebuild b/x11-misc/bumblebee/bumblebee-3.2.1_p20210112-r4.ebuild
index b0690088fc3a3..91a9c00d23b36 100644
--- a/x11-misc/bumblebee/bumblebee-3.2.1_p20210112-r4.ebuild
+++ b/x11-misc/bumblebee/bumblebee-3.2.1_p20210112-r4.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
-inherit autotools readme.gentoo-r1 systemd udev
+inherit autotools multilib readme.gentoo-r1 systemd udev
 
 if [[ ${PV} == 9999 ]]; then
 	inherit git-r3
diff --git a/x11-misc/bumblebee/bumblebee-9999.ebuild b/x11-misc/bumblebee/bumblebee-9999.ebuild
index bd63a8594628e..b534d66e36d6e 100644
--- a/x11-misc/bumblebee/bumblebee-9999.ebuild
+++ b/x11-misc/bumblebee/bumblebee-9999.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
-inherit autotools readme.gentoo-r1 systemd udev
+inherit autotools multilib readme.gentoo-r1 systemd udev
 
 if [[ ${PV} == 9999 ]]; then
 	inherit git-r3
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-dev] [PATCH 5/5] media-libs/qhull: inherit multilib for get_libname
  2025-04-12 15:55 [gentoo-dev] [PATCH 1/5] toolchain-funcs.eclass: drop deprecated gen_usr_ldscript and multilib inherit Sam James
                   ` (2 preceding siblings ...)
  2025-04-12 15:55 ` [gentoo-dev] [PATCH 4/5] x11-misc/bumblebee: inherit multilib for get_all_libdirs Sam James
@ 2025-04-12 15:55 ` Sam James
  3 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2025-04-12 15:55 UTC (permalink / raw
  To: gentoo-dev; +Cc: toolchain, Sam James

Signed-off-by: Sam James <sam@gentoo.org>
---
 media-libs/qhull/qhull-2020.2-r3.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/media-libs/qhull/qhull-2020.2-r3.ebuild b/media-libs/qhull/qhull-2020.2-r3.ebuild
index 3461992646ddc..aa4250b2493e6 100644
--- a/media-libs/qhull/qhull-2020.2-r3.ebuild
+++ b/media-libs/qhull/qhull-2020.2-r3.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
-inherit cmake
+inherit cmake multilib
 
 DESCRIPTION="Geometry library"
 HOMEPAGE="http://www.qhull.org"
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-12 16:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-12 15:55 [gentoo-dev] [PATCH 1/5] toolchain-funcs.eclass: drop deprecated gen_usr_ldscript and multilib inherit Sam James
2025-04-12 15:55 ` [gentoo-dev] [PATCH 2/5] toolchain-funcs.eclass: update tc-get-cxx-stdlib for C++20 Sam James
2025-04-12 15:55 ` [gentoo-dev] [PATCH 3/5] app-arch/bzip2: drop gen_usr_ldscript from live too Sam James
2025-04-12 15:55 ` [gentoo-dev] [PATCH 4/5] x11-misc/bumblebee: inherit multilib for get_all_libdirs Sam James
2025-04-12 15:55 ` [gentoo-dev] [PATCH 5/5] media-libs/qhull: inherit multilib for get_libname Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox