From patchwork Mon Jul 24 00:47:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 108536 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp3476273qge; Sun, 23 Jul 2017 17:48:07 -0700 (PDT) X-Received: by 10.98.194.93 with SMTP id l90mr14549775pfg.43.1500857287066; Sun, 23 Jul 2017 17:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500857287; cv=none; d=google.com; s=arc-20160816; b=iJR/shDi5BBudKq/OR5AMJ/mdN9tmMEUT/vSSKrWsPudpJ5379h1KE0SPU2KCt7ci2 1MaqO3DBIMH39rpi0dr/8qCgnj87v8/cwfyBClU5PgdI1ShDBFZfEW+1bXifSZo0rCAs /tghMX1QLsbC6WBs2V5tlAyBY1kLJMgNuJRD+P9RDPEwipelV2z1E+XikZGHCrmfxi0a hHLxWE1lEKNPODVn18TKFQfW4sEGyy+5iXDhPA08InaKkl9IPDsT0x+6EHmYGiofK+31 1uwQlbSMVqaLFv9Xth6MLADTmH7u4dsQCh7/tWFm/YIbKFgg6tWuEsQxGD+ERxHLvo5q wPSQ== 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:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=YJ9xE8ozmWzbdUknBILFW4T177JmOrwJvnNr8MFohIk=; b=ZbDakp0k6BEUTuA5zD62UuLHBq1+Kpm6p0HbaRD3U2ffHdfe9oNzxQhv1yypZKOvNV FdxNTGlQD7Tn8TieereuW1pncjXhzrTezH2tcm18FbyqBvWbNzUZhAbOsahvUWfS4XZr wANCB0y9yb4TvwsAzvPpdsRc8nDovWOhsc4RYW40j9VfS5slHg1GgQ+2OTE/pQZC+ml9 zl393t0Bcle54/+lIF52af6vyIQvBHBGfToQHA2y9s5WGhGxBO/+O1S0+lPLNfpB+Wb4 RsWUvACUvREGpeuvYsWcOkvYrAL+3JHHfhEfy5MmhNEiWU1aQ82JavTtMQoyuhCkAH3E pNtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=Kv8o+IPb; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-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 i6si5945710pfb.630.2017.07.23.17.48.06; Sun, 23 Jul 2017 17:48:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-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=Kv8o+IPb; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-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 7362778366; Mon, 24 Jul 2017 00:47:59 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by mail.openembedded.org (Postfix) with ESMTP id 5F034606D0 for ; Mon, 24 Jul 2017 00:47:56 +0000 (UTC) Received: by mail-pf0-f194.google.com with SMTP id k72so5811123pfj.0 for ; Sun, 23 Jul 2017 17:47:58 -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; bh=vHhen8cgVPReQg+Sdisdqc9sqNaXfct+wTmAdYkgGzM=; b=Kv8o+IPbO0Icaed6I6aUsDNdQPAlKCVV20UdkThI3vXiOP1NN0+AFXsG8sJc3eFtPc sVSxtJF//0/El5cRoG6IWURGz3YmtRQjm4r5bmvDIJs1K//xqbaoPtN3ESOacSw/HYWs U3u+oVtClDIblT87BBpnF+BWtKXQvJmp6yZeHCOy7kUDlmcejbBUeYJlbVZJp3YFIqt2 armrL6IjJihusZaaQ8azvg++HbPh1KJPPoCovXenm4Tmrh2IXZUBfkdeNKBUDWp/JNbL DOeWNt6pOHd2uaOmDDRNGUMPwHjY0jdbVkNyIq5vZlhFdWfwkyq+ICMgwJtE7EfJ3M9c 7DgA== 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; bh=vHhen8cgVPReQg+Sdisdqc9sqNaXfct+wTmAdYkgGzM=; b=kHNMzibqag0oqrMwu3rB9nURhjBCyGjszjHidhTtZa23VkWvp8sIMViQkAjttEprla oAwOg+bg+JurSzQqvIu3TRzAd1FUXB7Vl+ZeKeAeWG4PUlStNb78i4C5f1KfTG8iHAV1 30jzXfKuv+zn+iJs39jwNvEecAPe0TNREDq09pt2ihGxvhCYAZicX+3lKJrv7DrJuBct Zh7lzmdy3kMPUW/68dWIdcQWSiCBMfA65Snxy1AnFDRayTtPNj7j00Ao03sUPy0Yolxl r3XMaCvMvfXnGcJY5DIHPR85swE0vm4/KJ6E4xaYZmTRbgKn5ZNkIS0y4kCzZO0/tPB1 /QfA== X-Gm-Message-State: AIVw112w8YxRZgShZW4Cs92y+lhiHU7W9OD3dLKiwtGi3atE6j5EoVtM QW0xZVpihX5S+Fiy X-Received: by 10.98.68.76 with SMTP id r73mr14410554pfa.152.1500857278194; Sun, 23 Jul 2017 17:47:58 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8882:b8c::9b53]) by smtp.gmail.com with ESMTPSA id s3sm18228742pgn.70.2017.07.23.17.47.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Jul 2017 17:47:57 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Sun, 23 Jul 2017 17:47:43 -0700 Message-Id: <20170724004748.14778-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.13.3 Subject: [OE-core] [PATCH 1/6] ossp-uuid, libffi, libgcrypt: Pass --tag=CC option to libtool X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org libtool tries to guess the --tag value based on CC/CXX environment variables and the compile commandline generated by makefiles. This heuristics however fails when we construct CC variables in OE and add security flags to it, especially -fPIE -pie which are added by external compilers e.g. clang particularly. It fails because libtool removed PIE flags from compiler cmdline intelligently if it figures out that its building a library, which means that the CC variable passed from cmdline does not match with the compiler cmdline constructed by libtool and we end up with errors like | arm-bec-linux-musleabi-libtool: compile: unable to infer tagged configuration | arm-bec-linux-musleabi-libtool: error: specify a tag with '--tag' This works with internal gcc toolchain because we configure gcc for PIE when hardening is selected and dont pass -fPIE -pie options explicitly but this is not an option for clang, and some external gcc toolchains using older gcc This patch adds the --tag option to help libtool set correct tags in packages where it cant get it right via its heuristics Signed-off-by: Khem Raj --- .../ossp-uuid/ossp-uuid/libtool-tag.patch | 21 +++++++++++++++++++++ meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb | 2 ++ meta/recipes-support/libffi/libffi_3.2.1.bb | 3 ++- meta/recipes-support/libgcrypt/libgcrypt_1.7.8.bb | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/ossp-uuid/ossp-uuid/libtool-tag.patch -- 2.13.3 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-devtools/ossp-uuid/ossp-uuid/libtool-tag.patch b/meta/recipes-devtools/ossp-uuid/ossp-uuid/libtool-tag.patch new file mode 100644 index 0000000000..7f601afab5 --- /dev/null +++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid/libtool-tag.patch @@ -0,0 +1,21 @@ +Repect LIBTOOLFLAGS + +This add a knob that can be controlled from env to set generic options +for libtool + +Upstream-Status: Pending +Signed-off-by: Khem Raj + +Index: uuid-1.6.2/Makefile.in +=================================================================== +--- uuid-1.6.2.orig/Makefile.in ++++ uuid-1.6.2/Makefile.in +@@ -56,7 +56,7 @@ RM = rm -f + CP = cp + RMDIR = rmdir + SHTOOL = $(S)/shtool +-LIBTOOL = @LIBTOOL@ ++LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS) + TRUE = true + POD2MAN = pod2man + PERL = @PERL@ diff --git a/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb b/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb index 85a1bcf5ca..5d9ca790e9 100644 --- a/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb +++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb @@ -27,6 +27,7 @@ SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/ file://uuid-nostrip.patch \ file://install-pc.patch \ file://ldflags.patch \ + file://libtool-tag.patch \ " SRC_URI[md5sum] = "5db0d43a9022a6ebbbc25337ae28942f" SRC_URI[sha256sum] = "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0" @@ -37,6 +38,7 @@ inherit autotools update-alternatives EXTRA_OECONF = "--without-dce --without-cxx --without-perl --without-perl-compat --without-php --without-pgsql" EXTRA_OECONF = "--includedir=${includedir}/ossp" +EXTRA_OEMAKE_class-target = "LIBTOOLFLAGS='--tag=CC'" do_configure_prepend() { # This package has a completely custom aclocal.m4, which should be acinclude.m4. diff --git a/meta/recipes-support/libffi/libffi_3.2.1.bb b/meta/recipes-support/libffi/libffi_3.2.1.bb index 43eee8efc4..b7da1c3bde 100644 --- a/meta/recipes-support/libffi/libffi_3.2.1.bb +++ b/meta/recipes-support/libffi/libffi_3.2.1.bb @@ -19,7 +19,7 @@ SRC_URI[md5sum] = "83b89587607e3eb65c70d361f13bab43" SRC_URI[sha256sum] = "d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37" EXTRA_OECONF += "--disable-builddir" - +EXTRA_OEMAKE_class-target = "LIBTOOLFLAGS='--tag=CC'" inherit autotools texinfo FILES_${PN}-dev += "${libdir}/libffi-${PV}" @@ -29,3 +29,4 @@ FILES_${PN}-dev += "${libdir}/libffi-${PV}" MIPS_INSTRUCTION_SET = "mips" BBCLASSEXTEND = "native nativesdk" + diff --git a/meta/recipes-support/libgcrypt/libgcrypt_1.7.8.bb b/meta/recipes-support/libgcrypt/libgcrypt_1.7.8.bb index 83351594ea..ec8b875efa 100644 --- a/meta/recipes-support/libgcrypt/libgcrypt_1.7.8.bb +++ b/meta/recipes-support/libgcrypt/libgcrypt_1.7.8.bb @@ -29,6 +29,7 @@ BINCONFIG = "${bindir}/libgcrypt-config" inherit autotools texinfo binconfig-disabled pkgconfig EXTRA_OECONF = "--disable-asm" +EXTRA_OEMAKE_class-target = "LIBTOOLFLAGS='--tag=CC'" PACKAGECONFIG ??= "capabilities" PACKAGECONFIG[capabilities] = "--with-capabilities,--without-capabilities,libcap"