From patchwork Wed Sep 12 04:59:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 146495 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4385470ljw; Tue, 11 Sep 2018 21:59:38 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY7Ye6hRp9oFVwT3IeEtT/HyhzwP4ii754h7+MBSeb3ZYwE+09u+usKHLnXPwqdZ/rljI7v X-Received: by 2002:a63:24c4:: with SMTP id k187-v6mr114418pgk.162.1536728378698; Tue, 11 Sep 2018 21:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536728378; cv=none; d=google.com; s=arc-20160816; b=xhJnWvFJih0iHtseVjR0ZjPy49Z3mSoyu+JjCTFBS57dxVefHOE5VF14lI5hhcPBTw WFuj2BzYrCTnzlFL2zo17oJTc7zhs79SqnyqxEHIkgnT4Te8wqwZ0r4m3zkMPBWUNJff rsidQt0Mt1xxVlDsUuMRgkql8ajAfdYlxDFMPaH2dtqWjmCsxmMz4lR7Ujg52FBVmfoH wDewUZhDR9kfzU8L19gcuIsNmcM7awtdv9bPSefqkN5Jvh3mpv+EAsZgXNl0HH+l2ynw //V5aEbpZlVKf0f5t6CzPKSo1LLzuQ2g0m+sZbGHIZMXGwhptH9yCgOVU4GvKuQv+Qx2 QTEA== 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:message-id:date:to:from:dkim-signature:delivered-to; bh=dzCLpty3FfSqoOdhQZd5bO9+CEIiOnfpNl6j502ypiA=; b=ei2N4QfMdQ+EsMItLZ/JQlNWKAJfpwwyZaag63ifjvwjlAulCgsJQ50TWsQIcX5Dxe 7leWQBo3nNCe4lV7CgW/fc/H3mILxN5qld/V/dNG9B1C7R46eZlpxiAjVHrpld9qjhep ejQoH9xDe3sdWjjRww3mDoCU0v696jJeHue7rc1X/1tXKGhTJsh4YGBLBzAboTEa1oZo lFY4aePOE7TYyoXP24NSdhEEHR5TfeJPfX40kXhEnBos607YS4hEGGREQE9GhzF/2fpE qS8g1PGrgr1GQlxge0fU8FwOa92u5nRGR0zmaFqKq46C5EB6F2tCqw44ce5adShvd0nV UYUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=NWBhxXdT; 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 b34-v6si22606308pla.84.2018.09.11.21.59.38; Tue, 11 Sep 2018 21:59:38 -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=NWBhxXdT; 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 layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 9954A795ED; Wed, 12 Sep 2018 04:59:36 +0000 (UTC) X-Original-To: openembedded-devel@lists.openembedded.org Delivered-To: openembedded-devel@lists.openembedded.org Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by mail.openembedded.org (Postfix) with ESMTP id 96D7379498 for ; Wed, 12 Sep 2018 04:59:35 +0000 (UTC) Received: by mail-pg1-f181.google.com with SMTP id 7-v6so397538pgf.2 for ; Tue, 11 Sep 2018 21:59:36 -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:mime-version :content-transfer-encoding; bh=GORSd0PFV3NbEdTPK+y8DJm4OyMi9L3M7dR9LPSMpFM=; b=NWBhxXdT0KDvF+P4fOZE6xoE3ypco8n7phl6HwTNq7K1pbCyxudKHyT+oneajX9ovx XTecnJ8nHDfd3fbGkxeEXWeAl4ISEl/FBFRbCh1vXVulawV0RY1e/oZ+YuieZ+WcaIpw paMXdj3/MOE5EkUBMTIf+Xr5fGg7bL8I65c4aHbcwUJtwPaw5DZiQK9m0BxL3m0+83Vl GR4HqUu8Uit6OVDOCosjG68LUk4fc30oPqW/PHtAA6aqnptDAk/UobvUM/T7Wngc3FjK U0tdfCEphqtRUZtMbm1+yv0kAHoHySO2qiNCnb6Sf4+WNZw9UZgIa9e44MwgnENsrMIl yuEA== 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:mime-version :content-transfer-encoding; bh=GORSd0PFV3NbEdTPK+y8DJm4OyMi9L3M7dR9LPSMpFM=; b=XZuLj5Z6VEWZURPCcAUaq8/QleSq3b2txxL2XlRNifWQDqgqCVwPHc21fP87o3POju 726KViVxdXkPEBs3hy4E0OT7A1nRYc0C6pgFAHc04PJBvV9whSHBo7ptcurDXfto807F 0R4FotYhR1HPMpr52di499DXld78eLMOwyt2+rShblAqFfDfE6FHvgLHUH6+O/Fdg5oS e8ZSJMTF/56R297bJ7bc3nQCAdj21DNHpyYVf2cKBgb119K43rybuKbHYVYo3g0UK6wK vwaSopEyH0Cxy7f7UG8HSdWKrFmUt49vb2GTJFs8PYf4R1lxqKEHKyn6Y5smlvkgVtE9 dv5A== X-Gm-Message-State: APzg51BNLLrYRK+34iMTAQ3mQdD1Ql8LPSSNMSCWR5ZUJhd9QFZHHvvi Q8Zxeft1y8q28ulrHhGEAZsyVA3C X-Received: by 2002:a65:4289:: with SMTP id j9-v6mr105662pgp.284.1536728376080; Tue, 11 Sep 2018 21:59:36 -0700 (PDT) Received: from localhost.localdomain ([2601:646:877f:9499::2887]) by smtp.gmail.com with ESMTPSA id d12-v6sm25927706pfn.118.2018.09.11.21.59.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 21:59:35 -0700 (PDT) From: Khem Raj To: openembedded-devel@lists.openembedded.org Date: Tue, 11 Sep 2018 21:59:26 -0700 Message-Id: <20180912045927.23092-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Subject: [oe] [meta-oe][PATCH 1/2] opencv: 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: , Sender: openembedded-devel-bounces@lists.openembedded.org Errors-To: openembedded-devel-bounces@lists.openembedded.org Signed-off-by: Khem Raj --- ...Check-for-clang-before-using-isystem.patch | 32 +++++++++++++++++++ .../opencv/opencv/0001-Dont-use-isystem.patch | 30 +++++++++++++++++ .../recipes-support/opencv/opencv_3.4.3.bb | 2 ++ 3 files changed, 64 insertions(+) create mode 100644 meta-oe/recipes-support/opencv/opencv/0001-Check-for-clang-before-using-isystem.patch create mode 100644 meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch -- 2.19.0 -- _______________________________________________ Openembedded-devel mailing list Openembedded-devel@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-devel diff --git a/meta-oe/recipes-support/opencv/opencv/0001-Check-for-clang-before-using-isystem.patch b/meta-oe/recipes-support/opencv/opencv/0001-Check-for-clang-before-using-isystem.patch new file mode 100644 index 0000000000..319071a311 --- /dev/null +++ b/meta-oe/recipes-support/opencv/opencv/0001-Check-for-clang-before-using-isystem.patch @@ -0,0 +1,32 @@ +From fa76d8646bb2b9b514728eeef41afed7c43a36f2 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 11 Sep 2018 18:18:33 -0700 +Subject: [PATCH] Check for clang before using -isystem + +When cross compiling with clang, the internal C++ headers are not found +when adding sysroot to -isystem, that is redundant anyway because it +will look for headers insider --sysroot path with same quality as it +would do with -isystem otherwise + +Upstream-Status: Submitted [https://github.com/opencv/opencv/pull/12504] +Signed-off-by: Khem Raj +--- + cmake/OpenCVUtils.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake +index fae91c165f..60c20192dc 100644 +--- a/cmake/OpenCVUtils.cmake ++++ b/cmake/OpenCVUtils.cmake +@@ -259,7 +259,7 @@ function(ocv_include_directories) + ocv_is_opencv_directory(__is_opencv_dir "${dir}") + if(__is_opencv_dir) + list(APPEND __add_before "${dir}") +- elseif(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND ++ elseif(((CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0") OR CV_CLANG) AND + dir MATCHES "/usr/include$") + # workaround for GCC 6.x bug + else() +-- +2.18.0 + diff --git a/meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch b/meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch new file mode 100644 index 0000000000..bf0b80a30b --- /dev/null +++ b/meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch @@ -0,0 +1,30 @@ +From 7144c44ec70dee73a628463b99ffeed74b1a8ef6 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 11 Sep 2018 00:21:18 -0700 +Subject: [PATCH] Dont use isystem + +clang really does not like it + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + cmake/OpenCVPCHSupport.cmake | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake +index f9b1b48b65..fe27a136f5 100644 +--- a/cmake/OpenCVPCHSupport.cmake ++++ b/cmake/OpenCVPCHSupport.cmake +@@ -18,6 +18,8 @@ IF(CV_GCC) + SET(PCHSupport_FOUND TRUE) + ENDIF() + ++ SET(CMAKE_INCLUDE_SYSTEM_FLAG_C "-I") ++ SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-I") + SET(_PCH_include_prefix "-I") + SET(_PCH_isystem_prefix "-isystem") + SET(_PCH_define_prefix "-D") +-- +2.18.0 + diff --git a/meta-oe/recipes-support/opencv/opencv_3.4.3.bb b/meta-oe/recipes-support/opencv/opencv_3.4.3.bb index 403146e7cd..0a99700b4a 100644 --- a/meta-oe/recipes-support/opencv/opencv_3.4.3.bb +++ b/meta-oe/recipes-support/opencv/opencv_3.4.3.bb @@ -51,6 +51,8 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \ file://0003-To-fix-errors-as-following.patch \ file://fixpkgconfig.patch \ file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \ + file://0001-Dont-use-isystem.patch \ + file://0001-Check-for-clang-before-using-isystem.patch \ " PV = "3.4.3+git${SRCPV}"