From patchwork Wed Aug 7 16:43:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 170765 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp7382442ile; Wed, 7 Aug 2019 09:44:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeTiUOKGGZVeZ13bvu5OsPPHSGCnQL1Hh27q/NKVFjFN2zcGg1WfOgr+ADPgqwvscNARXN X-Received: by 2002:a63:460c:: with SMTP id t12mr8433116pga.69.1565196266440; Wed, 07 Aug 2019 09:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565196266; cv=none; d=google.com; s=arc-20160816; b=h3/8XLNXuxquazvCclfDYv6DsbB7YVokSGUdR39F4wGSzZGaFL+X5XQRcw5/iZm5qR cifCWLNbbqV80Ok3Yt6ieaf8+q03++ASWMHmOFI1K7WZFD28pCBLZj8dtOOpcYNdyWKY Q1CvCGQWzJhjpQzB/AmzTFZm99CvxiazBV7vd4Fta8UJVOdmn78LuteInPquZsOuFYzd xoQKuMu8goNF8IGV/fTvTGX5lF6104jsPaGKnJTAb/TrYeH8TaUO4Ze5TjUogwlLIeVL +q9b2zGl5XUtuEaeWQh7Tzqant5y/HWFkn0A9EChJ+UIfgKQJVy+9JrMNkqUZJb6DHeE nfsA== 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=yUYG5KSsLjjiuTErY2Z8CGkczZESF5Vobtswr9DydqQ=; b=jcYxU3HCNBSpVpkUKW9Ob42j7dxYKyykLeJpIotc0KggBhuoT33nOtouH/2d35mfOx CXh5lvXdjvIzIM+9UaIZE4MvCyM4CxeS9KcBphN3Zfk7HukOLEm4fAiMwaCLXqOdi96h Qw61KPCByQ3BRrbrGMOkcvC+LNE3yBouKqflQ/tfLxJiqELaMXzS6phpJPuJlqUwVFrL a/MAZv9ftM2MgVO762XsJMmP7f/vy1nutilbGYowEXNHGSXzpjT8vkqJGa4UnTUZZo69 X1re/q51KvwCaL3y+s+2rzlnn+7wnGCRdLQa8wJhHToh+rlK/+PsZ2QcfAhWuN/p/ZyT njJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=p4uq9O6K; 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 a9si50879957pfn.104.2019.08.07.09.44.26; Wed, 07 Aug 2019 09:44:26 -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=p4uq9O6K; 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 08E027F3C3; Wed, 7 Aug 2019 16:44:21 +0000 (UTC) X-Original-To: openembedded-devel@lists.openembedded.org Delivered-To: openembedded-devel@lists.openembedded.org Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by mail.openembedded.org (Postfix) with ESMTP id E87DD7F3A2 for ; Wed, 7 Aug 2019 16:43:32 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id y8so41649304plr.12 for ; Wed, 07 Aug 2019 09:43:34 -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=e5ISdWTtvtQHrK+bUPHKlCDYbYPNxjH5wSNND0tJDuM=; b=p4uq9O6KkC++oMRhrWI8xUOcP4FhkqnJyZFQ9rwS/CfmwNqSWQaTic5hDmwXu7oMi0 DXaptMFifuLZzepJEV3Y5c2vkp4BL7Tyi2tjHvn+wQOuuvabdQ8ArjoHEAY/V8mfEa8x jZUR0AYYJdT+b9nmWFID/Spd9/XG8INpS/7Kn71ehB474JDupk+3DgPcTkKqCDgFeoF6 iA50ZAATq8yYurFmMQEj0GtBBxTOIqV/1F8pGhdF6YWavfM59xJoLIo5g8X3rSCLvzAo aVYP/dIHGG3ik2yYCL6XasfMhfJmo+bb9iS5vo/crTgx3t5NvT3Ysw4A9Z3RSFwLVgRD blcg== 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=e5ISdWTtvtQHrK+bUPHKlCDYbYPNxjH5wSNND0tJDuM=; b=DAHaudHpQjm9eUxNkktpcX7nHtK9Ixn+GCHF20E3tmF59Y2ww6ZxuiDBxeFCGy3cUE /xmeQ2C/XLKKWaUx++vLP22xev+xO9sBxsJiqbU3lAA30KG3is88LKsTaK5zWb+UJW9D 1USAIjGNRotk0rSSxx0NhD+FSB5ZDqKJi8HAvkkfgvyrLdUmdvGSGsX90GoB3mnvFWU2 ommA8g4JPqnJbbx+2gtzIx8kt+iGU4CmpZB/P22/Vl054aAJO4MnIpN16Ad+EK4Z38iW wQJENI/8c68uGBkDDbq57vjtNRXK2FEC2yoAO/cbOB1E5lXgkiIXExKjTlEf19J9GRZF 0rqA== X-Gm-Message-State: APjAAAXmba3/FPHmFc2MYIOJLSKOmwvVRwrBrnxMdrcUKu0AQ8wU8OQc Gv+aOoJ1mn9/L5SDYtx6Dk8cFdHnYZM= X-Received: by 2002:a63:ff03:: with SMTP id k3mr8697603pgi.40.1565196213448; Wed, 07 Aug 2019 09:43:33 -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 o11sm168735060pfh.114.2019.08.07.09.43.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 07 Aug 2019 09:43:33 -0700 (PDT) From: Khem Raj To: openembedded-devel@lists.openembedded.org Date: Wed, 7 Aug 2019 09:43:21 -0700 Message-Id: <20190807164321.44571-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190807164321.44571-1-raj.khem@gmail.com> References: <20190807164321.44571-1-raj.khem@gmail.com> MIME-Version: 1.0 Subject: [oe] [meta-oe][PATCH 3/3] android-tools: Fix build with glibc 2.30 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 Signed-off-by: Khem Raj --- ...t-define-gettid-if-glibc-2.30-is-use.patch | 52 +++++++++++++++++++ .../android-tools/android-tools_5.1.1.r37.bb | 1 + 2 files changed, 53 insertions(+) create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch diff --git a/meta-oe/recipes-devtools/android-tools/android-tools/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch b/meta-oe/recipes-devtools/android-tools/android-tools/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch new file mode 100644 index 0000000000..8524517cb6 --- /dev/null +++ b/meta-oe/recipes-devtools/android-tools/android-tools/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch @@ -0,0 +1,52 @@ +From f4f9d24860e1b5cd4f6a014f3fda7cd33ebe5be7 Mon Sep 17 00:00:00 2001 +From: Petr Lautrbach +Date: Sat, 27 Jul 2019 08:20:20 -0700 +Subject: [PATCH] libselinux: Do not define gettid() if glibc >= 2.30 is used +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Since version 2.30 glibc implements gettid() system call wrapper, see +https://sourceware.org/bugzilla/show_bug.cgi?id=6399 + +Fixes: +cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I../include -D_GNU_SOURCE -DNO_ANDROID_BACKEND -c -o procattr.o procattr.c +procattr.c:28:14: error: static declaration of ‘gettid’ follows non-static declaration + 28 | static pid_t gettid(void) + | ^~~~~~ +In file included from /usr/include/unistd.h:1170, + from procattr.c:2: +/usr/include/bits/unistd_ext.h:34:16: note: previous declaration of ‘gettid’ was here + 34 | extern __pid_t gettid (void) __THROW; + | ^~~~~~ + +Signed-off-by: Petr Lautrbach +Acked-by: Stephen Smalley +Signed-off-by: Khem Raj +--- + src/procattr.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +--- a/src/procattr.c ++++ b/src/procattr.c +@@ -8,7 +8,19 @@ + #include "selinux_internal.h" + #include "policy.h" + +-#ifndef __BIONIC__ ++/* Bionic and glibc >= 2.30 declare gettid() system call wrapper in unistd.h and ++ * has a definition for it */ ++#ifdef __BIONIC__ ++ #define OVERRIDE_GETTID 0 ++#elif !defined(__GLIBC_PREREQ) ++ #define OVERRIDE_GETTID 1 ++#elif !__GLIBC_PREREQ(2,29) ++ #define OVERRIDE_GETTID 1 ++#else ++ #define OVERRIDE_GETTID 0 ++#endif ++ ++#if OVERRIDE_GETTID + static pid_t gettid(void) + { + return syscall(__NR_gettid); diff --git a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb index e09cd829d7..d84fcaecc9 100644 --- a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb +++ b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb @@ -41,6 +41,7 @@ SRC_URI = " \ file://extras/0001-ext4_utils-remove-selinux-extensions.patch;patchdir=system/extras \ file://extras/0002-ext4_utils-add-o-argument-to-preserve-ownership.patch;patchdir=system/extras \ file://libselinux/0001-Remove-bionic-specific-calls.patch;patchdir=external/libselinux \ + file://libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch;patchdir=external/libselinux \ file://android-tools-adbd.service \ file://gitignore \ file://adb.mk;subdir=${BPN} \