summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-09-05 21:46:18 -0700
committerKhem Raj <raj.khem@gmail.com>2019-09-07 10:08:45 -0700
commite7b382602a666e45eba3b9c04f22fc8a18fea720 (patch)
tree56ef54914cdf5574687e606c153c93ef6b655318 /meta-networking/recipes-connectivity
parent391d79571668a2cde6efcbd23e0544c30b5e43ac (diff)
downloadmeta-openembedded-e7b382602a666e45eba3b9c04f22fc8a18fea720.tar.gz
samba: Fix configure tests to work with clang
Do not use nested functions ( main inside main ) Use global scope for __thread variables Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-connectivity')
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch30
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0002-util_sec.c-Move-__thread-variable-to-global-scope.patch58
-rw-r--r--meta-networking/recipes-connectivity/samba/samba_4.10.7.bb2
3 files changed, 90 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/samba/samba/0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch b/meta-networking/recipes-connectivity/samba/samba/0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch
new file mode 100644
index 000000000..de7f31183
--- /dev/null
+++ b/meta-networking/recipes-connectivity/samba/samba/0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch
@@ -0,0 +1,30 @@
1From 3a935c638605bfb392ca7780d22c08c1a0a71e71 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 5 Sep 2019 21:37:33 -0700
4Subject: [PATCH 1/2] lib/replace/wscript: Avoid generating nested main
5 function
6
7clang is not happy when it sees another main nested inside the main
8function and fails the test for prctl syscall, therefore avoid adding
9implicit main() here
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 lib/replace/wscript | 1 +
14 1 file changed, 1 insertion(+)
15
16diff --git a/lib/replace/wscript b/lib/replace/wscript
17index a7fd25d..d6767fc 100644
18--- a/lib/replace/wscript
19+++ b/lib/replace/wscript
20@@ -137,6 +137,7 @@ def configure(conf):
21 }
22 ''',
23 'HAVE_PRCTL',
24+ addmain=False,
25 headers='sys/prctl.h',
26 msg='Checking for prctl syscall')
27
28--
292.23.0
30
diff --git a/meta-networking/recipes-connectivity/samba/samba/0002-util_sec.c-Move-__thread-variable-to-global-scope.patch b/meta-networking/recipes-connectivity/samba/samba/0002-util_sec.c-Move-__thread-variable-to-global-scope.patch
new file mode 100644
index 000000000..6fc849337
--- /dev/null
+++ b/meta-networking/recipes-connectivity/samba/samba/0002-util_sec.c-Move-__thread-variable-to-global-scope.patch
@@ -0,0 +1,58 @@
1From c62a6f32ab965de2ec77a614f20f04568116835b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 5 Sep 2019 21:39:05 -0700
4Subject: [PATCH 2/2] util_sec.c: Move __thread variable to global scope
5
6Make clang happy otherwise it complains about variable scope
7
8fixes
9
10source3/./lib/util_sec.c:470:4: error: '__thread' variables must have global storage
11 } __thread cache;
12 ^
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 source3/lib/util_sec.c | 19 +++++++++++--------
17 1 file changed, 11 insertions(+), 8 deletions(-)
18
19diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c
20index 9408269..7390318 100644
21--- a/source3/lib/util_sec.c
22+++ b/source3/lib/util_sec.c
23@@ -444,6 +444,17 @@ void become_user_permanently(uid_t uid, gid_t gid)
24 assert_gid(gid, gid);
25 }
26
27+#ifdef HAVE___THREAD
28+ struct cache_t {
29+ bool active;
30+ uid_t uid;
31+ gid_t gid;
32+ size_t setlen;
33+ uintptr_t gidset;
34+ };
35+
36+static __thread struct cache_t cache;
37+#endif
38 /**********************************************************
39 Function to set thread specific credentials. Leave
40 saved-set uid/gid alone.Must be thread-safe code.
41@@ -461,14 +472,6 @@ int set_thread_credentials(uid_t uid,
42 * available.
43 */
44 #ifdef HAVE___THREAD
45- static struct {
46- bool active;
47- uid_t uid;
48- gid_t gid;
49- size_t setlen;
50- uintptr_t gidset;
51- } __thread cache;
52-
53 if (cache.active &&
54 cache.uid == uid &&
55 cache.gid == gid &&
56--
572.23.0
58
diff --git a/meta-networking/recipes-connectivity/samba/samba_4.10.7.bb b/meta-networking/recipes-connectivity/samba/samba_4.10.7.bb
index d13a6b4db..1b2bc087d 100644
--- a/meta-networking/recipes-connectivity/samba/samba_4.10.7.bb
+++ b/meta-networking/recipes-connectivity/samba/samba_4.10.7.bb
@@ -24,6 +24,8 @@ SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
24 file://smb_conf-4.7.0.patch \ 24 file://smb_conf-4.7.0.patch \
25 file://volatiles.03_samba \ 25 file://volatiles.03_samba \
26 file://0001-waf-add-support-of-cross_compile.patch \ 26 file://0001-waf-add-support-of-cross_compile.patch \
27 file://0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch \
28 file://0002-util_sec.c-Move-__thread-variable-to-global-scope.patch \
27 " 29 "
28SRC_URI_append_libc-musl = " \ 30SRC_URI_append_libc-musl = " \
29 file://samba-pam.patch \ 31 file://samba-pam.patch \