blob: 29b2bf7e41dc29515e95ac50dc68abd265df0bc4 [file] [log] [blame]
Andrew Geissler1e34c2d2020-05-29 16:02:59 -05001From 74958c3e341de713b596c8cfd35b2391d6c7bc09 Mon Sep 17 00:00:00 2001
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 18:19:03 +0000
Andrew Geissler1e34c2d2020-05-29 16:02:59 -05004Subject: [PATCH] build: Add option to select libc implementation
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05005
6There are more than glibc for C library implementation available on
7linux now a days, uclibc cloaked like glibc but musl e.g. is very
Andrew Geissler1e34c2d2020-05-29 16:02:59 -05008different and does not implement all GNU extensions.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05009
10Disable tests specifically not building _yet_ on musl based systems
11
Andrew Geissler1e34c2d2020-05-29 16:02:59 -050012Upstream-Status: Pending (pvorel: this is not going to be fixed, instead
13each test needs to be fixed)
Brad Bishop96ff1982019-08-19 13:50:42 -040014
Andrew Geissler82c905d2020-04-13 13:39:40 -050015rt_tgsigqueueinfo fails with:
16rt_tgsigqueueinfo01.c: In function 'sigusr1_handler':
17rt_tgsigqueueinfo01.c:42:22: error: 'siginfo_t' {aka 'struct <anonymous>'} has no member named '_sifields'; did you mean '__si_fields'?
18 42 | sigval_rcv = uinfo->_sifields._rt.SI_SIGVAL.sival_ptr;
19 | ^~~~~~~~~
20 | __si_fields
21
Brad Bishop96ff1982019-08-19 13:50:42 -040022Signed-off-by: Khem Raj <raj.khem@gmail.com>
Andrew Geissler1e34c2d2020-05-29 16:02:59 -050023[ pvorel: rebase for 20200515: enable pty, ioctl ]
Andrew Geissler82c905d2020-04-13 13:39:40 -050024[ pvorel: rebase for 20200120: enable mallopt, profil, rpc016,
25rt_sigsuspend, sbrk_mutex, setdomainname, sethostname, sigsuspend,
26testpi-3, testpi-5, testpi-6, ustat; move rt_tgsigqueueinfo
27from 0006-rt_tgsigqueueinfo-disable-test-on-musl.patch ]
28Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050029---
Andrew Geissler82c905d2020-04-13 13:39:40 -050030 Makefile | 5 +++++
Andrew Geissler82c905d2020-04-13 13:39:40 -050031 testcases/kernel/sched/Makefile | 4 +++-
32 testcases/kernel/syscalls/Makefile | 4 ++++
Andrew Geissler1e34c2d2020-05-29 16:02:59 -050033 3 files changed, 12 insertions(+), 1 deletion(-)
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050034
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080035diff --git a/Makefile b/Makefile
Andrew Geissler82c905d2020-04-13 13:39:40 -050036index 768ca4606..e9d679a71 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080037--- a/Makefile
38+++ b/Makefile
Brad Bishop96ff1982019-08-19 13:50:42 -040039@@ -41,6 +41,11 @@ vpath %.mk $(top_srcdir)/mk:$(top_srcdir)/mk/include
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050040 UCLINUX ?= 0
41 export UCLINUX
42
43+# System C library implementation (glibc,uclibc,musl etc.)
44+# default to glibc if not set
45+LIBC ?= glibc
46+export LIBC
47+
48 # CLEAN_TARGETS: Targets which exist solely in clean.
49 # COMMON_TARGETS: Targets which exist in all, clean, and install.
50 # INSTALL_TARGETS: Targets which exist in clean and install (contains
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080051diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile
Andrew Geissler82c905d2020-04-13 13:39:40 -050052index 6a57d79ee..74bb93370 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080053--- a/testcases/kernel/sched/Makefile
54+++ b/testcases/kernel/sched/Makefile
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050055@@ -23,5 +23,7 @@
56 top_srcdir ?= ../../..
57
58 include $(top_srcdir)/include/mk/env_pre.mk
59-
60+ifeq ($(LIBC),musl)
61+ FILTER_OUT_DIRS += process_stress
62+endif
63 include $(top_srcdir)/include/mk/generic_trunk_target.mk
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080064diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile
Andrew Geissler1e34c2d2020-05-29 16:02:59 -050065index c6dc8d9e7..aa50761ea 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080066--- a/testcases/kernel/syscalls/Makefile
67+++ b/testcases/kernel/syscalls/Makefile
Andrew Geissler1e34c2d2020-05-29 16:02:59 -050068@@ -15,6 +15,10 @@ FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050069 mincore mprotect nftw profil remap_file_pages sbrk
70 endif
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050071
Andrew Geissler82c905d2020-04-13 13:39:40 -050072+ifeq ($(LIBC),musl)
Andrew Geissler1e34c2d2020-05-29 16:02:59 -050073+FILTER_OUT_DIRS += confstr fmtmsg getcontext rt_tgsigqueueinfo
Andrew Geissler82c905d2020-04-13 13:39:40 -050074+endif
75+
Brad Bishop316dfdd2018-06-25 12:45:53 -040076 ifeq ($(UCLIBC),1)
77 FILTER_OUT_DIRS += profil
Andrew Geissler82c905d2020-04-13 13:39:40 -050078 endif
Andrew Geissler1e34c2d2020-05-29 16:02:59 -050079--
802.26.2
81