From patchwork Fri Sep 6 16:32:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 173270 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp951109ilq; Fri, 6 Sep 2019 09:33:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQQHSrbIhWPh8dDl+/rkEpe5pLFh81ZW+PbW7yGSYZxs9M2nsjAB/jgEEjaGN902KEpsQ2 X-Received: by 2002:a17:90a:b898:: with SMTP id o24mr10797249pjr.41.1567787605683; Fri, 06 Sep 2019 09:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567787605; cv=none; d=google.com; s=arc-20160816; b=WORwsXGoS/nUfC6qsESSWL3vxXCRw84xt6UdAf1KXhOWt0ueuJrOm5nJqnmyz8Pd6I L1KwM+QYrK0XEkyh+OP85XOKgIjSGMMTZjemfPUsJSHRJyXdDLRklnXylDqR9NPVhdvr UVV+VsCvMcACNDBN+t3EVZ8q8Wcs+evZNBjWNMCGiZjZMwYZR3TloJEQXkXnlS8krknH OQZ6oroT6fWRTeKLl7cyTQ8glvHXjLp8madm8w+4wbpO6U/13mAN5eouZycNg7GcNlfd 4+fdC1e2+hCkNzSPZy/ut5fG7tpzz3BSIRU5bQChS7WeyZIyp96Rt00IUCxa9C7rf4dT yLEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:delivered-to; bh=XUHbzy+WholZOHr9PGZX8mcUdfWYmxA0nGKvhUdSWDY=; b=KqF9NSV4E3+8refROMH5YUUiFsj0+6gEVyhPU+PVxDIscKQeq6AXQYrajRvvX/QP2e K2qMHd6gqFR42q4sX1BqPQECbOxRi5Cp1dmAScsE+BSbEaGQJzaVg3IiDkT3V6uPuvRg LFpFoWorDmkmyHMIGlL3sBoON9diIc8RDJYiNyCTAP4qIlsvwonzcKQaN67PLBbgRDCA RR3tIjy8n5Lg2URNFd9PneSP2mk+rDZmFOBzFgae9l/7Pu53ymSA2mbLmY8aurwlKhTS 9d39myVAHOBsERHd7K494GzvgSpSgkkW9KX3EjbbpzLtd9yB6mbgG6E9N66r4EXnthsw fwOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=BYMcvhOQ; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id d7si4623710pgf.377.2019.09.06.09.33.25; Fri, 06 Sep 2019 09:33:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=BYMcvhOQ; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 042DD7F44B; Fri, 6 Sep 2019 16:33:19 +0000 (UTC) X-Original-To: openembedded-devel@lists.openembedded.org Delivered-To: openembedded-devel@lists.openembedded.org Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mail.openembedded.org (Postfix) with ESMTP id E4DE67F43B for ; Fri, 6 Sep 2019 16:32:54 +0000 (UTC) Received: by mail-pg1-f175.google.com with SMTP id u17so3780480pgi.6 for ; Fri, 06 Sep 2019 09:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IygpkDQ34UBatYPzsQRWJO9tlwmIHZUz1spQC4CpX4I=; b=BYMcvhOQjJ/w+C09j8MAwAej7avRkz8tynGGz90L5J08uXPs7+pkOxaGaj8HO1PFdh Zu3LPjaEqAOc4L332nZaC/aKigg6C9rIg+8tiGVhniI1d2ILEptmr006uYjCYjjzhvJl JRgMS6v0ctOU5CbLIOxuCTVLWPVD32WYmNEXnEMdnh9aYLrjYbEHt+I6TmeNWecE5NDx zGlY0T+heiVH0TCfvzFdefzPl3lcyZ4soSnSWWa4QFTqCCrwkEYFfxdwsbo8VWMnYT8C V1OdkhjwcSbYpNDM4ClJp9Ph5hYKAp8bUVkohLak8z1QTEIpMp1lFT5enwDxU99tCNsW kBCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IygpkDQ34UBatYPzsQRWJO9tlwmIHZUz1spQC4CpX4I=; b=jVhl18rtPP8YIufrS5MRigIleaF4waNI3OQU7JN3L9atr8Pi0k1wT+OmXhX/0aWeQE baHsv2Lr6qV4LzaHJ9oHYeIPERex5vy9tIQWOVOMxptX7WF4NsgZbe0fqVQ+ucQUNKl+ Q3EFav7g1rbnG55ZLmYDBor8o/N4/JmRudS9pXuKWkeGQ3xKhq9zKJenUMVGe/YdzZ0Y pXsHdNB1KCHd7tfv2jWmlBjjQHryl1R8fol43Txq9JlRYlmTrgsEA0B1AorUZWTO+8S1 K8xYmJmq4CSyVXtR1yWcpMFzTjOX/PbSkFxz3HPFu2T+PTeK2aS815i01ku3C0QEz7qI LSyw== X-Gm-Message-State: APjAAAV1LHxBDtMTV8rxdjlyuxtmsCIiOkXDDvtOVzssSgx4JFrQpU6c p7pVxr9hwY/nMLe0nAW9JizUOTytgh4= X-Received: by 2002:a63:a011:: with SMTP id r17mr8877221pge.219.1567787575252; Fri, 06 Sep 2019 09:32:55 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net (c-73-71-176-3.hsd1.ca.comcast.net. [73.71.176.3]) by smtp.gmail.com with ESMTPSA id t8sm2218205pjq.30.2019.09.06.09.32.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2019 09:32:54 -0700 (PDT) From: Khem Raj To: openembedded-devel@lists.openembedded.org Date: Fri, 6 Sep 2019 09:32:42 -0700 Message-Id: <20190906163242.4770-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190906163242.4770-1-raj.khem@gmail.com> References: <20190906163242.4770-1-raj.khem@gmail.com> MIME-Version: 1.0 Subject: [oe] [meta-networking][PATCH 3/3] samba: Fix configure tests to work with clang X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-devel-bounces@lists.openembedded.org Errors-To: openembedded-devel-bounces@lists.openembedded.org Do not use nested functions ( main inside main ) Use global scope for __thread variables Signed-off-by: Khem Raj --- ...ipt-Avoid-generating-nested-main-fun.patch | 30 ++++++++++ ...ve-__thread-variable-to-global-scope.patch | 58 +++++++++++++++++++ .../samba/samba_4.10.7.bb | 2 + 3 files changed, 90 insertions(+) create mode 100644 meta-networking/recipes-connectivity/samba/samba/0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch create mode 100644 meta-networking/recipes-connectivity/samba/samba/0002-util_sec.c-Move-__thread-variable-to-global-scope.patch -- 2.23.0 -- _______________________________________________ Openembedded-devel mailing list Openembedded-devel@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-devel 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 0000000000..de7f311834 --- /dev/null +++ b/meta-networking/recipes-connectivity/samba/samba/0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch @@ -0,0 +1,30 @@ +From 3a935c638605bfb392ca7780d22c08c1a0a71e71 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 5 Sep 2019 21:37:33 -0700 +Subject: [PATCH 1/2] lib/replace/wscript: Avoid generating nested main + function + +clang is not happy when it sees another main nested inside the main +function and fails the test for prctl syscall, therefore avoid adding +implicit main() here + +Signed-off-by: Khem Raj +--- + lib/replace/wscript | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/replace/wscript b/lib/replace/wscript +index a7fd25d..d6767fc 100644 +--- a/lib/replace/wscript ++++ b/lib/replace/wscript +@@ -137,6 +137,7 @@ def configure(conf): + } + ''', + 'HAVE_PRCTL', ++ addmain=False, + headers='sys/prctl.h', + msg='Checking for prctl syscall') + +-- +2.23.0 + 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 0000000000..6fc849337c --- /dev/null +++ b/meta-networking/recipes-connectivity/samba/samba/0002-util_sec.c-Move-__thread-variable-to-global-scope.patch @@ -0,0 +1,58 @@ +From c62a6f32ab965de2ec77a614f20f04568116835b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 5 Sep 2019 21:39:05 -0700 +Subject: [PATCH 2/2] util_sec.c: Move __thread variable to global scope + +Make clang happy otherwise it complains about variable scope + +fixes + +source3/./lib/util_sec.c:470:4: error: '__thread' variables must have global storage + } __thread cache; + ^ + +Signed-off-by: Khem Raj +--- + source3/lib/util_sec.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c +index 9408269..7390318 100644 +--- a/source3/lib/util_sec.c ++++ b/source3/lib/util_sec.c +@@ -444,6 +444,17 @@ void become_user_permanently(uid_t uid, gid_t gid) + assert_gid(gid, gid); + } + ++#ifdef HAVE___THREAD ++ struct cache_t { ++ bool active; ++ uid_t uid; ++ gid_t gid; ++ size_t setlen; ++ uintptr_t gidset; ++ }; ++ ++static __thread struct cache_t cache; ++#endif + /********************************************************** + Function to set thread specific credentials. Leave + saved-set uid/gid alone.Must be thread-safe code. +@@ -461,14 +472,6 @@ int set_thread_credentials(uid_t uid, + * available. + */ + #ifdef HAVE___THREAD +- static struct { +- bool active; +- uid_t uid; +- gid_t gid; +- size_t setlen; +- uintptr_t gidset; +- } __thread cache; +- + if (cache.active && + cache.uid == uid && + cache.gid == gid && +-- +2.23.0 + 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 d13a6b4dbb..1b2bc087d5 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 \ file://smb_conf-4.7.0.patch \ file://volatiles.03_samba \ file://0001-waf-add-support-of-cross_compile.patch \ + file://0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch \ + file://0002-util_sec.c-Move-__thread-variable-to-global-scope.patch \ " SRC_URI_append_libc-musl = " \ file://samba-pam.patch \