diff options
5 files changed, 64 insertions, 79 deletions
diff --git a/recipes-security/selinux/libselinux/0001-Fix-building-against-musl-and-uClibc-libc-libraries.patch b/recipes-security/selinux/libselinux/0001-Fix-building-against-musl-and-uClibc-libc-libraries.patch deleted file mode 100644 index 8308553..0000000 --- a/recipes-security/selinux/libselinux/0001-Fix-building-against-musl-and-uClibc-libc-libraries.patch +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | From 61bfcbffce32be51d712040c3f84293b78428184 Mon Sep 17 00:00:00 2001 | ||
2 | From: Adam Duskett <Aduskett@gmail.com> | ||
3 | Date: Tue, 7 Apr 2020 13:53:05 -0700 | ||
4 | Subject: [PATCH] Fix building against musl and uClibc libc libraries. | ||
5 | |||
6 | Currently, the src/Makefile provides the FTS_LDLIBS when building against musl | ||
7 | or uClibc. However, this is missing from utils/Makefile, which causes linking | ||
8 | to fail. | ||
9 | |||
10 | Add the FTS_LDLIBS variable to the LDLIBS variable in utils/Makefile to fix | ||
11 | compiling against uClibc and musl. | ||
12 | |||
13 | Signed-off-by: Adam Duskett <Aduskett@gmail.com> | ||
14 | |||
15 | Upstream-Status: Backport | ||
16 | [https://github.com/SELinuxProject/selinux/commit/aa40067b7b86d5e4c951fccae1aa98baff148613] | ||
17 | |||
18 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
19 | --- | ||
20 | utils/Makefile | 2 +- | ||
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
22 | |||
23 | diff --git a/utils/Makefile b/utils/Makefile | ||
24 | index 3615063..a5632b7 100644 | ||
25 | --- a/utils/Makefile | ||
26 | +++ b/utils/Makefile | ||
27 | @@ -45,7 +45,7 @@ endif | ||
28 | |||
29 | override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS) | ||
30 | override LDFLAGS += -L../src | ||
31 | -override LDLIBS += -lselinux | ||
32 | +override LDLIBS += -lselinux $(FTS_LDLIBS) | ||
33 | PCRE_LDLIBS ?= -lpcre | ||
34 | |||
35 | ifeq ($(ANDROID_HOST),y) | ||
36 | -- | ||
37 | 2.7.4 | ||
38 | |||
diff --git a/recipes-security/selinux/libselinux/0001-libselinux-do-not-define-gettid-for-musl.patch b/recipes-security/selinux/libselinux/0001-libselinux-do-not-define-gettid-for-musl.patch new file mode 100644 index 0000000..5d6e409 --- /dev/null +++ b/recipes-security/selinux/libselinux/0001-libselinux-do-not-define-gettid-for-musl.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 5f6f4a095bc82b29c3871d4d8a15d9c16cef39ef Mon Sep 17 00:00:00 2001 | ||
2 | From: Yi Zhao <yi.zhao@windriver.com> | ||
3 | Date: Wed, 6 Jan 2021 10:42:11 +0800 | ||
4 | Subject: [PATCH] libselinux: do not define gettid() for musl | ||
5 | |||
6 | The musl has implemented gettid() function: | ||
7 | http://git.musl-libc.org/cgit/musl/commit/?id=d49cf07541bb54a5ac7aec1feec8514db33db8ea | ||
8 | |||
9 | Fixes: | ||
10 | procattr.c:38:14: error: static declaration of 'gettid' follows non-static declaration | ||
11 | 38 | static pid_t gettid(void) | ||
12 | | ^~~~~~ | ||
13 | In file included from procattr.c:2: | ||
14 | /build/tmp/work/core2-32-poky-linux-musl/libselinux/3.1-r0/recipe-sysroot/usr/include/unistd.h:194:7: | ||
15 | note: previous declaration of 'gettid' was here | ||
16 | 194 | pid_t gettid(void); | ||
17 | | ^~~~~~ | ||
18 | |||
19 | Upstream-Status: Pending | ||
20 | |||
21 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
22 | --- | ||
23 | src/procattr.c | 8 +------- | ||
24 | 1 file changed, 1 insertion(+), 7 deletions(-) | ||
25 | |||
26 | diff --git a/src/procattr.c b/src/procattr.c | ||
27 | index 926ee54..519e515 100644 | ||
28 | --- a/src/procattr.c | ||
29 | +++ b/src/procattr.c | ||
30 | @@ -24,13 +24,7 @@ static __thread char destructor_initialized; | ||
31 | |||
32 | /* Bionic and glibc >= 2.30 declare gettid() system call wrapper in unistd.h and | ||
33 | * has a definition for it */ | ||
34 | -#ifdef __BIONIC__ | ||
35 | - #define OVERRIDE_GETTID 0 | ||
36 | -#elif !defined(__GLIBC_PREREQ) | ||
37 | - #define OVERRIDE_GETTID 1 | ||
38 | -#elif !__GLIBC_PREREQ(2,30) | ||
39 | - #define OVERRIDE_GETTID 1 | ||
40 | -#else | ||
41 | +#if !defined(__GLIBC_) | ||
42 | #define OVERRIDE_GETTID 0 | ||
43 | #endif | ||
44 | |||
45 | -- | ||
46 | 2.17.1 | ||
47 | |||
diff --git a/recipes-security/selinux/libselinux/libselinux-drop-Wno-unused-but-set-variable.patch b/recipes-security/selinux/libselinux/libselinux-drop-Wno-unused-but-set-variable.patch deleted file mode 100644 index 688b4e3..0000000 --- a/recipes-security/selinux/libselinux/libselinux-drop-Wno-unused-but-set-variable.patch +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | From 865b8c40b331235ce2c9df1fcbbb3876c9b79338 Mon Sep 17 00:00:00 2001 | ||
2 | From: Randy MacLeod <Randy.MacLeod@windriver.com> | ||
3 | Date: Tue, 30 Apr 2013 17:28:34 -0400 | ||
4 | Subject: [PATCH] libselinux: drop flag: -Wno-unused-but-set-variable | ||
5 | |||
6 | Upstream status: Inappropriate [older compilers only] | ||
7 | |||
8 | Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> | ||
9 | |||
10 | --- | ||
11 | src/Makefile | 2 +- | ||
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/src/Makefile b/src/Makefile | ||
15 | index 2408fae..a89c0f7 100644 | ||
16 | --- a/src/Makefile | ||
17 | +++ b/src/Makefile | ||
18 | @@ -96,7 +96,7 @@ PCRE_LDLIBS ?= -lpcre | ||
19 | |||
20 | override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS) | ||
21 | |||
22 | -SWIG_CFLAGS += -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter \ | ||
23 | +SWIG_CFLAGS += -Wno-error -Wno-unused-variable -Wno-unused-parameter \ | ||
24 | -Wno-shadow -Wno-uninitialized -Wno-missing-prototypes -Wno-missing-declarations | ||
25 | |||
26 | RANLIB ?= ranlib | ||
diff --git a/recipes-security/selinux/libselinux_3.0.bb b/recipes-security/selinux/libselinux_3.0.bb deleted file mode 100644 index 05d2346..0000000 --- a/recipes-security/selinux/libselinux_3.0.bb +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | require selinux_20191204.inc | ||
2 | require ${BPN}.inc | ||
3 | |||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" | ||
5 | |||
6 | SRC_URI[md5sum] = "b387a66f087b6d97713570e85ec89d89" | ||
7 | SRC_URI[sha256sum] = "2ea2b30f671dae9d6b1391cbe8fb2ce5d36a3ee4fb1cd3c32f0d933c31b82433" | ||
8 | |||
9 | SRC_URI += "\ | ||
10 | file://libselinux-drop-Wno-unused-but-set-variable.patch \ | ||
11 | file://libselinux-make-O_CLOEXEC-optional.patch \ | ||
12 | file://libselinux-make-SOCK_CLOEXEC-optional.patch \ | ||
13 | file://libselinux-define-FD_CLOEXEC-as-necessary.patch \ | ||
14 | file://0001-Fix-building-against-musl-and-uClibc-libc-libraries.patch \ | ||
15 | " | ||
diff --git a/recipes-security/selinux/libselinux_3.1.bb b/recipes-security/selinux/libselinux_3.1.bb new file mode 100644 index 0000000..9d1cda5 --- /dev/null +++ b/recipes-security/selinux/libselinux_3.1.bb | |||
@@ -0,0 +1,17 @@ | |||
1 | require selinux_20200710.inc | ||
2 | require ${BPN}.inc | ||
3 | |||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" | ||
5 | |||
6 | SRC_URI[md5sum] = "693680c021feb69a4b258b0370021461" | ||
7 | SRC_URI[sha256sum] = "ea5dcbb4d859e3f999c26a13c630da2f16dff9462e3cc8cb7b458ac157d112e7" | ||
8 | |||
9 | SRC_URI += "\ | ||
10 | file://libselinux-make-O_CLOEXEC-optional.patch \ | ||
11 | file://libselinux-make-SOCK_CLOEXEC-optional.patch \ | ||
12 | file://libselinux-define-FD_CLOEXEC-as-necessary.patch \ | ||
13 | " | ||
14 | |||
15 | SRC_URI_append_libc-musl = " \ | ||
16 | file://0001-libselinux-do-not-define-gettid-for-musl.patch \ | ||
17 | " | ||