From bd8ca999980e9c0c9ae40a11789c858bb58769e3 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 15 Jul 2022 13:42:19 +0100 Subject: gentoo auto-resync : 15:07:2022 - 13:42:19 --- dev-util/Manifest.gz | Bin 67808 -> 67798 bytes dev-util/bsdiff/Manifest | 2 +- dev-util/bsdiff/bsdiff-4.3-r4.ebuild | 16 +- dev-util/rt-tests/Manifest | 6 +- dev-util/rt-tests/files/rt-tests-2.3-musl.patch | 352 ------------------------ dev-util/rt-tests/files/rt-tests-2.4-musl.patch | 341 +++++++++++++++++++++++ dev-util/rt-tests/rt-tests-2.3.ebuild | 38 --- dev-util/rt-tests/rt-tests-2.4.ebuild | 38 +++ 8 files changed, 390 insertions(+), 403 deletions(-) delete mode 100644 dev-util/rt-tests/files/rt-tests-2.3-musl.patch create mode 100644 dev-util/rt-tests/files/rt-tests-2.4-musl.patch delete mode 100644 dev-util/rt-tests/rt-tests-2.3.ebuild create mode 100644 dev-util/rt-tests/rt-tests-2.4.ebuild (limited to 'dev-util') diff --git a/dev-util/Manifest.gz b/dev-util/Manifest.gz index 1bffbd14657f..632e6cf2d1a0 100644 Binary files a/dev-util/Manifest.gz and b/dev-util/Manifest.gz differ diff --git a/dev-util/bsdiff/Manifest b/dev-util/bsdiff/Manifest index bb2938cf7d29..a8af2ff14c3e 100644 --- a/dev-util/bsdiff/Manifest +++ b/dev-util/bsdiff/Manifest @@ -1,4 +1,4 @@ AUX bsdiff-4.3-CVE-2014-9862.patch 304 BLAKE2B bf972f29b3ff36dad2fd656ddb9047ec0ef2b20d4d84f2e983d67478f471d1dcc82e6f577525549b7655c0f3608500dab172a39bced5cd4173fd83e05034bc22 SHA512 940c2cafc14e85a2cdd7f95d17de68f3a9d3e80828fcc302936e16a32733aa4a60d3ddb8fc9760e2fbd1fa626398669ef991688b26c23e8ff5c7e8d2612672ef DIST bsdiff-4.3.tar.gz 5740 BLAKE2B 869b957fac9de5977216b82ae46f5a291af4f64e8f4199b129b5e9963385e8f23d8593c307ddf953001fc54446ba66a0c57f9f9a841854afc3d32aee26fffc4e SHA512 bde46b393b74bcc9f05532ea4d45b12c104c4f182fdd49d4176aad5f02a2b357f435819f13a5a7ddefe27df0ca82980f06fad764094014a6d068622263e319c3 -EBUILD bsdiff-4.3-r4.ebuild 877 BLAKE2B 9cc6a0989c62b4bcc6f8d1205b6f1fb0b7367c0143db53aa03f1dc575ae980966f3f9eea2444776306b62869770e0c928601359457ab32ace494a505abea94f4 SHA512 aec5380d82349b42ac618ee5f80382e1f2cf3f8983813b27cd78085f8fc6106da99042158084d6cba4f3898f800fcd9d236bc2ae7caa5b1501da24128971d0d5 +EBUILD bsdiff-4.3-r4.ebuild 795 BLAKE2B 8ce2ac49f770a0fa44398794b587ba267e5875d9117a28ff81bfc45dacae90f118b40b86c2617885cad308da746d96db3621903c3d5dff7f6933eef87d461294 SHA512 ec71689006c2cc5fb7ca52c35791dd0ab10ed23f0dae3a82f9ff4fbae557d69d694c4bda3c7e969f9f12a68de2db558dd2d41c790c9de51a8ac54e46aa2ff909 MISC metadata.xml 168 BLAKE2B 2e0e000b4c3b6ca04c12903fdbe278415c05a822623c52e9aa95cbbf3d50bcb1246b7edbda7d2f6b559af8950c6374e6e0a69b76319964cfe686bf50b0604a57 SHA512 4dcf45d1809e8390a2d8155c8ebfe0dd610203e392aeab0ccd8a10f42cc8532a4925eff32b35e7a6c35598a4efd288229034ec0732299dbd8cfa0acff705fed3 diff --git a/dev-util/bsdiff/bsdiff-4.3-r4.ebuild b/dev-util/bsdiff/bsdiff-4.3-r4.ebuild index 08e45256bd2b..6083dac804a6 100644 --- a/dev-util/bsdiff/bsdiff-4.3-r4.ebuild +++ b/dev-util/bsdiff/bsdiff-4.3-r4.ebuild @@ -1,32 +1,30 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit flag-o-matic toolchain-funcs +inherit edo flag-o-matic toolchain-funcs DESCRIPTION="bsdiff: Binary Differencer using a suffix alg" HOMEPAGE="https://www.daemonology.net/bsdiff/" SRC_URI="https://www.daemonology.net/bsdiff/${P}.tar.gz" -SLOT="0" LICENSE="BSD-2" +SLOT="0" KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ppc sparc x86 ~amd64-linux ~x86-linux ~ppc-macos" RDEPEND="app-arch/bzip2" +DEPEND="${RDEPEND}" PATCHES=( "${FILESDIR}/${P}-CVE-2014-9862.patch" ) src_compile() { - doecho() { - echo "$@" - "$@" - } append-lfs-flags - doecho $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -o bsdiff bsdiff.c -lbz2 || die "failed compiling bsdiff" - doecho $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -o bspatch bspatch.c -lbz2 || die "failed compiling bspatch" + + edo $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -o bsdiff bsdiff.c -lbz2 + edo $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -o bspatch bspatch.c -lbz2 } src_install() { diff --git a/dev-util/rt-tests/Manifest b/dev-util/rt-tests/Manifest index 303578bdeb02..034c035762cc 100644 --- a/dev-util/rt-tests/Manifest +++ b/dev-util/rt-tests/Manifest @@ -1,4 +1,4 @@ -AUX rt-tests-2.3-musl.patch 9602 BLAKE2B 04b537cba7f1de60fa64683b313381304c5ca5b69c451097cf08c84c7dd18321e5b5bfa13a76ae5515bf194c808c017d92232a857725a197049a40b4e9ef7799 SHA512 9367dd015e9a6ee3ba054d89d28d4130fce94b26074434f781553bf5769069e12283d585a10e4777a6eeec39b829a4edcb7d9da7dede00c280eb643c7b3fec31 -DIST rt-tests-2.3.tar.xz 115000 BLAKE2B d5f6a31a31340873348b5ffa6c706deb080e9686944a759fa4e4d53f2041d3f27aa1e9512d7413438bce7c61e05e2495c96eeef0b976ee09377f89d847225aef SHA512 3bf6fe95c5ac9911fb51fba1d4a8e6ad3b96a6cdce464372917673862801353cbbb377c76d3a19325f0b5402f65daf5c605e496d7460949615069366a00a978a -EBUILD rt-tests-2.3.ebuild 921 BLAKE2B 0dc4ba32df8d2b74077ba45e240a612eae58edf55d79b4ef17a2cd29c2c15a189c47cff27327d486da2250b71d1de00a4285b62d360c9d010138eb2ed7f931fe SHA512 bf4e3e11a31fdf28612b99d68b4fcf30dd77146fa7e2375c9ed780706a293fb28c9908b511bfb79213db336365224dbb2154f0802a92d603ac9463bf78a229af +AUX rt-tests-2.4-musl.patch 9390 BLAKE2B 08844f79e506620bb38467be940757c34c4a125697eac329053e60d5f44b550bb6fbf849d58bda68cbec85e285a17365de0e5a88bd73f78473d386df5a62d47d SHA512 c286901c4ecd847882ecf53ef2a3ea60099b38c9dfb5baebc55f64d4025c24334cf169a23003503deb5b859c49f280c3ccbd24e5fddcb857608ad6cf451cdeee +DIST rt-tests-2.4.tar.xz 104172 BLAKE2B bd7ac3ff64171b122341eec81ac61dcda429d33d6a69362d498d5db667b8cb77502d745bc2f7ce03cc1e958d02889a902f65544c7fef994fb4d7e72230c73e10 SHA512 308207ad620ee458e4ac000a9437266a84f4807d9cecd8030d5ae12a210c2a01f80a331bb60faeb41244d7ab80b3cadf8164711547a02f5afa353d1a3644d794 +EBUILD rt-tests-2.4.ebuild 915 BLAKE2B d09ad7ce907e3794aa0d304c8c99a6e97d81c024d920cd856d1fadde5ca006e77647d10d41357a8dfacaebee1bd7e11b7cfb21908efffb6a0aade343de53b7bd SHA512 e56bd29d25d4bf7f976541267091e0c337cb268029bd5b93c645c13e7b2c18cba6cb3578ee714bbe49ae281bc51156b127ad80e2c66a34ad9f948aa705c5fb4e MISC metadata.xml 749 BLAKE2B b0072755603e59495f6a9cb82885dd8c882e394c90be750293026948b3f66010c6cd0ab77af16d41a552a1117dbb92886f3afa44b9c9b0b9a6bc7793ab6e7700 SHA512 edcbee69b86ff91ea64a1e60bf7a4329805eaf48337370dba6c3f737c2e459e3c7fa6b6365261a0cb8f5604f5b22d1a7b08f0b8cbba0f0fb44e9623865eff522 diff --git a/dev-util/rt-tests/files/rt-tests-2.3-musl.patch b/dev-util/rt-tests/files/rt-tests-2.3-musl.patch deleted file mode 100644 index 6732521a07a6..000000000000 --- a/dev-util/rt-tests/files/rt-tests-2.3-musl.patch +++ /dev/null @@ -1,352 +0,0 @@ -From 0b7a1e0d3463aa8aa4b7dcad0ec154e658d68036 Mon Sep 17 00:00:00 2001 -From: Kurt Kanzenbach -Date: Wed, 1 Apr 2020 20:15:24 +0200 -Subject: [PATCH] all: Fix musl build - -There are a few problems: - - * pi stress: pthread_attr_setaffinity_np() is not supported - * cyclictest: SIGEV_THREAD_ID is not supported - * hackbench: Fix include - * all: Fix sched_* calls - -With these changes applied, the rt-tests seem to run fine. - -Signed-off-by: Kurt Kanzenbach ---- - Makefile | 5 -- - src/backfire/sendme.c | 1 - src/cyclictest/cyclictest.c | 70 ++++------------------------------ - src/hackbench/hackbench.c | 4 + - src/include/musl.h | 28 +++++++++++++ - src/lib/rt-utils.c | 1 - src/pi_tests/classic_pi.c | 2 - src/pi_tests/tst-mutexpi10.c | 2 - src/pmqtest/pmqtest.c | 1 - src/ptsematest/ptsematest.c | 1 - src/rt-migrate-test/rt-migrate-test.c | 1 - src/sched_deadline/cyclicdeadline.c | 1 - 12 files changed, 50 insertions(+), 67 deletions(-) - create mode 100644 src/include/musl.h - ---- a/Makefile -+++ b/Makefile -@@ -7,7 +7,6 @@ OBJDIR = bld - sources = cyclictest.c \ - hackbench.c \ - pip_stress.c \ -- pi_stress.c \ - pmqtest.c \ - ptsematest.c \ - rt-migrate-test.c \ -@@ -42,7 +41,6 @@ ifeq (${PYLIB},) - endif - - MANPAGES = src/cyclictest/cyclictest.8 \ -- src/pi_tests/pi_stress.8 \ - src/ptsematest/ptsematest.8 \ - src/rt-migrate-test/rt-migrate-test.8 \ - src/sigwaittest/sigwaittest.8 \ -@@ -130,9 +128,6 @@ deadline_test: $(OBJDIR)/deadline_test.o - signaltest: $(OBJDIR)/signaltest.o $(OBJDIR)/librttest.a $(OBJDIR)/librttestnuma.a - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(RTTESTNUMA) - --pi_stress: $(OBJDIR)/pi_stress.o $(OBJDIR)/librttest.a -- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) -- - hwlatdetect: src/hwlatdetect/hwlatdetect.py - chmod +x src/hwlatdetect/hwlatdetect.py - ln -s src/hwlatdetect/hwlatdetect.py hwlatdetect ---- a/src/backfire/sendme.c -+++ b/src/backfire/sendme.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include "musl.h" - #include "rt-utils.h" - #include "rt-get_cpu.h" - ---- a/src/cyclictest/cyclictest.c -+++ b/src/cyclictest/cyclictest.c -@@ -33,6 +33,7 @@ - #include - #include - #include -+#include "musl.h" - #include "rt_numa.h" - - #include "rt-utils.h" -@@ -504,12 +505,8 @@ static void *timerthread(void *param) - { - struct thread_param *par = param; - struct sched_param schedp; -- struct sigevent sigev; - sigset_t sigset; -- timer_t timer; - struct timespec now, next, interval, stop = { 0 }; -- struct itimerval itimer; -- struct itimerspec tspec; - struct thread_stat *stat = par->stats; - int stopped = 0; - cpu_set_t mask; -@@ -538,14 +535,6 @@ static void *timerthread(void *param) - sigaddset(&sigset, par->signal); - sigprocmask(SIG_BLOCK, &sigset, NULL); - -- if (par->mode == MODE_CYCLIC) { -- sigev.sigev_notify = SIGEV_THREAD_ID | SIGEV_SIGNAL; -- sigev.sigev_signo = par->signal; -- sigev.sigev_notify_thread_id = stat->tid; -- timer_create(par->clock, &sigev, &timer); -- tspec.it_interval = interval; -- } -- - memset(&schedp, 0, sizeof(schedp)); - schedp.sched_priority = par->prio; - if (setscheduler(0, par->policy, &schedp)) -@@ -599,20 +588,6 @@ static void *timerthread(void *param) - stop = now; - stop.tv_sec += duration; - } -- if (par->mode == MODE_CYCLIC) { -- if (par->timermode == TIMER_ABSTIME) -- tspec.it_value = next; -- else -- tspec.it_value = interval; -- timer_settime(timer, par->timermode, &tspec, NULL); -- } -- -- if (par->mode == MODE_SYS_ITIMER) { -- itimer.it_interval.tv_sec = interval.tv_sec; -- itimer.it_interval.tv_usec = interval.tv_nsec / 1000; -- itimer.it_value = itimer.it_interval; -- setitimer(ITIMER_REAL, &itimer, NULL); -- } - - stat->threadstarted++; - -@@ -620,16 +595,10 @@ static void *timerthread(void *param) - - uint64_t diff; - unsigned long diff_smi = 0; -- int sigs, ret; -+ int ret; - - /* Wait for next period */ - switch (par->mode) { -- case MODE_CYCLIC: -- case MODE_SYS_ITIMER: -- if (sigwait(&sigset, &sigs) < 0) -- goto out; -- break; -- - case MODE_CLOCK_NANOSLEEP: - if (par->timermode == TIMER_ABSTIME) { - ret = clock_nanosleep(par->clock, TIMER_ABSTIME, -@@ -750,11 +719,6 @@ static void *timerthread(void *param) - - next.tv_sec += interval.tv_sec; - next.tv_nsec += interval.tv_nsec; -- if (par->mode == MODE_CYCLIC) { -- int overrun_count = timer_getoverrun(timer); -- next.tv_sec += overrun_count * interval.tv_sec; -- next.tv_nsec += overrun_count * interval.tv_nsec; -- } - tsnorm(&next); - - while (tsgreater(&now, &next)) { -@@ -779,17 +743,6 @@ out: - pthread_mutex_unlock(&refresh_on_max_lock); - } - -- if (par->mode == MODE_CYCLIC) -- timer_delete(timer); -- -- if (par->mode == MODE_SYS_ITIMER) { -- itimer.it_value.tv_sec = 0; -- itimer.it_value.tv_usec = 0; -- itimer.it_interval.tv_sec = 0; -- itimer.it_interval.tv_usec = 0; -- setitimer(ITIMER_REAL, &itimer, NULL); -- } -- - /* close msr file */ - if (smi) - close(par->msr_fd); -@@ -1183,7 +1136,8 @@ static void process_options(int argc, ch - case OPT_VERBOSE: verbose = 1; break; - case 'x': - case OPT_POSIX_TIMERS: -- use_nanosleep = MODE_CYCLIC; break; -+ fatal("--posix_timers is not available on your libc\n"); -+ break; - case '?': - case OPT_HELP: - display_help(0); break; -@@ -1216,13 +1170,6 @@ static void process_options(int argc, ch - } - } - -- if ((use_system == MODE_SYS_OFFSET) && (use_nanosleep == MODE_CYCLIC)) { -- warn("The system option requires clock_nanosleep\n"); -- warn("and is not compatible with posix_timers\n"); -- warn("Using clock_nanosleep\n"); -- use_nanosleep = MODE_CLOCK_NANOSLEEP; -- } -- - /* if smp wasn't requested, test for numa automatically */ - if (!smp) { - numa = numa_initialize(); -@@ -1952,7 +1899,6 @@ int main(int argc, char **argv) - - } - -- - mode = use_nanosleep + use_system; - - sigemptyset(&sigset); -@@ -2002,16 +1948,18 @@ int main(int argc, char **argv) - void *stack; - void *currstk; - size_t stksize; -+ int err; - - /* find the memory node associated with the cpu i */ - node = rt_numa_numa_node_of_cpu(cpu); - -- /* get the stack size set for this thread */ -- if (pthread_attr_getstack(&attr, &currstk, &stksize)) -+ /* get the stack size set for for this thread */ -+ err = pthread_attr_getstack(&attr, &currstk, &stksize); -+ if (err != EINVAL) - fatal("failed to get stack size for thread %d\n", i); - - /* if the stack size is zero, set a default */ -- if (stksize == 0) -+ if (err == EINVAL || stksize == 0) - stksize = PTHREAD_STACK_MIN * 2; - - /* allocate memory for a stack on appropriate node */ ---- a/src/hackbench/hackbench.c -+++ b/src/hackbench/hackbench.c -@@ -24,13 +24,15 @@ - #include - #include - #include --#include -+#include - #include - #include - #include - #include - #include - -+#include "musl.h" -+ - static unsigned int datasize = 100; - static unsigned int loops = 100; - static unsigned int num_groups = 10; ---- /dev/null -+++ b/src/include/musl.h -@@ -0,0 +1,28 @@ -+/* -+ * Copyright (C) 2020 Kurt Kanzenbach -+ * Time-stamp: <2020-04-04 10:54:01 kurt> -+ */ -+ -+#ifndef _MUSL_H_ -+#define _MUSL_H_ -+ -+#include -+#include -+ -+/* -+ * Musl someshow defines sched_* to ENOSYS which is not correct ... -+ * See commit 1e21e78bf7a5 ("add support for thread scheduling (POSIX TPS option)") -+ * -+ * Workaround: define them to syscall(...) -+ */ -+ -+#define sched_getparam(pid, param) \ -+ syscall(SYS_sched_getparam, pid, param) -+#define sched_setparam(pid, param) \ -+ syscall(SYS_sched_setparam, pid, param) -+#define sched_getscheduler(pid) \ -+ syscall(SYS_sched_getscheduler, pid) -+#define sched_setscheduler(pid, policy, param) \ -+ syscall(SYS_sched_setscheduler, pid, policy, param) -+ -+#endif /* _MUSL_H_ */ ---- a/src/lib/rt-utils.c -+++ b/src/lib/rt-utils.c -@@ -24,6 +24,7 @@ - #include - #include - -+#include "musl.h" - #include "rt-utils.h" - #include "rt-sched.h" - #include "rt-error.h" ---- a/src/pi_tests/classic_pi.c -+++ b/src/pi_tests/classic_pi.c -@@ -34,6 +34,8 @@ - #include - #include - -+#include "musl.h" -+ - /* test timeout */ - #define TIMEOUT 2 - ---- a/src/pi_tests/tst-mutexpi10.c -+++ b/src/pi_tests/tst-mutexpi10.c -@@ -35,6 +35,8 @@ - #include - #include - -+#include "musl.h" -+ - /* test timeout */ - #define TIMEOUT 2 - ---- a/src/pmqtest/pmqtest.c -+++ b/src/pmqtest/pmqtest.c -@@ -24,6 +24,7 @@ - #include - #include - -+#include "musl.h" - #include "rt-utils.h" - #include "rt-get_cpu.h" - #include "rt-error.h" ---- a/src/ptsematest/ptsematest.c -+++ b/src/ptsematest/ptsematest.c -@@ -22,6 +22,7 @@ - #include - #include - -+#include "musl.h" - #include "rt-utils.h" - #include "rt-get_cpu.h" - #include "rt-error.h" ---- a/src/rt-migrate-test/rt-migrate-test.c -+++ b/src/rt-migrate-test/rt-migrate-test.c -@@ -27,6 +27,7 @@ - - #include - -+#include "musl.h" - #include "rt-utils.h" - - int nr_tasks; ---- a/src/sched_deadline/cyclicdeadline.c -+++ b/src/sched_deadline/cyclicdeadline.c -@@ -30,6 +30,7 @@ - #include - #include - -+#include "musl.h" - #include "rt-utils.h" - #include "rt-sched.h" - #include "rt-error.h" diff --git a/dev-util/rt-tests/files/rt-tests-2.4-musl.patch b/dev-util/rt-tests/files/rt-tests-2.4-musl.patch new file mode 100644 index 000000000000..886359894cdf --- /dev/null +++ b/dev-util/rt-tests/files/rt-tests-2.4-musl.patch @@ -0,0 +1,341 @@ +From 0b7a1e0d3463aa8aa4b7dcad0ec154e658d68036 Mon Sep 17 00:00:00 2001 +From: Kurt Kanzenbach +Date: Wed, 1 Apr 2020 20:15:24 +0200 +Subject: [PATCH] all: Fix musl build + +There are a few problems: + + * pi stress: pthread_attr_setaffinity_np() is not supported + * cyclictest: SIGEV_THREAD_ID is not supported + * hackbench: Fix include + * all: Fix sched_* calls + +With these changes applied, the rt-tests seem to run fine. + +Signed-off-by: Kurt Kanzenbach +--- + Makefile | 5 -- + src/backfire/sendme.c | 1 + src/cyclictest/cyclictest.c | 70 ++++------------------------------ + src/hackbench/hackbench.c | 4 + + src/include/musl.h | 28 +++++++++++++ + src/lib/rt-utils.c | 1 + src/pi_tests/tst-mutexpi10.c | 2 + src/pmqtest/pmqtest.c | 1 + src/ptsematest/ptsematest.c | 1 + src/rt-migrate-test/rt-migrate-test.c | 1 + src/sched_deadline/cyclicdeadline.c | 1 + 11 files changed, 48 insertions(+), 67 deletions(-) + create mode 100644 src/include/musl.h + +--- a/Makefile ++++ b/Makefile +@@ -7,7 +7,6 @@ OBJDIR = bld + sources = cyclictest.c \ + hackbench.c \ + pip_stress.c \ +- pi_stress.c \ + pmqtest.c \ + ptsematest.c \ + rt-migrate-test.c \ +@@ -42,7 +41,6 @@ ifeq (${PYLIB},) + endif + + MANPAGES = src/cyclictest/cyclictest.8 \ +- src/pi_tests/pi_stress.8 \ + src/ptsematest/ptsematest.8 \ + src/rt-migrate-test/rt-migrate-test.8 \ + src/sigwaittest/sigwaittest.8 \ +@@ -130,9 +128,6 @@ deadline_test: $(OBJDIR)/deadline_test.o + signaltest: $(OBJDIR)/signaltest.o $(OBJDIR)/librttest.a $(OBJDIR)/librttestnuma.a + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(RTTESTNUMA) + +-pi_stress: $(OBJDIR)/pi_stress.o $(OBJDIR)/librttest.a +- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) +- + hwlatdetect: src/hwlatdetect/hwlatdetect.py + chmod +x src/hwlatdetect/hwlatdetect.py + ln -s src/hwlatdetect/hwlatdetect.py hwlatdetect +--- a/src/backfire/sendme.c ++++ b/src/backfire/sendme.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include "musl.h" + #include "rt-utils.h" + #include "rt-get_cpu.h" + +--- a/src/cyclictest/cyclictest.c ++++ b/src/cyclictest/cyclictest.c +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include "musl.h" + #include "rt_numa.h" + + #include "rt-utils.h" +@@ -546,12 +547,8 @@ static void *timerthread(void *param) + { + struct thread_param *par = param; + struct sched_param schedp; +- struct sigevent sigev; + sigset_t sigset; +- timer_t timer; + struct timespec now, next, interval, stop = { 0 }; +- struct itimerval itimer; +- struct itimerspec tspec; + struct thread_stat *stat = par->stats; + int stopped = 0; + cpu_set_t mask; +@@ -580,14 +577,6 @@ static void *timerthread(void *param) + sigaddset(&sigset, par->signal); + sigprocmask(SIG_BLOCK, &sigset, NULL); + +- if (par->mode == MODE_CYCLIC) { +- sigev.sigev_notify = SIGEV_THREAD_ID | SIGEV_SIGNAL; +- sigev.sigev_signo = par->signal; +- sigev.sigev_notify_thread_id = stat->tid; +- timer_create(par->clock, &sigev, &timer); +- tspec.it_interval = interval; +- } +- + memset(&schedp, 0, sizeof(schedp)); + schedp.sched_priority = par->prio; + if (setscheduler(0, par->policy, &schedp)) +@@ -641,20 +630,6 @@ static void *timerthread(void *param) + stop = now; + stop.tv_sec += duration; + } +- if (par->mode == MODE_CYCLIC) { +- if (par->timermode == TIMER_ABSTIME) +- tspec.it_value = next; +- else +- tspec.it_value = interval; +- timer_settime(timer, par->timermode, &tspec, NULL); +- } +- +- if (par->mode == MODE_SYS_ITIMER) { +- itimer.it_interval.tv_sec = interval.tv_sec; +- itimer.it_interval.tv_usec = interval.tv_nsec / 1000; +- itimer.it_value = itimer.it_interval; +- setitimer(ITIMER_REAL, &itimer, NULL); +- } + + stat->threadstarted++; + +@@ -662,16 +637,10 @@ static void *timerthread(void *param) + + uint64_t diff; + unsigned long diff_smi = 0; +- int sigs, ret; ++ int ret; + + /* Wait for next period */ + switch (par->mode) { +- case MODE_CYCLIC: +- case MODE_SYS_ITIMER: +- if (sigwait(&sigset, &sigs) < 0) +- goto out; +- break; +- + case MODE_CLOCK_NANOSLEEP: + if (par->timermode == TIMER_ABSTIME) { + ret = clock_nanosleep(par->clock, TIMER_ABSTIME, +@@ -792,11 +761,6 @@ static void *timerthread(void *param) + + next.tv_sec += interval.tv_sec; + next.tv_nsec += interval.tv_nsec; +- if (par->mode == MODE_CYCLIC) { +- int overrun_count = timer_getoverrun(timer); +- next.tv_sec += overrun_count * interval.tv_sec; +- next.tv_nsec += overrun_count * interval.tv_nsec; +- } + tsnorm(&next); + + while (tsgreater(&now, &next)) { +@@ -821,17 +785,6 @@ out: + pthread_mutex_unlock(&refresh_on_max_lock); + } + +- if (par->mode == MODE_CYCLIC) +- timer_delete(timer); +- +- if (par->mode == MODE_SYS_ITIMER) { +- itimer.it_value.tv_sec = 0; +- itimer.it_value.tv_usec = 0; +- itimer.it_interval.tv_sec = 0; +- itimer.it_interval.tv_usec = 0; +- setitimer(ITIMER_REAL, &itimer, NULL); +- } +- + /* close msr file */ + if (smi) + close(par->msr_fd); +@@ -1227,7 +1180,8 @@ static void process_options(int argc, ch + case OPT_VERBOSE: verbose = 1; break; + case 'x': + case OPT_POSIX_TIMERS: +- use_nanosleep = MODE_CYCLIC; break; ++ fatal("--posix_timers is not available on your libc\n"); ++ break; + case '?': + case OPT_HELP: + display_help(0); break; +@@ -1260,13 +1214,6 @@ static void process_options(int argc, ch + } + } + +- if ((use_system == MODE_SYS_OFFSET) && (use_nanosleep == MODE_CYCLIC)) { +- warn("The system option requires clock_nanosleep\n"); +- warn("and is not compatible with posix_timers\n"); +- warn("Using clock_nanosleep\n"); +- use_nanosleep = MODE_CLOCK_NANOSLEEP; +- } +- + /* if smp wasn't requested, test for numa automatically */ + if (!smp) { + numa = numa_initialize(); +@@ -1993,7 +1940,6 @@ int main(int argc, char **argv) + + } + +- + mode = use_nanosleep + use_system; + + sigemptyset(&sigset); +@@ -2043,16 +1989,18 @@ int main(int argc, char **argv) + void *stack; + void *currstk; + size_t stksize; ++ int err; + + /* find the memory node associated with the cpu i */ + node = rt_numa_numa_node_of_cpu(cpu); + +- /* get the stack size set for this thread */ +- if (pthread_attr_getstack(&attr, &currstk, &stksize)) ++ /* get the stack size set for for this thread */ ++ err = pthread_attr_getstack(&attr, &currstk, &stksize); ++ if (err != EINVAL) + fatal("failed to get stack size for thread %d\n", i); + + /* if the stack size is zero, set a default */ +- if (stksize == 0) ++ if (err == EINVAL || stksize == 0) + stksize = PTHREAD_STACK_MIN * 2; + + /* allocate memory for a stack on appropriate node */ +--- a/src/hackbench/hackbench.c ++++ b/src/hackbench/hackbench.c +@@ -25,7 +25,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +@@ -34,6 +34,8 @@ + #include + #include + ++#include "musl.h" ++ + static unsigned int datasize = 100; + static unsigned int loops = 100; + static unsigned int num_groups = 10; +--- /dev/null ++++ b/src/include/musl.h +@@ -0,0 +1,28 @@ ++/* ++ * Copyright (C) 2020 Kurt Kanzenbach ++ * Time-stamp: <2020-04-04 10:54:01 kurt> ++ */ ++ ++#ifndef _MUSL_H_ ++#define _MUSL_H_ ++ ++#include ++#include ++ ++/* ++ * Musl someshow defines sched_* to ENOSYS which is not correct ... ++ * See commit 1e21e78bf7a5 ("add support for thread scheduling (POSIX TPS option)") ++ * ++ * Workaround: define them to syscall(...) ++ */ ++ ++#define sched_getparam(pid, param) \ ++ syscall(SYS_sched_getparam, pid, param) ++#define sched_setparam(pid, param) \ ++ syscall(SYS_sched_setparam, pid, param) ++#define sched_getscheduler(pid) \ ++ syscall(SYS_sched_getscheduler, pid) ++#define sched_setscheduler(pid, policy, param) \ ++ syscall(SYS_sched_setscheduler, pid, policy, param) ++ ++#endif /* _MUSL_H_ */ +--- a/src/lib/rt-utils.c ++++ b/src/lib/rt-utils.c +@@ -24,6 +24,7 @@ + #include + #include + ++#include "musl.h" + #include "rt-utils.h" + #include "rt-sched.h" + #include "rt-error.h" +--- a/src/pi_tests/tst-mutexpi10.c ++++ b/src/pi_tests/tst-mutexpi10.c +@@ -35,6 +35,8 @@ + #include + #include + ++#include "musl.h" ++ + /* test timeout */ + #define TIMEOUT 2 + +--- a/src/pmqtest/pmqtest.c ++++ b/src/pmqtest/pmqtest.c +@@ -24,6 +24,7 @@ + #include + #include + ++#include "musl.h" + #include "rt-utils.h" + #include "rt-get_cpu.h" + #include "rt-error.h" +--- a/src/ptsematest/ptsematest.c ++++ b/src/ptsematest/ptsematest.c +@@ -22,6 +22,7 @@ + #include + #include + ++#include "musl.h" + #include "rt-utils.h" + #include "rt-get_cpu.h" + #include "rt-error.h" +--- a/src/rt-migrate-test/rt-migrate-test.c ++++ b/src/rt-migrate-test/rt-migrate-test.c +@@ -27,6 +27,7 @@ + + #include + ++#include "musl.h" + #include "rt-utils.h" + + int nr_tasks; +--- a/src/sched_deadline/cyclicdeadline.c ++++ b/src/sched_deadline/cyclicdeadline.c +@@ -30,6 +30,7 @@ + #include + #include + ++#include "musl.h" + #include "rt-utils.h" + #include "rt-sched.h" + #include "rt-error.h" diff --git a/dev-util/rt-tests/rt-tests-2.3.ebuild b/dev-util/rt-tests/rt-tests-2.3.ebuild deleted file mode 100644 index 247753110450..000000000000 --- a/dev-util/rt-tests/rt-tests-2.3.ebuild +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{7..10} ) - -inherit python-single-r1 toolchain-funcs - -DESCRIPTION="A collection of latency testing tools for the linux(-rt) kernel" -HOMEPAGE="https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/about/" -SRC_URI=" - https://kernel.org/pub/linux/utils/rt-tests/${P}.tar.xz - https://kernel.org/pub/linux/utils/rt-tests/older/${P}.tar.xz" - -LICENSE="GPL-2 GPL-2+ LGPL-2.1+" -SLOT="0" -KEYWORDS="~amd64 ~arm64 ~x86" -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -DEPEND="${PYTHON_DEPS} - sys-process/numactl" -RDEPEND="${DEPEND}" - -src_prepare() { - default - use elibc_musl && eapply "${FILESDIR}/${P}-musl.patch" -} - -src_compile() { - emake CC="$(tc-getCC)" AR="$(tc-getAR)" -} - -src_install() { - emake CC="$(tc-getCC)" prefix=/usr DESTDIR="${ED}" install - python_fix_shebang "${ED}" - python_optimize -} diff --git a/dev-util/rt-tests/rt-tests-2.4.ebuild b/dev-util/rt-tests/rt-tests-2.4.ebuild new file mode 100644 index 000000000000..43403751c848 --- /dev/null +++ b/dev-util/rt-tests/rt-tests-2.4.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..11} ) + +inherit python-single-r1 toolchain-funcs + +DESCRIPTION="A collection of latency testing tools for the linux(-rt) kernel" +HOMEPAGE="https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/" +SRC_URI=" + https://kernel.org/pub/linux/utils/rt-tests/${P}.tar.xz + https://kernel.org/pub/linux/utils/rt-tests/older/${P}.tar.xz" + +LICENSE="GPL-2 GPL-2+ LGPL-2.1+" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +DEPEND="${PYTHON_DEPS} + sys-process/numactl" +RDEPEND="${DEPEND}" + +src_prepare() { + default + use elibc_musl && eapply "${FILESDIR}/${P}-musl.patch" +} + +src_compile() { + emake CC="$(tc-getCC)" AR="$(tc-getAR)" +} + +src_install() { + emake CC="$(tc-getCC)" prefix=/usr DESTDIR="${ED}" install + python_fix_shebang "${ED}" + python_optimize +} -- cgit v1.2.3