From patchwork Wed Jul 26 18:58:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 108791 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1148555qge; Wed, 26 Jul 2017 11:59:40 -0700 (PDT) X-Received: by 10.84.136.1 with SMTP id 1mr1847057plk.74.1501095579796; Wed, 26 Jul 2017 11:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501095579; cv=none; d=google.com; s=arc-20160816; b=mYtF2gWJvTVWGoVRvQnAzNoIvWAawthgn4BPK4x6c0E4rvNmfRVFlxeGYErZ5dac43 su2pKfB/A63fLmnS7Yp6k1VAKbY2KGhwitW9iPKCUo9fHjiTvTLDI2lhUaHDYIxif8M9 E64gnvw+H7Dm0qAs6W/XLolizsM7ERA89hV6JPrCsGIkL2DeW/6J09urwfvbsImQlbj9 fi1jc9sJ1bGAZ0b20NBaTk7U2D6mPAnFo5QpCriu3+1fY/H7lClZi6+giw+YQU0jwGL7 rJMuH5F3gsJK2SQQLbMUOMbA3vy1qMMFH3qoUkCl68J5s52FOIQv9euSWa+AJJrTBZXt JVMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=FQ+UqzjTZq5iT8Iiq1gUZ33NXf84hxrqyGLfZFjwP+0=; b=xIV+eTKUCYVRfSwIFIMKZqw7IwI3R6+SmAfjY6Z9BK5GZCPrQqv1Zwf6ANE48PeWQn 3AUYOVa6A/DO58w0p9/Vg75phOYq++dsixELojN46YwCAFOHJRXxnYYYm6ZtkEGQ2kCk DrdXldszHRNKKwkRnCF0qN4RLd/ZHK6dtlUpUZAM3kDguLNFhFXXwRWHuIzWr6fXJmzU raTU365zrMRHRHi1vvklKKf20a97J1CuMS7Mmssr7zwxic74HQlI2YvANnj+o/SYq1El 62z032hQG+W/XMd/jRnSGETe0l3bGrPGQvLZh83jjvK2tFU5JjJTHGPgZvl6ieWNk2bH q3Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=hHi/AkAW; 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=NONE 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 v21si9891628pfd.453.2017.07.26.11.59.39; Wed, 26 Jul 2017 11:59:39 -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.b=hHi/AkAW; 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=NONE dis=NONE) header.from=gmail.com Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 6E68D7825F; Wed, 26 Jul 2017 18:58:56 +0000 (UTC) X-Original-To: openembedded-devel@lists.openembedded.org Delivered-To: openembedded-devel@lists.openembedded.org Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by mail.openembedded.org (Postfix) with ESMTP id 8396E77B6E for ; Wed, 26 Jul 2017 18:58:37 +0000 (UTC) Received: by mail-pg0-f65.google.com with SMTP id d193so18107068pgc.2 for ; Wed, 26 Jul 2017 11:58:39 -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; bh=+hA67uAWcS6j6Wou2BUrPQYR6j4EHYSSNHES4Ugogn0=; b=hHi/AkAWr1zR2qEHs7kQ8caCTvMMPWzWjpYoAOpRtVQj5l/SlaJFSB/rZhA/4LyGME 4wjXinFSyo9dZIfASIvdg6UxbcLtl3liO9cV3Zr6fxj19qA4Cb269Y8heZD/XevQqX4m x3vfqlvoplX9Js/2Ews+84MORiFt9guVBQD0PtLaoL7dugYyP4yqacw0WG1ige71bls6 Ji7TEkea66xOkw1CnbhPTzGM8HHW5EFmv3Y2+XiMQEpL2X/jAvPs1XAEgzwIKGIHjQ5H b5o5quUXzMssvTlDKsRT6qCLq2GsVMT4RcOzgNthbD77WQDYjorTFj4LTHmKwthWUZ9V XAuw== 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; bh=+hA67uAWcS6j6Wou2BUrPQYR6j4EHYSSNHES4Ugogn0=; b=Bcc44WKlPJW3jBxGpIEkUC5vWol5UIZVXAudXxiMjdCLy0iSfBYmhZQvdOXs2IuZxF zPR+tEohatmgUot2Ud2/6KVVxryofUuUxVEd9Bhllu37xqGL0GSmct5MO2TxKWs2RlaC /1/GBxQnHC5Jw+IGQOWqUVyg4PiYMJB+Vf4hXcPK1CLHUAwxkxlCH5Or51VijOXxY0FQ LfZ8rZfgDLRk4kVZyojXsvm4PuPq69UAOsQaUyRwotDur3KCML0vA+t58tJtHMRXQ6l6 7U61YGfRGveCOp1TGsuLfgxi0SRkroD+Ms/z4HfHcbkV26quzrxjxBFVvillSaZnIGyY f10A== X-Gm-Message-State: AIVw111aiZJcwWbxNUPJLyPtpx9MbpmpiwrlzTN84Yco+xhwpG/3Sx+7 Gouo9PMCSniN2f6E X-Received: by 10.98.218.84 with SMTP id w20mr1724375pfl.240.1501095518465; Wed, 26 Jul 2017 11:58:38 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8882:b8c::9b53]) by smtp.gmail.com with ESMTPSA id s15sm33245864pfk.42.2017.07.26.11.58.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jul 2017 11:58:37 -0700 (PDT) From: Khem Raj To: openembedded-devel@lists.openembedded.org Date: Wed, 26 Jul 2017 11:58:15 -0700 Message-Id: <20170726185815.8898-7-raj.khem@gmail.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170726185815.8898-1-raj.khem@gmail.com> References: <20170726185815.8898-1-raj.khem@gmail.com> Subject: [oe] [meta-oe][PATCH 7/7] flashrom: Fix build 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: , MIME-Version: 1.0 Sender: openembedded-devel-bounces@lists.openembedded.org Errors-To: openembedded-devel-bounces@lists.openembedded.org Backport a patch from staging Signed-off-by: Khem Raj --- .../flashrom/0001-Remove-undefined-behavior.patch | 82 ++++++++++++++++++++++ .../recipes-extended/flashrom/flashrom_0.9.9.bb | 3 +- 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-extended/flashrom/flashrom/0001-Remove-undefined-behavior.patch -- 2.13.3 -- _______________________________________________ Openembedded-devel mailing list Openembedded-devel@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-devel diff --git a/meta-oe/recipes-extended/flashrom/flashrom/0001-Remove-undefined-behavior.patch b/meta-oe/recipes-extended/flashrom/flashrom/0001-Remove-undefined-behavior.patch new file mode 100644 index 000000000..51397dc55 --- /dev/null +++ b/meta-oe/recipes-extended/flashrom/flashrom/0001-Remove-undefined-behavior.patch @@ -0,0 +1,82 @@ +From d2a03b3e43043b596a79803bcb93f70e513bbb50 Mon Sep 17 00:00:00 2001 +From: Patrick Georgi +Date: Mon, 13 Mar 2017 13:48:03 +0100 +Subject: [PATCH] Remove undefined behavior + +Per clang-3.9, the compiler fails on #define ...defined(...) statements +as they're undefined behavior (apparently with different behavior +between gcc/clang and msvc, too). + +See clang's cfe repo commit r258128 for details. + +Change-Id: I82b6235e11b425fae45eebbe06b08f81c5bdbb98 +Signed-off-by: Patrick Georgi +Reviewed-on: https://review.coreboot.org/18792 +Reviewed-by: Stefan Reinauer +Tested-by: build bot (Jenkins) +--- + hwaccess.c | 18 +++++++++++++++--- + platform.h | 18 +++++++++++++++--- + 2 files changed, 30 insertions(+), 6 deletions(-) + +diff --git a/hwaccess.c b/hwaccess.c +index aede7e3..2bf6f42 100644 +--- a/hwaccess.c ++++ b/hwaccess.c +@@ -37,9 +37,21 @@ + #error "Unknown operating system" + #endif + +-#define USE_IOPL (IS_LINUX || IS_MACOSX || defined(__NetBSD__) || defined(__OpenBSD__)) +-#define USE_DEV_IO (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)) +-#define USE_IOPERM (defined(__gnu_hurd__)) ++#if IS_LINUX || IS_MACOSX || defined(__NetBSD__) || defined(__OpenBSD__) ++#define USE_IOPL 1 ++#else ++#define USE_IOPL 0 ++#endif ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) ++#define USE_DEV_IO 1 ++#else ++#define USE_DEV_IO 0 ++#endif ++#if defined(__gnu_hurd__) ++#define USE_IOPERM 1 ++#else ++#define USE_IOPERM 0 ++#endif + + #if USE_IOPERM + #include +diff --git a/platform.h b/platform.h +index c5a52ef..b2fdcd0 100644 +--- a/platform.h ++++ b/platform.h +@@ -25,9 +25,21 @@ + #define __PLATFORM_H__ 1 + + // Helper defines for operating systems +-#define IS_LINUX (defined(__gnu_linux__) || defined(__linux__)) +-#define IS_MACOSX (defined(__APPLE__) && defined(__MACH__)) /* yes, both. */ +-#define IS_WINDOWS (defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__WINDOWS__)) ++#if defined(__gnu_linux__) || defined(__linux__) ++#define IS_LINUX 1 ++#else ++#define IS_LINUX 0 ++#endif ++#if defined(__APPLE__) && defined(__MACH__) /* yes, both. */ ++#define IS_MACOSX 1 ++#else ++#define IS_MACOSX 0 ++#endif ++#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__WINDOWS__) ++#define IS_WINDOWS 1 ++#else ++#define IS_WINDOWS 0 ++#endif + + // Likewise for target architectures + #if defined (__i386__) || defined (__x86_64__) || defined(__amd64__) +-- +2.13.3 + diff --git a/meta-oe/recipes-extended/flashrom/flashrom_0.9.9.bb b/meta-oe/recipes-extended/flashrom/flashrom_0.9.9.bb index 1bd97929c..4cdd8ad23 100644 --- a/meta-oe/recipes-extended/flashrom/flashrom_0.9.9.bb +++ b/meta-oe/recipes-extended/flashrom/flashrom_0.9.9.bb @@ -3,11 +3,12 @@ LICENSE = "GPLv2" HOMEPAGE = "http://flashrom.org" LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" -DEPENDS = "pciutils libusb" +DEPENDS = "pciutils libusb libusb-compat" SRC_URI = "http://download.flashrom.org/releases/flashrom-${PV}.tar.bz2 \ file://0001-spi-Define-_XOPEN_SOURCE-to-enable-ffs-libc-API.patch \ file://sst26.patch \ + file://0001-Remove-undefined-behavior.patch \ " SRC_URI[md5sum] = "aab9c98925d9cfb5ffb28b67a6112530" SRC_URI[sha256sum] = "cb3156b0f63eb192024b76c0814135930297aac41f80761a5d293de769783c45"