From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- .../files/numactl-2.0.10-numademo-cflags.patch | 15 ++++ .../numactl/files/numactl-2.0.11-sysmacros.patch | 41 +++++++++++ .../numactl/files/numactl-2.0.8-cpuid-pic.patch | 17 +++++ .../numactl/files/numactl-2.0.8-static_libs.patch | 86 ++++++++++++++++++++++ .../files/numactl-2.0.9-testsuite_fix.patch | 12 +++ .../files/numactl-2.0.9-testsuite_path.patch | 14 ++++ 6 files changed, 185 insertions(+) create mode 100644 sys-process/numactl/files/numactl-2.0.10-numademo-cflags.patch create mode 100644 sys-process/numactl/files/numactl-2.0.11-sysmacros.patch create mode 100644 sys-process/numactl/files/numactl-2.0.8-cpuid-pic.patch create mode 100644 sys-process/numactl/files/numactl-2.0.8-static_libs.patch create mode 100644 sys-process/numactl/files/numactl-2.0.9-testsuite_fix.patch create mode 100644 sys-process/numactl/files/numactl-2.0.9-testsuite_path.patch (limited to 'sys-process/numactl/files') diff --git a/sys-process/numactl/files/numactl-2.0.10-numademo-cflags.patch b/sys-process/numactl/files/numactl-2.0.10-numademo-cflags.patch new file mode 100644 index 000000000000..9b318df5a5ca --- /dev/null +++ b/sys-process/numactl/files/numactl-2.0.10-numademo-cflags.patch @@ -0,0 +1,15 @@ +https://bugs.gentoo.org/540856 + +respect user CFLAGS + +--- a/Makefile.am ++++ b/Makefile.am +@@ -23,7 +23,7 @@ numastat_CFLAGS = $(AM_CFLAGS) -std=gnu99 + + numademo_SOURCES = numademo.c stream_lib.c stream_lib.h mt.c mt.h clearcache.c clearcache.h + numademo_CPPFLAGS = $(AM_CPPFLAGS) -DHAVE_STREAM_LIB -DHAVE_MT -DHAVE_CLEAR_CACHE +-numademo_CFLAGS = -O3 -ffast-math -funroll-loops ++numademo_CFLAGS = $(AM_CFLAGS) -ffast-math -funroll-loops + if HAVE_TREE_VECTORIZE + numademo_CFLAGS += -ftree-vectorize + endif diff --git a/sys-process/numactl/files/numactl-2.0.11-sysmacros.patch b/sys-process/numactl/files/numactl-2.0.11-sysmacros.patch new file mode 100644 index 000000000000..3f9536757391 --- /dev/null +++ b/sys-process/numactl/files/numactl-2.0.11-sysmacros.patch @@ -0,0 +1,41 @@ +https://bugs.gentoo.org/580098 + +From c1644f92e340d797e490c41a9ef9961125d202b9 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Mon, 18 Apr 2016 18:49:51 -0400 +Subject: [PATCH] include sys/sysmacros.h for major/minor + +These functions are not part of any official spec, and glibc has always +kept them in sys/sysmacros.h. As glibc moves to conform to POSIX, and +more alternative C libraries come up, we need to include this header +explicitly to get the prototypes. Otherwise we fail to build like: + +affinity.c: In function 'affinity_file': +affinity.c:177:7: warning: implicit declaration of function 'major' [-Wimplicit-function-declaration] + if (major(d) != maj || minor(d) != min) + ^ +affinity.c:177:26: warning: implicit declaration of function 'minor' [-Wimplicit-function-declaration] + if (major(d) != maj || minor(d) != min) + ^ +./.libs/libnuma.so: undefined reference to 'minor' +./.libs/libnuma.so: undefined reference to 'major' +collect2: error: ld returned 1 exit status +--- + affinity.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/affinity.c b/affinity.c +index 9fbd6af..984291c 100644 +--- a/affinity.c ++++ b/affinity.c +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + #include + #include + #include +-- +2.7.4 + diff --git a/sys-process/numactl/files/numactl-2.0.8-cpuid-pic.patch b/sys-process/numactl/files/numactl-2.0.8-cpuid-pic.patch new file mode 100644 index 000000000000..02e84b725772 --- /dev/null +++ b/sys-process/numactl/files/numactl-2.0.8-cpuid-pic.patch @@ -0,0 +1,17 @@ +make the code work on x86/PIC. this code is only used in the demo, +and the overhead of always running this is system noise, so don't +bother bracketing with __i386__/__PIC__ defines. + +http://bugs.gentoo.org/456238 + +--- a/clearcache.c ++++ b/clearcache.c +@@ -57,7 +57,7 @@ void clearcache(unsigned char *mem, unsigned size) + #if defined(__i386__) || defined(__x86_64__) + unsigned i, cl, eax, feat; + /* get clflush unit and feature */ +- asm("cpuid" : "=a" (eax), "=b" (cl), "=d" (feat) : "0" (1) : "cx"); ++ asm("xchg %%ebx, %%esi; cpuid; xchg %%esi, %%ebx;" : "=a" (eax), "=S" (cl), "=d" (feat) : "0" (1) : "cx"); + if (!(feat & (1 << 19))) + fallback_clearcache(); + cl = ((cl >> 8) & 0xff) * 8; diff --git a/sys-process/numactl/files/numactl-2.0.8-static_libs.patch b/sys-process/numactl/files/numactl-2.0.8-static_libs.patch new file mode 100644 index 000000000000..efb84ff6240a --- /dev/null +++ b/sys-process/numactl/files/numactl-2.0.8-static_libs.patch @@ -0,0 +1,86 @@ +Build static libs without -fPIC and only if BUILD_STATIC=yes + +https://bugs.gentoo.org/379849 + +Patch written by Kacper Kowalik +--- a/Makefile ++++ b/Makefile +@@ -7,6 +7,8 @@ + # for compatibility with old releases + CFLAGS += ${OPT_CFLAGS} + override CFLAGS += -I. ++# build static libraries by default ++BUILD_STATIC ?= yes + + # find out if compiler supports __thread + THREAD_SUPPORT := $(shell if $(CC) $(CFLAGS) threadtest.c -o threadtest \ +@@ -24,6 +26,7 @@ + + CLEANFILES := numactl.o libnuma.o numactl numademo numademo.o distance.o \ + memhog libnuma.so libnuma.so.1 numamon numamon.o syscall.o bitops.o \ ++ distance.pic.o libnuma.pic.o syscall.pic.o \ + memhog.o util.o stream_main.o stream_lib.o shm.o stream clearcache.o \ + test/pagesize test/tshared test/mynode.o test/tshared.o mt.o empty.o empty.c \ + test/mynode test/ftok test/prefered test/randmap \ +@@ -40,11 +43,16 @@ + libdir := ${prefix}/$(shell ./getlibdir) + docdir := ${prefix}/share/doc + ++NUMA_LIBS = libnuma.so ++ifeq ($(BUILD_STATIC),yes) ++NUMA_LIBS+= libnuma.a ++endif ++ + all: numactl migratepages migspeed libnuma.so numademo numamon memhog \ + test/tshared stream test/mynode test/pagesize test/ftok test/prefered \ + test/randmap test/nodemap test/distance test/tbitmap test/move_pages \ + test/mbind_mig_pages test/migrate_pages test/realloc_test libnuma.a \ +- test/node-parse numastat ++ test/node-parse numastat ${NUMA_LIBS} + + numactl: numactl.o util.o shm.o bitops.o libnuma.so + +@@ -81,13 +89,14 @@ + + libnuma.so.1: versions.ldscript + +-libnuma.so.1: libnuma.o syscall.o distance.o affinity.o sysfs.o rtnetlink.o ++libnuma.so.1: libnuma.pic.o syscall.pic.o distance.pic.o affinity.pic.o sysfs.pic.o rtnetlink.pic.o + ${CC} ${LDFLAGS} -shared -Wl,-soname=libnuma.so.1 -Wl,--version-script,versions.ldscript -Wl,-init,numa_init -Wl,-fini,numa_fini -o libnuma.so.1 $(filter-out versions.ldscript,$^) + + libnuma.so: libnuma.so.1 + ln -sf libnuma.so.1 libnuma.so + +-libnuma.o : CFLAGS += -fPIC ++%.pic.o: %.c ++ ${CC} -fPIC ${CPPFLAGS} ${CFLAGS} -c $< -o $@ + + AR ?= ar + RANLIB ?= ranlib +@@ -95,16 +104,6 @@ + $(AR) rc $@ $^ + $(RANLIB) $@ + +-distance.o : CFLAGS += -fPIC +- +-syscall.o : CFLAGS += -fPIC +- +-affinity.o : CFLAGS += -fPIC +- +-sysfs.o : CFLAGS += -fPIC +- +-rtnetlink.o : CFLAGS += -fPIC +- + test/tshared: test/tshared.o libnuma.so + + test/mynode: test/mynode.o libnuma.so +@@ -143,7 +148,9 @@ + mkdir -p ${libdir} + install -m 0755 libnuma.so.1 ${libdir} + cd ${libdir} ; ln -sf libnuma.so.1 libnuma.so ++ifeq ($(BUILD_STATIC),yes) + install -m 0644 libnuma.a ${libdir} ++endif + mkdir -p ${prefix}/include + install -m 0644 numa.h numaif.h numacompat1.h ${prefix}/include + install -m 0755 numastat ${prefix}/bin diff --git a/sys-process/numactl/files/numactl-2.0.9-testsuite_fix.patch b/sys-process/numactl/files/numactl-2.0.9-testsuite_fix.patch new file mode 100644 index 000000000000..27a97fdf2509 --- /dev/null +++ b/sys-process/numactl/files/numactl-2.0.9-testsuite_fix.patch @@ -0,0 +1,12 @@ +Tests fail with /bin/dash + +Singned-off-by: Lars Wendler + +--- numactl-2.0.9/test/printcpu ++++ numactl-2.0.9/test/printcpu +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + #print cpu it is running on + declare -a arr + arr=( $(< /proc/self/stat) ) diff --git a/sys-process/numactl/files/numactl-2.0.9-testsuite_path.patch b/sys-process/numactl/files/numactl-2.0.9-testsuite_path.patch new file mode 100644 index 000000000000..018fc6dbcd18 --- /dev/null +++ b/sys-process/numactl/files/numactl-2.0.9-testsuite_path.patch @@ -0,0 +1,14 @@ +diff -Naur numactl-2.0.10-orig/test/bind_range numactl-2.0.10/test/bind_range +--- numactl-2.0.10-orig/test/bind_range 2015-05-03 22:23:31.095600314 -0400 ++++ numactl-2.0.10/test/bind_range 2015-05-03 22:25:29.107592557 -0400 +@@ -93,8 +93,8 @@ + + HIGHESTCPU=$(grep 'processor' /proc/cpuinfo | tail -n1 | cut -f2 -d':') + HIGHESTCPU=$(echo $HIGHESTCPU | cut -f2 -d' ') +-HIGHESTNODE=$(numactl -H | grep -e 'node [0-9]* cpus' | tail -n1 | cut -f2 -d' ') +-LOWESTNODE=$(numactl -H | grep -e 'node [0-9]* cpus' | head -n1 | cut -f2 -d' ') ++HIGHESTNODE=$(../numactl -H | grep -e 'node [0-9]* cpus' | tail -n1 | cut -f2 -d' ') ++LOWESTNODE=$(../numactl -H | grep -e 'node [0-9]* cpus' | head -n1 | cut -f2 -d' ') + + get_mask + -- cgit v1.2.3