summaryrefslogtreecommitdiff
path: root/sys-apps/attr
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/attr')
-rw-r--r--sys-apps/attr/Manifest2
-rw-r--r--sys-apps/attr/attr-2.5.1-r2.ebuild104
-rw-r--r--sys-apps/attr/files/attr-2.5.1-r2-fix-symver.patch206
3 files changed, 312 insertions, 0 deletions
diff --git a/sys-apps/attr/Manifest b/sys-apps/attr/Manifest
index 8b667d072e12..a54e824fae20 100644
--- a/sys-apps/attr/Manifest
+++ b/sys-apps/attr/Manifest
@@ -1,7 +1,9 @@
AUX attr-2.5.1-fix-symver.patch 5856 BLAKE2B dbff8d7cd138d962cca02c35f1ad8679f813cedf92784d075f837f0e56989a514d105cfb2c765bb382b1413aaddcd66be4a09a2fafb58172a7b98c0eecc17f63 SHA512 0d576b867e253cb63e712ff6f2cb0491f42be8214e8307bbd71f50247917ebe9236ddafad8610c2e8de2d0f33b1d0f87ad1258c8637b9ba46ad7f2b2fa1f9a24
+AUX attr-2.5.1-r2-fix-symver.patch 6909 BLAKE2B 844f6d9e87ca3cfd9413047cd8fbebc6265545d1aed3653ec2d1d8fc18ee0eb42ebca756a62c9d8a8cc2c4c7f38720a66afcbe0d052525f58e4748ba50d267b3 SHA512 874a4e770a624ce4dd86b6b03e6dd0abef737cafccf2580f5c5e6f75a66425b2e34da6ee520991693387f55000448451fdc96883c2759c9fb4c650d667df63c8
AUX xattr-shim.h 253 BLAKE2B 2e9a549f208b7eab0871daeebafd1ef9924102e60f68353a04f3c26cda5df6c7bedf592df5c3d6f3163a6c7b7c9785c69111fe2e7f3d061bf64dcdcdf92e183a SHA512 cd8af81c90da01d2f7716d2fd5f9f6a81cfc36aa35b4d03cb04651cac0494def88a81bf8b862a3aeabf45e940ab1488aa49c97001ec09e0df289a7c4552802f8
DIST attr-2.5.1.tar.xz 318188 BLAKE2B 876dcbd802ea79b7851640f208820ffdfb73dc46065af673037c6dd50ad2af158f9f74b34cf45728baf9d0cc5572b40c3f102aa2907245a877db0d3879e38f04 SHA512 9e5555260189bb6ef2440c76700ebb813ff70582eb63d446823874977307d13dfa3a347dfae619f8866943dfa4b24ccf67dadd7e3ea2637239fdb219be5d2932
EBUILD attr-2.5.1-r1.ebuild 2632 BLAKE2B 0626b192ef6a6f81dec7186ab4c1a9a4352d9c99b684f0872c2a1f6709d156316bbca932fba7355f9c5596a15b92bd065a56507ef5a041757b1a46daa4c2c96e SHA512 e76b292dcbe879d2d79987e00528c25c9fac831ff391fc9d0adbba51533402a068c5a01449750e22433c858c57bde5b4c2bda11d226f5be625f7df7b16d6f9d4
+EBUILD attr-2.5.1-r2.ebuild 2472 BLAKE2B 430e20284e07660e229d68511dab14c65176f25d76cca30bd1c1b617219a8880b4bc3166d27fdec6e10b2adcbe768f5abe237f9fd09b66e16c9a733030c85623 SHA512 f3076c16dd948b5e4caea3b731e03bb9e35aa36856185635901dcdb00a4bea7b86d6bf727aa4301cd934316d0755aa1012e8bdcfc1558698126647f2bddd36ea
EBUILD attr-2.5.1.ebuild 2495 BLAKE2B 290d82c439e0096b6ac5be07258d87d3c05b56500fa81b4cf610e322505a5cb302c3e5900f59b363c7cfd3ae1bf315f19bfeed7968c95d3c9cc222b8639c5498 SHA512 201868f12414b9662b5edfdc19827c84a9cd967295b6752eeb38e4c52472ea73cc5caf04bba52c08d55b15570d71cb730e283b8f3ebebbfbc159cf0f27c20eb4
EBUILD attr-9999.ebuild 2632 BLAKE2B 0626b192ef6a6f81dec7186ab4c1a9a4352d9c99b684f0872c2a1f6709d156316bbca932fba7355f9c5596a15b92bd065a56507ef5a041757b1a46daa4c2c96e SHA512 e76b292dcbe879d2d79987e00528c25c9fac831ff391fc9d0adbba51533402a068c5a01449750e22433c858c57bde5b4c2bda11d226f5be625f7df7b16d6f9d4
MISC metadata.xml 337 BLAKE2B c04cc7c99b3d9d39870605354acd4f0a4b03d47e79228f444e915ce17abd2eb075418919dc3272903fdd524f56588ef194d7cdbd43f2b040c4f6a9d5fa2eebee SHA512 e9ba5573c84dd1b2cdce5b74e53b731c1ba4b3e72bca569f3febc77e431b96982cd83a71720e021ba23e8d6fd23f9dbea43a6c8d94b2b6ce1b3d26fda038d6de
diff --git a/sys-apps/attr/attr-2.5.1-r2.ebuild b/sys-apps/attr/attr-2.5.1-r2.ebuild
new file mode 100644
index 000000000000..2046677daddd
--- /dev/null
+++ b/sys-apps/attr/attr-2.5.1-r2.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs multilib-minimal usr-ldscript
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://git.savannah.gnu.org/git/${PN}.git"
+ inherit autotools git-r3
+else
+ inherit libtool
+
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+ SRC_URI="mirror://nongnu/${PN}/${P}.tar.xz"
+fi
+
+DESCRIPTION="Extended attributes tools"
+HOMEPAGE="https://savannah.nongnu.org/projects/attr"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="debug nls static-libs"
+
+BDEPEND="nls? ( sys-devel/gettext )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.5.1-r2-fix-symver.patch
+)
+
+src_prepare() {
+ default
+
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles || die
+ eautopoint
+ eautoreconf
+ else
+ # bug #580792
+ elibtoolize
+ fi
+}
+
+src_configure() {
+ # bug #760857
+ append-lfs-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/bin
+ --libexecdir="${EPREFIX}"/usr/$(get_libdir)
+ --enable-shared
+ $(use_enable static-libs static)
+ $(use_enable nls)
+ $(use_enable debug)
+ )
+
+ ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+
+ # Sanity check until we track down why this is happening. bug #644048
+ local lib="${ED}/usr/$(get_libdir)/libattr.so.1"
+ if [[ -e ${lib} ]] ; then
+ local versions=$($(tc-getREADELF) -V "${lib}")
+ local symbols=$($(tc-getREADELF) -sW "${lib}")
+ if [[ "${versions}" != *"ATTR_1.0"* || \
+ "${versions}" != *"ATTR_1.1"* || \
+ "${versions}" != *"ATTR_1.2"* || \
+ "${versions}" != *"ATTR_1.3"* || \
+ "${symbols}" != *"getxattr@ATTR_1.0"* ]] ; then
+ echo "# readelf -V ${lib}"
+ echo "${versions}"
+ echo "# readelf -sW ${lib}"
+ echo "${symbols}"
+ die "Symbol version sanity check failed; please comment on https://bugs.gentoo.org/644048"
+ else
+ einfo "${lib} passed symbol checks"
+ fi
+ fi
+
+ if multilib_is_native_abi; then
+ # We install attr into /bin, so we need the shared lib with it
+ gen_usr_ldscript -a attr
+ fi
+
+ # Add a wrapper until people upgrade.
+ # TODO: figure out when this was added & when we can drop it!
+ insinto /usr/include/attr
+ newins "${FILESDIR}"/xattr-shim.h xattr.h
+}
+
+multilib_src_install_all() {
+ if ! use static-libs; then
+ find "${ED}" -name '*.la' -delete || die
+ fi
+
+ einstalldocs
+}
diff --git a/sys-apps/attr/files/attr-2.5.1-r2-fix-symver.patch b/sys-apps/attr/files/attr-2.5.1-r2-fix-symver.patch
new file mode 100644
index 000000000000..ee25b13166ff
--- /dev/null
+++ b/sys-apps/attr/files/attr-2.5.1-r2-fix-symver.patch
@@ -0,0 +1,206 @@
+https://lists.nongnu.org/archive/html/acl-devel/2022-05/msg00000.html
+Bug: https://bugs.gentoo.org/644048
+Bug: https://bugs.gentoo.org/700116
+
+From a9ca51afd2b9f68f57de3a4c3d962d1d763572ca Mon Sep 17 00:00:00 2001
+From: Alexander Miller <alex.miller@gmx.de>
+Date: Thu, 28 Nov 2019 22:17:24 +0100
+Subject: [PATCH] Better supported way to set symbol versions for legacy
+ syscalls
+
+Using a linker script to set a symbol versions is an undocumented
+hack and doesn't work reliably in many cases. It works (to some
+degree) with the bfd linker, but fails with gold or lld. And even
+with bfd it can break when using --gc-sections or LTO.
+
+The result may be a library where the code has been discarded and
+the versioned symbols are unusable, e.g.
+ 23: 00000000 0 NOTYPE GLOBAL DEFAULT ABS getxattr@ATTR_1.0
+instead of
+ 23: 000033c0 0 FUNC GLOBAL DEFAULT 11 getxattr@ATTR_1.0
+
+Remove the linker script entirely and set symbol versions with the
+symver attribute if available (in gcc >= 10, but not in clang),
+otherwise use the traditional global asm solution with a .symver
+directive.
+Those are the documented ways to do it and well supported by (almost)
+all configurations. (The exception is old gcc with LTO; a workaround
+is included, but some versions may still need -flto-partition=none).
+
+Signed-off-by: Alexander Miller <alex.miller@gmx.de>
+
+--- a/libattr/Makemodule.am
++++ b/libattr/Makemodule.am
+@@ -8,7 +8,7 @@ LT_CURRENT = 2
+ LT_AGE = 1
+ LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+
+-libattr_la_DEPENDENCIES = exports libattr/libattr.lds
++libattr_la_DEPENDENCIES = exports
+ libattr_la_SOURCES = \
+ libattr/attr_copy_action.c \
+ libattr/attr_copy_check.c \
+@@ -20,7 +20,4 @@ libattr_la_SOURCES = \
+ libattr_la_CFLAGS = -include libattr/libattr.h
+ libattr_la_LDFLAGS = \
+ -Wl,--version-script,$(top_srcdir)/exports \
+- -Wl,$(top_srcdir)/libattr/libattr.lds \
+ -version-info $(LTVERSION)
+-
+-EXTRA_DIST += libattr/libattr.lds
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -647,9 +647,8 @@ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ ACLOCAL_AMFLAGS = -I m4
+-EXTRA_DIST = exports examples/copyattr.c examples/Makefile \
+- libattr/libattr.lds test/README test/run \
+- test/sort-getfattr-output $(TESTS)
++EXTRA_DIST = exports examples/copyattr.c examples/Makefile test/README \
++ test/run test/sort-getfattr-output $(TESTS)
+ SUBDIRS = po
+ AM_CPPFLAGS = \
+ -I$(top_builddir)/include \
+@@ -689,7 +688,7 @@ LT_CURRENT = 2
+ #LT_REVISION =
+ LT_AGE = 1
+ LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+-libattr_la_DEPENDENCIES = exports libattr/libattr.lds
++libattr_la_DEPENDENCIES = exports
+ libattr_la_SOURCES = \
+ libattr/attr_copy_action.c \
+ libattr/attr_copy_check.c \
+@@ -702,7 +701,6 @@ libattr_la_SOURCES = \
+ libattr_la_CFLAGS = -include libattr/libattr.h
+ libattr_la_LDFLAGS = \
+ -Wl,--version-script,$(top_srcdir)/exports \
+- -Wl,$(top_srcdir)/libattr/libattr.lds \
+ -version-info $(LTVERSION)
+
+ libmisc_la_SOURCES = \
+--- a/libattr/libattr.lds
++++ /dev/null
+@@ -1,12 +0,0 @@
+-"fgetxattr@ATTR_1.0" = libattr_fgetxattr;
+-"flistxattr@ATTR_1.0" = libattr_flistxattr;
+-"fremovexattr@ATTR_1.0" = libattr_fremovexattr;
+-"fsetxattr@ATTR_1.0" = libattr_fsetxattr;
+-"getxattr@ATTR_1.0" = libattr_getxattr;
+-"lgetxattr@ATTR_1.0" = libattr_lgetxattr;
+-"listxattr@ATTR_1.0" = libattr_listxattr;
+-"llistxattr@ATTR_1.0" = libattr_llistxattr;
+-"lremovexattr@ATTR_1.0" = libattr_lremovexattr;
+-"lsetxattr@ATTR_1.0" = libattr_lsetxattr;
+-"removexattr@ATTR_1.0" = libattr_removexattr;
+-"setxattr@ATTR_1.0" = libattr_setxattr;
+--- a/libattr/syscalls.c
++++ b/libattr/syscalls.c
+@@ -26,6 +26,27 @@
+ #include <sys/syscall.h>
+ #include <sys/xattr.h>
+
++/*
++ * Versioning of compat symbols:
++ * prefer symver attribute if available (since gcc 10),
++ * fall back to traditional .symver asm directive otherwise.
++ */
++#ifdef __has_attribute
++# if __has_attribute(symver)
++# define SYMVER(cn, vn) __typeof(cn) cn __attribute__((symver(vn)))
++# elif __has_attribute(no_reorder)
++ /*
++ * Avoid wrong partitioning with older gcc and LTO. May not work reliably
++ * with all versions; use -flto-partition=none if you encounter problems.
++ */
++# define SYMVER(cn, vn) __typeof(cn) cn __attribute__((noreorder)); \
++ __asm__(".symver " #cn "," vn)
++# endif
++#endif
++#ifndef SYMVER
++# define SYMVER(cn, vn) __asm__(".symver " #cn "," vn)
++#endif
++
+ #ifdef HAVE_VISIBILITY_ATTRIBUTE
+ # pragma GCC visibility push(default)
+ #endif
+@@ -35,66 +56,78 @@ int libattr_setxattr(const char *path, const char *name,
+ {
+ return syscall(__NR_setxattr, path, name, value, size, flags);
+ }
++SYMVER(libattr_setxattr, "setxattr@ATTR_1.0");
+
+ int libattr_lsetxattr(const char *path, const char *name,
+ void *value, size_t size, int flags)
+ {
+ return syscall(__NR_lsetxattr, path, name, value, size, flags);
+ }
++SYMVER(libattr_lsetxattr, "lsetxattr@ATTR_1.0");
+
+ int libattr_fsetxattr(int filedes, const char *name,
+ void *value, size_t size, int flags)
+ {
+ return syscall(__NR_fsetxattr, filedes, name, value, size, flags);
+ }
++SYMVER(libattr_fsetxattr, "fsetxattr@ATTR_1.0");
+
+ ssize_t libattr_getxattr(const char *path, const char *name,
+ void *value, size_t size)
+ {
+ return syscall(__NR_getxattr, path, name, value, size);
+ }
++SYMVER(libattr_getxattr, "getxattr@ATTR_1.0");
+
+ ssize_t libattr_lgetxattr(const char *path, const char *name,
+ void *value, size_t size)
+ {
+ return syscall(__NR_lgetxattr, path, name, value, size);
+ }
++SYMVER(libattr_lgetxattr, "lgetxattr@ATTR_1.0");
+
+ ssize_t libattr_fgetxattr(int filedes, const char *name,
+ void *value, size_t size)
+ {
+ return syscall(__NR_fgetxattr, filedes, name, value, size);
+ }
++SYMVER(libattr_fgetxattr, "fgetxattr@ATTR_1.0");
+
+ ssize_t libattr_listxattr(const char *path, char *list, size_t size)
+ {
+ return syscall(__NR_listxattr, path, list, size);
+ }
++SYMVER(libattr_listxattr, "listxattr@ATTR_1.0");
+
+ ssize_t libattr_llistxattr(const char *path, char *list, size_t size)
+ {
+ return syscall(__NR_llistxattr, path, list, size);
+ }
++SYMVER(libattr_llistxattr, "llistxattr@ATTR_1.0");
+
+ ssize_t libattr_flistxattr(int filedes, char *list, size_t size)
+ {
+ return syscall(__NR_flistxattr, filedes, list, size);
+ }
++SYMVER(libattr_flistxattr, "flistxattr@ATTR_1.0");
+
+ int libattr_removexattr(const char *path, const char *name)
+ {
+ return syscall(__NR_removexattr, path, name);
+ }
++SYMVER(libattr_removexattr, "removexattr@ATTR_1.0");
+
+ int libattr_lremovexattr(const char *path, const char *name)
+ {
+ return syscall(__NR_lremovexattr, path, name);
+ }
++SYMVER(libattr_lremovexattr, "lremovexattr@ATTR_1.0");
+
+ int libattr_fremovexattr(int filedes, const char *name)
+ {
+ return syscall(__NR_fremovexattr, filedes, name);
+ }
++SYMVER(libattr_fremovexattr, "fremovexattr@ATTR_1.0");
+
+ #ifdef HAVE_VISIBILITY_ATTRIBUTE
+ # pragma GCC visibility pop