]> code.ossystems Code Review - openembedded-core.git/commitdiff
ossp-uuid, libffi, libgcrypt: Pass --tag=CC option to libtool
authorKhem Raj <raj.khem@gmail.com>
Mon, 24 Jul 2017 00:47:43 +0000 (17:47 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 9 Aug 2017 08:24:02 +0000 (09:24 +0100)
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 <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-devtools/ossp-uuid/ossp-uuid/libtool-tag.patch [new file with mode: 0644]
meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb
meta/recipes-support/libffi/libffi_3.2.1.bb
meta/recipes-support/libgcrypt/libgcrypt_1.7.8.bb

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 (file)
index 0000000..7f601af
--- /dev/null
@@ -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 <raj.khem@gmail.com>
+
+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@
index 85a1bcf5caa886f72cd3fb60c8c316181d1db779..5d9ca790e98d3c112f96cbe5226be8082641795f 100644 (file)
@@ -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.
index 2a3f4b743dd8a862473f5a2653301bb9d366eb65..57989a260247742b8cd80775e6daa82e7219f96a 100644 (file)
@@ -20,7 +20,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}"
@@ -30,3 +30,4 @@ FILES_${PN}-dev += "${libdir}/libffi-${PV}"
 MIPS_INSTRUCTION_SET = "mips"
 
 BBCLASSEXTEND = "native nativesdk"
+
index 83351594ea137682f0575630ecf6ebf9dbb2efde..ec8b875efa97e423d30e7b407791ffa74a315da0 100644 (file)
@@ -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"