* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libhugetlbfs/files/, sys-libs/libhugetlbfs/
@ 2018-09-19 9:36 Lars Wendler
0 siblings, 0 replies; 3+ messages in thread
From: Lars Wendler @ 2018-09-19 9:36 UTC (permalink / raw
To: gentoo-commits
commit: c2625f810fa8b7c7ec3b51792a19c0608f5ef9b6
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 19 09:36:50 2018 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Sep 19 09:36:50 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2625f81
sys-libs/libhugetlbfs: Removed old.
Package-Manager: Portage-2.3.49, Repoman-2.3.10
sys-libs/libhugetlbfs/Manifest | 2 -
.../files/libhugetlbfs-2.6-noexec-stack.patch | 44 ------
sys-libs/libhugetlbfs/libhugetlbfs-2.18.ebuild | 146 ------------------
sys-libs/libhugetlbfs/libhugetlbfs-2.19-r1.ebuild | 164 ---------------------
sys-libs/libhugetlbfs/libhugetlbfs-2.19.ebuild | 148 -------------------
5 files changed, 504 deletions(-)
diff --git a/sys-libs/libhugetlbfs/Manifest b/sys-libs/libhugetlbfs/Manifest
index 2d7527a8693..580068e6d38 100644
--- a/sys-libs/libhugetlbfs/Manifest
+++ b/sys-libs/libhugetlbfs/Manifest
@@ -1,4 +1,2 @@
-DIST libhugetlbfs-2.18.tar.gz 181275 BLAKE2B 1f0ca8d73d9bdf05eb08706be4854f110b8cbe5b0c7554fdddb437fc9644e69d0bc42d9d8bedf23bf2dda4901977f093d0f46ed039304f8b5184b2fcac157d47 SHA512 6dcdbf571d6a723a40c15e10b24533f16d65f67fe149aa2d25bee48a034d003419d4cf4b6e55fcd385e1214fc4f6b4dda72ba429b9eea9b38be9b1a393528746
-DIST libhugetlbfs-2.19.tar.gz 181504 BLAKE2B 27d5e5729e48b82311d6f4317f8c0bb5a04054242bca6fd9745265e2590f18ec49de6a9cdfa7ea28be47f794e91e70c5fcecdb418bf8e8cb0cb5b78d0948e563 SHA512 d21781fe68736eb3bbafeb8f36f4f34d30f290f2f6744b52c1a40161caf2e28b823cd8e9b9c74ec4e6d11f7d398d909f80eb736cc39a64ecc7bf571018bfec7c
DIST libhugetlbfs-2.20.tar.gz 186750 BLAKE2B 758482a41254d6d14795efdfb2959248af2ff00bc6cafbae9b2002b7eaa50921a72ef928910bc0d2061a414e9c73346848eead108af077c96429870c734495aa SHA512 817fca3f8e3b127b9b877e0a03d0a94bf0c3ec481d3becf995986ce6ae0532629c5460100eb9f2ef3452ed59a3b9d3ac8362df8f87b387803c36d35ab7af0902
DIST libhugetlbfs-2.21.tar.gz 173052 BLAKE2B a65fdeee3ed9ad8cb69f772847646befbf5deef0b82d6cb7338e5ff448d5c2461ceb1e381b9515e79f4243482589bb0203874cc52e5c8c6d98667df4eacffa8b SHA512 87fd95a826bedc2c53b1aa440f5db7ff3ece482d520545b597d4d1231cf84276103c312899b812166872444331bc7b6f1692f0d3b7cbff691efdcf9c2e99b1d0
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-noexec-stack.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-noexec-stack.patch
deleted file mode 100644
index bf964cda7a6..00000000000
--- a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-noexec-stack.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff -Nuar libhugetlbfs-2.6.orig/sys-elf32ppclinux.S libhugetlbfs-2.6/sys-elf32ppclinux.S
---- libhugetlbfs-2.6.orig/sys-elf32ppclinux.S 2009-08-24 12:56:07.000000000 +0000
-+++ libhugetlbfs-2.6/sys-elf32ppclinux.S 2009-10-31 06:43:49.040319417 +0000
-@@ -32,3 +32,7 @@
- mr 8,9
- sc
- blr
-+
-+#if defined(__linux__) && defined(__ELF__)
-+ .section .note.GNU-stack,"",%progbits
-+#endif
-diff -Nuar libhugetlbfs-2.6.orig/sys-elf64ppc.S libhugetlbfs-2.6/sys-elf64ppc.S
---- libhugetlbfs-2.6.orig/sys-elf64ppc.S 2009-08-24 12:56:07.000000000 +0000
-+++ libhugetlbfs-2.6/sys-elf64ppc.S 2009-10-31 06:43:54.303652251 +0000
-@@ -41,3 +41,7 @@
- mr 8,9
- sc
- blr
-+
-+#if defined(__linux__) && defined(__ELF__)
-+ .section .note.GNU-stack,"",%progbits
-+#endif
-diff -Nuar libhugetlbfs-2.6.orig/sys-elf_i386.S libhugetlbfs-2.6/sys-elf_i386.S
---- libhugetlbfs-2.6.orig/sys-elf_i386.S 2009-08-24 12:56:07.000000000 +0000
-+++ libhugetlbfs-2.6/sys-elf_i386.S 2009-10-31 06:43:57.536975670 +0000
-@@ -40,3 +40,7 @@
- pop %edi
- pop %ebp
- ret
-+
-+#if defined(__linux__) && defined(__ELF__)
-+ .section .note.GNU-stack,"",%progbits
-+#endif
-diff -Nuar libhugetlbfs-2.6.orig/sys-elf_x86_64.S libhugetlbfs-2.6/sys-elf_x86_64.S
---- libhugetlbfs-2.6.orig/sys-elf_x86_64.S 2009-08-24 12:56:07.000000000 +0000
-+++ libhugetlbfs-2.6/sys-elf_x86_64.S 2009-10-31 06:44:26.943648847 +0000
-@@ -32,3 +32,7 @@
- mov 0x8(%rsp),%r9
- syscall
- retq
-+
-+#if defined(__linux__) && defined(__ELF__)
-+ .section .note.GNU-stack,"",%progbits
-+#endif
diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.18.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.18.ebuild
deleted file mode 100644
index 3725a9c4975..00000000000
--- a/sys-libs/libhugetlbfs/libhugetlbfs-2.18.ebuild
+++ /dev/null
@@ -1,146 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="4"
-
-inherit eutils multilib toolchain-funcs
-
-DESCRIPTION="easy hugepage access"
-HOMEPAGE="http://libhugetlbfs.sourceforge.net/"
-SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~ppc64 ~x86"
-IUSE="static-libs"
-
-src_prepare() {
- epatch "${FILESDIR}"/${PN}-2.9-build.patch #332517
- epatch "${FILESDIR}"/${PN}-2.6-noexec-stack.patch
- epatch "${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
- sed -i \
- -e '/^PREFIX/s:/local::' \
- -e '1iBUILDTYPE = NATIVEONLY' \
- -e '1iV = 1' \
- -e "/^LIB\(32\)/s:=.*:= $(get_libdir):" \
- -e '/^CC\(32\|64\)/s:=.*:= $(CC):' \
- Makefile
- if [ "$(get_libdir)" == "lib64" ]; then
- sed -i \
- -e "/^LIB\(32\)/s:=.*:= lib32:" \
- Makefile
- fi
-}
-
-src_compile() {
- tc-export AR
- emake CC="$(tc-getCC)" libs tools
-}
-
-src_install() {
- default
- use static-libs || rm -f "${D}"/usr/$(get_libdir)/*.a
- rm "${D}"/usr/bin/oprofile* || die
-}
-
-src_test_alloc_one() {
- hugeadm="$1"
- sign="$2"
- pagesize="$3"
- pagecount="$4"
- ${hugeadm} \
- --pool-pages-max ${pagesize}:${sign}${pagecount} \
- && \
- ${hugeadm} \
- --pool-pages-min ${pagesize}:${sign}${pagecount}
- return $?
-}
-
-# die is NOT allowed in this src_test block after the marked point, so that we
-# can clean up memory allocation. You'll leak at LEAST 64MiB per run otherwise.
-src_test() {
- [[ $UID -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite"
- einfo "Building testsuite"
- emake -j1 tests || die "Failed to build tests"
-
- hugeadm='obj/hugeadm'
- allocated=''
- rc=0
- # the testcases need 64MiB per pagesize.
- MIN_HUGEPAGE_RAM=$((64*1024*1024))
-
- einfo "Planning allocation"
- PAGESIZES="$(${hugeadm} --page-sizes-all)"
-
- # Need to do this before we can create the mountpoints.
- for pagesize in ${PAGESIZES} ; do
- # The kernel depends on the location :-(
- mkdir -p /var/lib/hugetlbfs/pagesize-${pagesize}
- addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
- done
- addwrite /proc/sys/vm/
- addwrite /proc/sys/kernel/shmall
- addwrite /proc/sys/kernel/shmmax
- addwrite /proc/sys/kernel/shmmni
-
- einfo "Checking HugeTLB mountpoints"
- ${hugeadm} --create-mounts || die "Failed to set up hugetlb mountpoints."
-
- # -----------------------------------------------------
- # --------- die is unsafe after this point. -----------
- # -----------------------------------------------------
-
- einfo "Starting allocation"
- for pagesize in ${PAGESIZES} ; do
- pagecount=$((${MIN_HUGEPAGE_RAM}/${pagesize}))
- einfo " ${pagecount} @ ${pagesize}"
- addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
- src_test_alloc_one "$hugeadm" "+" "${pagesize}" "${pagecount}"
- rc=$?
- if [[ $rc -eq 0 ]]; then
- allocated="${allocated} ${pagesize}:${pagecount}"
- else
- eerror "Failed to add ${pagecount} pages of size ${pagesize}"
- fi
- done
-
- einfo "Allocation status"
- ${hugeadm} --pool-list
-
- if [[ -n "${allocated}" ]]; then
- # All our allocations worked, so time to run.
- einfo "Starting tests"
- cd "${S}"/tests
- TESTOPTS="-t func"
- case $ARCH in
- amd64|ppc64)
- TESTOPTS="${TESTOPTS} -b 64"
- ;;
- x86)
- TESTOPTS="${TESTOPTS} -b 32"
- ;;
- esac
- # This needs a bit of work to give a nice exit code still.
- ./run_tests.py ${TESTOPTS}
- rc=$?
- else
- eerror "Failed to make HugeTLB allocations."
- rc=1
- fi
-
- einfo "Cleaning up memory"
- cd "${S}"
- # Cleanup memory allocation
- for alloc in ${allocated} ; do
- pagesize="${alloc/:*}"
- pagecount="${alloc/*:}"
- einfo " ${pagecount} @ ${pagesize}"
- src_test_alloc_one "$hugeadm" "-" "${pagesize}" "${pagecount}"
- done
-
- # ---------------------------------------------------------
- # --------- die is safe again after this point. -----------
- # ---------------------------------------------------------
-
- return $rc
-}
diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.19-r1.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.19-r1.ebuild
deleted file mode 100644
index 030f4c4f989..00000000000
--- a/sys-libs/libhugetlbfs/libhugetlbfs-2.19-r1.ebuild
+++ /dev/null
@@ -1,164 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python2_7 )
-
-inherit eutils multilib toolchain-funcs perl-functions python-any-r1
-
-DESCRIPTION="easy hugepage access"
-HOMEPAGE="https://github.com/libhugetlbfs/libhugetlbfs"
-SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
-# Switch to github tarball w/next release.
-#SRC_URI="https://github.com/libhugetlbfs/libhugetlbfs/archive/${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~ppc64 ~x86"
-IUSE="perl static-libs test"
-
-DEPEND="test? ( ${PYTHON_DEPS} )"
-RDEPEND="perl? ( dev-lang/perl:= )"
-
-src_prepare() {
- perl_set_version
-
- epatch "${FILESDIR}"/${PN}-2.9-build.patch #332517
- epatch "${FILESDIR}"/${PN}-2.6-noexec-stack.patch
- epatch "${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
- sed -i \
- -e '/^PREFIX/s:/local::' \
- -e '1iBUILDTYPE = NATIVEONLY' \
- -e '1iV = 1' \
- -e '/gzip.*MANDIR/d' \
- -e "/^LIB\(32\)/s:=.*:= $(get_libdir):" \
- -e '/^CC\(32\|64\)/s:=.*:= $(CC):' \
- -e "/^PMDIR = .*\/perl5\/TLBC/s::PMDIR = ${VENDOR_LIB}\/TLBC:" \
- Makefile || die "sed failed"
- if [ "$(get_libdir)" == "lib64" ]; then
- sed -i \
- -e "/^LIB\(32\)/s:=.*:= lib32:" \
- Makefile
- fi
-}
-
-src_compile() {
- tc-export AR
- emake CC="$(tc-getCC)" libs tools
-}
-
-src_install() {
- default
- use static-libs || rm -f "${ED}"/usr/$(get_libdir)/*.a
- rm "${ED}"/usr/bin/oprofile* || die
- if ! use perl ; then
- rm -r \
- "${ED}"/usr/bin/cpupcstat \
- "${ED}"/usr/share/man/man8/cpupcstat.8 \
- "${ED}/${VENDOR_LIB}" \
- || die
- fi
-}
-
-src_test_alloc_one() {
- hugeadm="$1"
- sign="$2"
- pagesize="$3"
- pagecount="$4"
- ${hugeadm} \
- --pool-pages-max ${pagesize}:${sign}${pagecount} \
- && \
- ${hugeadm} \
- --pool-pages-min ${pagesize}:${sign}${pagecount}
- return $?
-}
-
-# die is NOT allowed in this src_test block after the marked point, so that we
-# can clean up memory allocation. You'll leak at LEAST 64MiB per run otherwise.
-src_test() {
- [[ $UID -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite"
- einfo "Building testsuite"
- emake -j1 tests || die "Failed to build tests"
-
- hugeadm='obj/hugeadm'
- allocated=''
- rc=0
- # the testcases need 64MiB per pagesize.
- MIN_HUGEPAGE_RAM=$((64*1024*1024))
-
- einfo "Planning allocation"
- PAGESIZES="$(${hugeadm} --page-sizes-all)"
-
- # Need to do this before we can create the mountpoints.
- for pagesize in ${PAGESIZES} ; do
- # The kernel depends on the location :-(
- mkdir -p /var/lib/hugetlbfs/pagesize-${pagesize}
- addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
- done
- addwrite /proc/sys/vm/
- addwrite /proc/sys/kernel/shmall
- addwrite /proc/sys/kernel/shmmax
- addwrite /proc/sys/kernel/shmmni
-
- einfo "Checking HugeTLB mountpoints"
- ${hugeadm} --create-mounts || die "Failed to set up hugetlb mountpoints."
-
- # -----------------------------------------------------
- # --------- die is unsafe after this point. -----------
- # -----------------------------------------------------
-
- einfo "Starting allocation"
- for pagesize in ${PAGESIZES} ; do
- pagecount=$((${MIN_HUGEPAGE_RAM}/${pagesize}))
- einfo " ${pagecount} @ ${pagesize}"
- addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
- src_test_alloc_one "$hugeadm" "+" "${pagesize}" "${pagecount}"
- rc=$?
- if [[ $rc -eq 0 ]]; then
- allocated="${allocated} ${pagesize}:${pagecount}"
- else
- eerror "Failed to add ${pagecount} pages of size ${pagesize}"
- fi
- done
-
- einfo "Allocation status"
- ${hugeadm} --pool-list
-
- if [[ -n "${allocated}" ]]; then
- # All our allocations worked, so time to run.
- einfo "Starting tests"
- cd "${S}"/tests
- TESTOPTS="-t func"
- case $ARCH in
- amd64|ppc64)
- TESTOPTS="${TESTOPTS} -b 64"
- ;;
- x86)
- TESTOPTS="${TESTOPTS} -b 32"
- ;;
- esac
- # This needs a bit of work to give a nice exit code still.
- ./run_tests.py ${TESTOPTS}
- rc=$?
- else
- eerror "Failed to make HugeTLB allocations."
- rc=1
- fi
-
- einfo "Cleaning up memory"
- cd "${S}"
- # Cleanup memory allocation
- for alloc in ${allocated} ; do
- pagesize="${alloc/:*}"
- pagecount="${alloc/*:}"
- einfo " ${pagecount} @ ${pagesize}"
- src_test_alloc_one "$hugeadm" "-" "${pagesize}" "${pagecount}"
- done
-
- # ---------------------------------------------------------
- # --------- die is safe again after this point. -----------
- # ---------------------------------------------------------
-
- return $rc
-}
diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.19.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.19.ebuild
deleted file mode 100644
index 07b65a2775a..00000000000
--- a/sys-libs/libhugetlbfs/libhugetlbfs-2.19.ebuild
+++ /dev/null
@@ -1,148 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="4"
-
-inherit eutils multilib toolchain-funcs
-
-DESCRIPTION="easy hugepage access"
-HOMEPAGE="https://github.com/libhugetlbfs/libhugetlbfs"
-SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
-# Switch to github tarball w/next release.
-#SRC_URI="https://github.com/libhugetlbfs/libhugetlbfs/archive/${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~ppc64 ~x86"
-IUSE="static-libs"
-
-src_prepare() {
- epatch "${FILESDIR}"/${PN}-2.9-build.patch #332517
- epatch "${FILESDIR}"/${PN}-2.6-noexec-stack.patch
- epatch "${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
- sed -i \
- -e '/^PREFIX/s:/local::' \
- -e '1iBUILDTYPE = NATIVEONLY' \
- -e '1iV = 1' \
- -e "/^LIB\(32\)/s:=.*:= $(get_libdir):" \
- -e '/^CC\(32\|64\)/s:=.*:= $(CC):' \
- Makefile
- if [ "$(get_libdir)" == "lib64" ]; then
- sed -i \
- -e "/^LIB\(32\)/s:=.*:= lib32:" \
- Makefile
- fi
-}
-
-src_compile() {
- tc-export AR
- emake CC="$(tc-getCC)" libs tools
-}
-
-src_install() {
- default
- use static-libs || rm -f "${D}"/usr/$(get_libdir)/*.a
- rm "${D}"/usr/bin/oprofile* || die
-}
-
-src_test_alloc_one() {
- hugeadm="$1"
- sign="$2"
- pagesize="$3"
- pagecount="$4"
- ${hugeadm} \
- --pool-pages-max ${pagesize}:${sign}${pagecount} \
- && \
- ${hugeadm} \
- --pool-pages-min ${pagesize}:${sign}${pagecount}
- return $?
-}
-
-# die is NOT allowed in this src_test block after the marked point, so that we
-# can clean up memory allocation. You'll leak at LEAST 64MiB per run otherwise.
-src_test() {
- [[ $UID -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite"
- einfo "Building testsuite"
- emake -j1 tests || die "Failed to build tests"
-
- hugeadm='obj/hugeadm'
- allocated=''
- rc=0
- # the testcases need 64MiB per pagesize.
- MIN_HUGEPAGE_RAM=$((64*1024*1024))
-
- einfo "Planning allocation"
- PAGESIZES="$(${hugeadm} --page-sizes-all)"
-
- # Need to do this before we can create the mountpoints.
- for pagesize in ${PAGESIZES} ; do
- # The kernel depends on the location :-(
- mkdir -p /var/lib/hugetlbfs/pagesize-${pagesize}
- addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
- done
- addwrite /proc/sys/vm/
- addwrite /proc/sys/kernel/shmall
- addwrite /proc/sys/kernel/shmmax
- addwrite /proc/sys/kernel/shmmni
-
- einfo "Checking HugeTLB mountpoints"
- ${hugeadm} --create-mounts || die "Failed to set up hugetlb mountpoints."
-
- # -----------------------------------------------------
- # --------- die is unsafe after this point. -----------
- # -----------------------------------------------------
-
- einfo "Starting allocation"
- for pagesize in ${PAGESIZES} ; do
- pagecount=$((${MIN_HUGEPAGE_RAM}/${pagesize}))
- einfo " ${pagecount} @ ${pagesize}"
- addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
- src_test_alloc_one "$hugeadm" "+" "${pagesize}" "${pagecount}"
- rc=$?
- if [[ $rc -eq 0 ]]; then
- allocated="${allocated} ${pagesize}:${pagecount}"
- else
- eerror "Failed to add ${pagecount} pages of size ${pagesize}"
- fi
- done
-
- einfo "Allocation status"
- ${hugeadm} --pool-list
-
- if [[ -n "${allocated}" ]]; then
- # All our allocations worked, so time to run.
- einfo "Starting tests"
- cd "${S}"/tests
- TESTOPTS="-t func"
- case $ARCH in
- amd64|ppc64)
- TESTOPTS="${TESTOPTS} -b 64"
- ;;
- x86)
- TESTOPTS="${TESTOPTS} -b 32"
- ;;
- esac
- # This needs a bit of work to give a nice exit code still.
- ./run_tests.py ${TESTOPTS}
- rc=$?
- else
- eerror "Failed to make HugeTLB allocations."
- rc=1
- fi
-
- einfo "Cleaning up memory"
- cd "${S}"
- # Cleanup memory allocation
- for alloc in ${allocated} ; do
- pagesize="${alloc/:*}"
- pagecount="${alloc/*:}"
- einfo " ${pagecount} @ ${pagesize}"
- src_test_alloc_one "$hugeadm" "-" "${pagesize}" "${pagecount}"
- done
-
- # ---------------------------------------------------------
- # --------- die is safe again after this point. -----------
- # ---------------------------------------------------------
-
- return $rc
-}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libhugetlbfs/files/, sys-libs/libhugetlbfs/
@ 2021-11-18 13:59 Thomas Deutschmann
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Deutschmann @ 2021-11-18 13:59 UTC (permalink / raw
To: gentoo-commits
commit: ed5576e429fac992d5c039e5f2290cc2d5d8d6f4
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 18 13:59:38 2021 +0000
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Nov 18 13:59:48 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed5576e4
sys-libs/libhugetlbfs: allow building against glibc-2.34
Bug: https://bugs.gentoo.org/806079
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
...fs-2.23-allow-building-against-glibc-2.34.patch | 258 +++++++++++++++++++++
sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild | 1 +
2 files changed, 259 insertions(+)
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-allow-building-against-glibc-2.34.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-allow-building-against-glibc-2.34.patch
new file mode 100644
index 000000000000..68e121e240ab
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-allow-building-against-glibc-2.34.patch
@@ -0,0 +1,258 @@
+From 959d74fd0fbbff310943096e15024a84e8f5cba4 Mon Sep 17 00:00:00 2001
+From: Matheus Castanho <msc@linux.ibm.com>
+Date: Thu, 12 Aug 2021 16:38:46 -0300
+Subject: [PATCH] Disable hugepage-backed malloc if __morecore is not available
+
+Starting with glibc 2.32, __morecore hook has been marked as deprecated, and was
+completely removed on glibc 2.34, which causes an undefined symbol error during
+the build of libhugetlbfs.
+
+Greater changes are needed in order to keep providing the same functionality
+with future versions of glibc (see issue #52). Meanwhile, we can disable
+hugepage-backed malloc setup if __morecore is not available so users can at
+least keep using the other features provided by the library. Related tests are
+also conditionally disabled, and will show as SKIPPED if __morecore is not
+available.
+
+Tested on powerpc64le and x86_64 with glibc 2.34 and olders.
+
+Signed-off-by: Matheus Castanho <msc@linux.ibm.com>
+---
+ Makefile | 6 +++++
+ morecore.c | 8 ++++++
+ tests/run_tests.py | 67 +++++++++++++++++++++++++++++++++++++++-------
+ 3 files changed, 71 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 8b73523..35e53e7 100644
+--- a/Makefile
++++ b/Makefile
+@@ -192,6 +192,12 @@ endif
+ endif
+ endif
+
++# glibc 2.34 removed __morecore, so it may not be available with recent versions
++HAS_MORECORE := $(shell /bin/echo -e '\#include <malloc.h>\nvoid * morecore_exists() { return &__morecore; }' | $(CC) -c -xc -o /dev/null - &> /dev/null && /bin/echo yes || /bin/echo no)
++ifeq ($(HAS_MORECORE),yes)
++CFLAGS += -DHAS_MORECORE
++endif
++
+ HEADERDIR = $(PREFIX)/include
+ LIBDIR32 = $(PREFIX)/$(LIB32)
+ LIBDIR64 = $(PREFIX)/$(LIB64)
+diff --git a/morecore.c b/morecore.c
+index 6563bbd..405c566 100644
+--- a/morecore.c
++++ b/morecore.c
+@@ -33,6 +33,13 @@
+
+ #include "libhugetlbfs_internal.h"
+
++#ifndef HAS_MORECORE
++void hugetlbfs_setup_morecore(void)
++{
++ INFO("Not setting up morecore because it's not available (see issue #52).\n");
++}
++#else
++
+ static int heap_fd;
+
+ static void *heapbase;
+@@ -381,3 +388,4 @@ void hugetlbfs_setup_morecore(void)
+ * to mmap() if we run out of hugepages. */
+ mallopt(M_MMAP_MAX, 0);
+ }
++#endif /* HAS_MORECORE */
+diff --git a/tests/run_tests.py b/tests/run_tests.py
+index 018264d..871d04d 100755
+--- a/tests/run_tests.py
++++ b/tests/run_tests.py
+@@ -60,7 +60,7 @@ def snapshot_pool_state():
+ l.append((d, tuple(substate)))
+ return tuple(l)
+
+-def run_test_prog(bits, pagesize, cmd, **env):
++def run_test_prog(bits, pagesize, cmd, output='stdout', **env):
+ if paranoid_pool_check:
+ beforepool = snapshot_pool_state()
+ print("Pool state: %s" % str(beforepool))
+@@ -73,15 +73,17 @@ def run_test_prog(bits, pagesize, cmd, **env):
+ % (bits, bits, local_env.get("LD_LIBRARY_PATH", ""))
+ local_env["HUGETLB_DEFAULT_PAGE_SIZE"] = repr(pagesize)
+
++ popen_args = {'env' : local_env, output : subprocess.PIPE}
++
+ try:
+- p = subprocess.Popen(cmd, env=local_env, stdout=subprocess.PIPE)
++ p = subprocess.Popen(cmd, **popen_args)
+ rc = p.wait()
+ except KeyboardInterrupt:
+ # Abort and mark this a strange test result
+ return (None, "")
+ except OSError as e:
+ return (-e.errno, "")
+- out = p.stdout.read().decode().strip()
++ out = getattr(p, output).read().decode().strip()
+
+ if paranoid_pool_check:
+ afterpool = snapshot_pool_state()
+@@ -309,6 +311,33 @@ def check_linkhuge_tests():
+ okbits.add(bits)
+ return okbits
+
++def check_morecore_disabled():
++ """
++ Check if support for morecore is available.
++
++ Newer glibc versions (>= 2.34) removed the __morecore malloc hook, so tests
++ relying on that functionality will not work as expected, and should be
++ disabled.
++ """
++ global morecore_disabled, wordsizes, pagesizes
++
++ # Quick and dirty way to get a word and page size. Which one doesn't really
++ # matter in this case.
++ for wsz in wordsizes:
++ b = wsz
++ break
++ for psz in pagesizes:
++ p = psz
++ break
++
++ # Run an arbitrary program and check stderr for the "morecore disabled"
++ # message
++ (rc, out) = run_test_prog(b, p, "gethugepagesize", output='stderr',
++ HUGETLB_MORECORE="yes",
++ HUGETLB_VERBOSE="3")
++
++ morecore_disabled = "Not setting up morecore" in out
++
+ def print_cmd(pagesize, bits, cmd, env):
+ if env:
+ print(' '.join(['%s=%s' % (k, v) for k, v in env.items()]), end=" ")
+@@ -357,14 +386,17 @@ def skip_test(pagesize, bits, cmd, **env):
+ print_cmd(pagesize, bits, cmd, env)
+ print("SKIPPED")
+
+-def do_test(cmd, bits=None, **env):
++def do_test(cmd, bits=None, skip=False, **env):
+ """
+ Run a test case, testing each page size and each indicated word size.
+ """
+ if bits == None: bits = wordsizes
+ for p in pagesizes:
+ for b in (set(bits) & wordsizes_by_pagesize[p]):
+- run_test(p, b, cmd, **env)
++ if skip:
++ skip_test(p, b, cmd, **env)
++ else:
++ run_test(p, b, cmd, **env)
+
+ def do_test_with_rlimit(rtype, limit, cmd, bits=None, **env):
+ """
+@@ -375,7 +407,7 @@ def do_test_with_rlimit(rtype, limit, cmd, bits=None, **env):
+ do_test(cmd, bits, **env)
+ resource.setrlimit(rtype, oldlimit)
+
+-def do_test_with_pagesize(pagesize, cmd, bits=None, **env):
++def do_test_with_pagesize(pagesize, cmd, bits=None, skip=False, **env):
+ """
+ Run a test case, testing with a specified huge page size and
+ each indicated word size.
+@@ -383,7 +415,10 @@ def do_test_with_pagesize(pagesize, cmd, bits=None, **env):
+ if bits == None:
+ bits = wordsizes
+ for b in (set(bits) & wordsizes_by_pagesize[pagesize]):
+- run_test(pagesize, b, cmd, **env)
++ if skip:
++ skip_test(pagesize, b, cmd, **env)
++ else:
++ run_test(pagesize, b, cmd, **env)
+
+ def do_elflink_test(cmd, **env):
+ """
+@@ -533,7 +568,7 @@ def functional_tests():
+ """
+ Run the set of functional tests.
+ """
+- global linkhuge_wordsizes
++ global linkhuge_wordsizes, morecore_disabled
+
+ # Kernel background tests not requiring hugepage support
+ do_test("zero_filesize_segment")
+@@ -598,19 +633,24 @@ def functional_tests():
+ do_test("fork-cow")
+ do_test("direct")
+ do_test_with_pagesize(system_default_hpage_size, "malloc")
++
+ do_test_with_pagesize(system_default_hpage_size, "malloc",
++ skip=morecore_disabled,
+ LD_PRELOAD="libhugetlbfs.so",
+ HUGETLB_MORECORE="yes")
+ do_test_with_pagesize(system_default_hpage_size, "malloc",
++ skip=morecore_disabled,
+ LD_PRELOAD="libhugetlbfs.so",
+ HUGETLB_MORECORE="yes",
+ HUGETLB_RESTRICT_EXE="unknown:none")
+ do_test_with_pagesize(system_default_hpage_size, "malloc",
++ skip=morecore_disabled,
+ LD_PRELOAD="libhugetlbfs.so",
+ HUGETLB_MORECORE="yes",
+ HUGETLB_RESTRICT_EXE="unknown:malloc")
+ do_test_with_pagesize(system_default_hpage_size, "malloc_manysmall")
+ do_test_with_pagesize(system_default_hpage_size, "malloc_manysmall",
++ skip=morecore_disabled,
+ LD_PRELOAD="libhugetlbfs.so",
+ HUGETLB_MORECORE="yes")
+
+@@ -630,26 +670,32 @@ def functional_tests():
+ do_test_with_pagesize(system_default_hpage_size, "heapshrink",
+ GLIBC_TUNABLES="glibc.malloc.tcache_count=0",
+ LD_PRELOAD="libheapshrink.so")
++
+ do_test_with_pagesize(system_default_hpage_size, "heapshrink",
++ skip=morecore_disabled,
+ GLIBC_TUNABLES="glibc.malloc.tcache_count=0",
+ LD_PRELOAD="libhugetlbfs.so",
+ HUGETLB_MORECORE="yes")
+ do_test_with_pagesize(system_default_hpage_size, "heapshrink",
++ skip=morecore_disabled,
+ GLIBC_TUNABLES="glibc.malloc.tcache_count=0",
+ LD_PRELOAD="libhugetlbfs.so libheapshrink.so",
+ HUGETLB_MORECORE="yes")
+ do_test_with_pagesize(system_default_hpage_size, "heapshrink",
++ skip=morecore_disabled,
+ GLIBC_TUNABLES="glibc.malloc.tcache_count=0",
+ LD_PRELOAD="libheapshrink.so",
+ HUGETLB_MORECORE="yes",
+ HUGETLB_MORECORE_SHRINK="yes")
+ do_test_with_pagesize(system_default_hpage_size, "heapshrink",
++ skip=morecore_disabled,
+ GLIBC_TUNABLES="glibc.malloc.tcache_count=0",
+ LD_PRELOAD="libhugetlbfs.so libheapshrink.so",
+ HUGETLB_MORECORE="yes",
+ HUGETLB_MORECORE_SHRINK="yes")
+
+- do_test("heap-overflow", HUGETLB_VERBOSE="1", HUGETLB_MORECORE="yes")
++ do_test("heap-overflow", skip=morecore_disabled, HUGETLB_VERBOSE="1",
++ HUGETLB_MORECORE="yes")
+
+ # Run the remapping tests' up-front checks
+ linkhuge_wordsizes = check_linkhuge_tests()
+@@ -747,7 +793,7 @@ def print_help():
+
+ def main():
+ global wordsizes, pagesizes, dangerous, paranoid_pool_check, system_default_hpage_size
+- global custom_ldscripts
++ global custom_ldscripts, morecore_disabled
+ testsets = set()
+ env_override = {"QUIET_TEST": "1", "HUGETLBFS_MOUNTS": "",
+ "HUGETLB_ELFMAP": None, "HUGETLB_MORECORE": None}
+@@ -802,6 +848,7 @@ def main():
+ return 1
+
+ check_hugetlbfs_path()
++ check_morecore_disabled()
+
+ if "func" in testsets: functional_tests()
+ if "stress" in testsets: stress_tests()
diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild
index ce5da82ddfcd..c091b4a8c00b 100644
--- a/sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild
+++ b/sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild
@@ -22,6 +22,7 @@ BDEPEND="test? ( ${PYTHON_DEPS} )"
PATCHES=(
"${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
"${FILESDIR}"/${PN}-2.23-uncompressed-man-pages.patch
+ "${FILESDIR}"/${PN}-2.23-allow-building-against-glibc-2.34.patch
)
src_prepare() {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libhugetlbfs/files/, sys-libs/libhugetlbfs/
@ 2022-09-01 2:06 Sam James
0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2022-09-01 2:06 UTC (permalink / raw
To: gentoo-commits
commit: dbabd1516a53fa57ae0204216ae78741bd4928c9
Author: brahmajit das <listout <AT> protonmail <DOT> com>
AuthorDate: Sat Jul 23 18:47:48 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Sep 1 02:04:23 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dbabd151
sys-libs/libhugetlbfs: fix musl build errors
Fix _SC_LEVEL2_CACHE_LINESIZE undeclared and misc issues.
Patches for musl that mainly closes bug 828830, plus some other patches
for errors that come along 828830.
Closes: https://bugs.gentoo.org/828830
Closes: https://bugs.gentoo.org/832980
Signed-off-by: brahmajit das <listout <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/26539
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../files/libhugetlbfs-2.23-musl-ino_t-fix.patch | 13 +++++++
.../files/libhugetlbfs-2.23-musl-nonnull-fix.patch | 31 +++++++++++++++
.../libhugetlbfs-2.23-musl-path-max-fix.patch | 22 +++++++++++
.../libhugetlbfs-2.23-musl-sc-level2-fix.patch | 45 ++++++++++++++++++++++
sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild | 4 ++
5 files changed, 115 insertions(+)
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-ino_t-fix.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-ino_t-fix.patch
new file mode 100644
index 000000000000..f408f9fd6ac0
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-ino_t-fix.patch
@@ -0,0 +1,13 @@
+# Include dirent.h for ino_t
+# Fixes error: unknown typename 'ino_t'
+# Closes: https://bugs.gentoo.org/828830
+--- a/tests/hugetests.h
++++ b/tests/hugetests.h
+@@ -22,6 +22,7 @@
+
+ #include <errno.h>
+ #include <string.h>
++#include <dirent.h>
+ #include <unistd.h>
+
+ #include "libhugetlbfs_privutils.h"
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-nonnull-fix.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-nonnull-fix.patch
new file mode 100644
index 000000000000..5e3532e50877
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-nonnull-fix.patch
@@ -0,0 +1,31 @@
+# Use __nonnull only on glibc system
+# Closes: https://bugs.gentoo.org/832980
+--- a/shm.c
++++ b/shm.c
+@@ -35,6 +35,12 @@
+ #endif
+
+ #ifdef HAVE_SHMGET_SYSCALL
++
++/* define __THROW to avoid build issue when it's not available from the libc */
++#ifndef __THROW
++#define __THROW
++#endif
++
+ /*
+ * The calls to dlsym() and dlerror() in the shmget() wrapper below force
+ * a dependency on libdl.so. This does not work for static executables
+@@ -48,8 +54,13 @@
+ * system shmget() may be performed without worry as there is no dynamic
+ * call chain.
+ */
++#ifdef __GLIBC__
+ extern void *dlsym (void *__restrict __handle, __const char *__restrict __name)
+ __attribute__((weak)) __THROW __nonnull ((2));
++#else
++extern void *dlsym (void *__restrict __handle, __const char *__restrict __name)
++ __attribute__((weak)) __THROW __attribute__((nonnull((2))));
++#endif // __GLIBC__
+ extern char *dlerror (void) __attribute__((weak)) __THROW;
+
+
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-path-max-fix.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-path-max-fix.patch
new file mode 100644
index 000000000000..883bb3e98fc7
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-path-max-fix.patch
@@ -0,0 +1,22 @@
+# Include limits.h for PATH_MAX
+# Closes: https://bugs.gentoo.org/828830
+--- a/hugeadm.c
++++ b/hugeadm.c
+@@ -33,6 +33,7 @@
+ #include <grp.h>
+ #include <pwd.h>
+ #include <fcntl.h>
++#include <limits.h>
+
+ #include <sys/stat.h>
+ #include <sys/types.h>
+--- a/tests/gethugepagesizes.c
++++ b/tests/gethugepagesizes.c
+@@ -27,6 +27,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#include <limits.h>
+ #include <stdarg.h>
+ #include <hugetlbfs.h>
+
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-sc-level2-fix.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-sc-level2-fix.patch
new file mode 100644
index 000000000000..c42e017abec1
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-sc-level2-fix.patch
@@ -0,0 +1,45 @@
+# _SC_LEVEL2_CACHE_LINESIZE is most probably Glibc specific define. Hence we
+# cannot use it with other libc's. Check if _SC_LEVEL2_CACHE_LINESIZE is
+# available or use custom function to get CPU cache size
+# Original patch was found here [1]
+# [1]: https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-benchmark/libhugetlbfs/files/0003-alloc.c-Avoid-sysconf-_SC_LEVEL2_CACHE_LINESIZE-on-l.patch
+# Closes: https://bugs.gentoo.org/828830
+--- a/alloc.c
++++ b/alloc.c
+@@ -245,6 +245,24 @@ void free_huge_pages(void *ptr)
+ __free_huge_pages(ptr, 1);
+ }
+
++/*
++ * Avoid sysconf(_SC_LEVEL2_CACHE_LINESIZE) on linux
++ * Taken from the folling patch [1]
++ *
++ * [1]: https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-benchmark/libhugetlbfs/files/0003-alloc.c-Avoid-sysconf-_SC_LEVEL2_CACHE_LINESIZE-on-l.patch
++ */
++#if !defined(_SC_LEVEL2_CACHE_LINESIZE)
++static size_t get_cacheline_size() {
++ FILE * fp = fopen("/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size", "r");
++ unsigned int line_size = 0;
++ if (fp) {
++ fscanf(fp, "%d", &line_size);
++ fclose(fp);
++ }
++ return line_size;
++}
++#endif
++
+ /*
+ * Offset the buffer using bytes wasted due to alignment to avoid using the
+ * same cache lines for the start of every buffer returned by
+@@ -261,7 +279,11 @@ void *cachecolor(void *buf, size_t len, size_t color_bytes)
+
+ /* Lookup our cacheline size once */
+ if (cacheline_size == 0) {
++#if defined(_SC_LEVEL2_CACHE_LINESIZE)
+ cacheline_size = sysconf(_SC_LEVEL2_CACHE_LINESIZE);
++#else
++ cacheline_size = get_cacheline_size();
++#endif
+ linemod = time(NULL);
+ }
+
diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild
index 7702cc3283c3..c7a87ce891cd 100644
--- a/sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild
+++ b/sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild
@@ -23,6 +23,10 @@ PATCHES=(
"${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
"${FILESDIR}"/${PN}-2.23-uncompressed-man-pages.patch
"${FILESDIR}"/${PN}-2.23-allow-building-against-glibc-2.34.patch
+ "${FILESDIR}"/${PN}-2.23-musl-sc-level2-fix.patch
+ "${FILESDIR}"/${PN}-2.23-musl-path-max-fix.patch
+ "${FILESDIR}"/${PN}-2.23-musl-nonnull-fix.patch
+ "${FILESDIR}"/${PN}-2.23-musl-ino_t-fix.patch
)
src_prepare() {
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-01 2:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-19 9:36 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libhugetlbfs/files/, sys-libs/libhugetlbfs/ Lars Wendler
-- strict thread matches above, loose matches on Subject: below --
2021-11-18 13:59 Thomas Deutschmann
2022-09-01 2:06 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox