summaryrefslogtreecommitdiff
path: root/sys-libs/libhugetlbfs
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs/libhugetlbfs')
-rw-r--r--sys-libs/libhugetlbfs/Manifest6
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-ino_t-fix.patch13
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-nonnull-fix.patch31
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-path-max-fix.patch22
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.23-musl-sc-level2-fix.patch45
-rw-r--r--sys-libs/libhugetlbfs/libhugetlbfs-2.23.ebuild4
6 files changed, 120 insertions, 1 deletions
diff --git a/sys-libs/libhugetlbfs/Manifest b/sys-libs/libhugetlbfs/Manifest
index e6bdd0d21958..efe3b3b58a17 100644
--- a/sys-libs/libhugetlbfs/Manifest
+++ b/sys-libs/libhugetlbfs/Manifest
@@ -1,6 +1,10 @@
AUX libhugetlbfs-2.23-allow-building-against-glibc-2.34.patch 10055 BLAKE2B 38b3c28321bdaa5271d8655823ea00952ca8571c84bfe9ec980a35ad7ad77e382ac9235c058597628cc574e03ce0dadbe19bab298c30763e03508aff01275e4b SHA512 abfcfdd87cf7c17663ba466c46182ac04aac454bcedc55a5032bd142419388daa8b0ca0a885f3aedfc830bbd2c58dfd15c4a3499a6fb26df679d8cbe87bf2143
+AUX libhugetlbfs-2.23-musl-ino_t-fix.patch 298 BLAKE2B cefafb44877d41e1255854dfb5fe4e8d0a5bc162f8de72541fd54a8b2caa3593a26e27515605a072afbae573432d797cd9a16d1db9796aea1678b7e4bf5df34e SHA512 65ed971be4c1646c7fd34c16ee7ba36066fb35298f91ceb53122c53c94cfda13de7ebcdf464cba393b50cf77b243ecc5ec136399ba7ab286ecb5e0f9ffc4b819
+AUX libhugetlbfs-2.23-musl-nonnull-fix.patch 935 BLAKE2B 7a3c13e24ed9e8b86f5e37db10313a7b67fd65b6bd328f304fad3f7b86f86fc66fab8b418ddade7d1f60327d4caf110fbeefb9254b1a75ca6c8e1043e5594578 SHA512 66b96b60bebfc7ad13bc1646868eb5dd447aae8922513d126a8775ccc24a19b3f0e25c986e34b52de7b48fd19278db50af116aec78517ece47189f4f8f6c89bf
+AUX libhugetlbfs-2.23-musl-path-max-fix.patch 462 BLAKE2B 79247f6e2cb50b43ccb54f3434e7ebea696f00743f2ab1f70ea172a1c97f15c7110ef0cf46c57ec9fef6c51b1fd38ebf122284d0622d86d2de8e2c3708934bc6 SHA512 be71e9aebe25fcef59c1ac0935fdc25771c5d153ddee4b9749275e4e0eb0f9967f59030aab0f2e9a2a5dcfce2fc1edf3ead5403cc8501adbbb4f79df1e8ee66b
+AUX libhugetlbfs-2.23-musl-sc-level2-fix.patch 1618 BLAKE2B 0d21d5b08c11bdb54fab5bd67b924b6a8277204868f3b4ab833f3cf877ca9e26c588768d2f05a7159a2df1246693761e8f35a22419897c9d9adbf74c804b0556 SHA512 4c2dfcdd35afc49b39284d58b7e1c3f2f4f618930d905e48c0ad6e276343dcdfad383120538a759996e7188406c263cf2666d8cba99556f4d7bb208eb2ffc230
AUX libhugetlbfs-2.23-uncompressed-man-pages.patch 1515 BLAKE2B b43415a3059f1071f0fc04ec834cd51d87a8bd93f2df6b428a33296b1b55745f23861415a463d5899b12699c5f4a3e5bdd837a8ec2894d1fc89039924330d77d SHA512 ea3ef19a688866676315af59422233681a41338fd049cfa50ed91f660f0baf1950ba056b9fcd540e6694b8ec348c0d1fbb3aa6b8c1840e22a77634e26555c9bc
AUX libhugetlbfs-2.6-fixup-testsuite.patch 1231 BLAKE2B e49ac448b4ac17a6ce9c32543e3ad7391bc8525e147d7a5100ef7ae15e4b0cf48b58ff1fe62d9a0fa61f142b7b8366228974c6628999edaa61d96114371bc09d SHA512 af9ee541ac4a30260e17baab1616cee13fdcc679ae3fdceed29ca6282c12a6b60d24b04bb61e3aa5f42092e017eb3bae59a56fd2b03954e40803f9f6f2cc4f80
DIST libhugetlbfs-2.23.tar.gz 175459 BLAKE2B f469ff9a65364e9f0e04c11c8010c958855ebd4d50e1dd719576cda7c280586623404304be64a794907a5fb1d97bd9c0620a91d7a2492577e04fa40ff432b4c7 SHA512 fc9a7d59bcda9d3ca9c9e43a3a348f989c9cbdbbb77f21a43a06e71eacd05bbe5a7b2b51e20ae9ea00da9f1c4d1130da529bbfb702e8c9d11cab6efadd3dc168
-EBUILD libhugetlbfs-2.23.ebuild 4293 BLAKE2B a1edf8c116019a3f81046da2ca28abe1c1f259fd30a9e6b41de30d609269fe27da04d72cf3745836629d9cd3bef29b873557e9c7c007cd554a8521c954a83535 SHA512 a8aa2b21a94a82de90b229718835bde4791ccbef657749a11297e9b210784032aff2d2159b6439276c4691fb1d48a5d5daeda8d07a04fafa127a4ca9c7f8db9b
+EBUILD libhugetlbfs-2.23.ebuild 4490 BLAKE2B 3d34eb4f365f2543e50227ad6be234ba5c2a6f1d069f918d482eff9b8686f45aa8a641b01bf3ee5b1f4afece437c1d3b6668367647b27ffd9cdbbb44a037ae98 SHA512 c0704b28104518edded5af1246281e5873f6e0cd492c79d20c999de601a67196d179090dfae16aa590086fc982a2853cf38e118a7c44d73a334237b9274e06f3
MISC metadata.xml 397 BLAKE2B 7b521a2822a494f6a2b7a85420a38edd396ca0e3856faeb682378c48eda3d1932788af7ac7bbb4e07cae37b2119afd386f75c5dc0ab1f69c8e4630be16cc549e SHA512 96065769a7893c1e05bc3ab9396eb01a60a293dac9b090419087a9bb5a152b2f291a950e8217ffcb7bed34262a5369119da469e22cc3171fdc0ad2b87ae6d698
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() {