diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-07-23 17:47:43 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-09 09:24:15 +0100 |
commit | 26d043bf26d7a5489afbe688cb452c4bdd6a91c6 (patch) | |
tree | e3e69dd06ba121fafa93e7a1b647e7f94a4ef680 | |
parent | 1cce7f885cf143370c989381ae8c8f4833e7cbd6 (diff) | |
download | poky-26d043bf26d7a5489afbe688cb452c4bdd6a91c6.tar.gz |
ossp-uuid, libffi, libgcrypt: Pass --tag=CC option to libtool
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
(From OE-Core rev: 0505075ae8d339ba097aebb82b4d0ae62f87c0a9)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
4 files changed, 26 insertions, 1 deletions
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 @@ | |||
1 | Repect LIBTOOLFLAGS | ||
2 | |||
3 | This add a knob that can be controlled from env to set generic options | ||
4 | for libtool | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | |||
9 | Index: uuid-1.6.2/Makefile.in | ||
10 | =================================================================== | ||
11 | --- uuid-1.6.2.orig/Makefile.in | ||
12 | +++ uuid-1.6.2/Makefile.in | ||
13 | @@ -56,7 +56,7 @@ RM = rm -f | ||
14 | CP = cp | ||
15 | RMDIR = rmdir | ||
16 | SHTOOL = $(S)/shtool | ||
17 | -LIBTOOL = @LIBTOOL@ | ||
18 | +LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS) | ||
19 | TRUE = true | ||
20 | POD2MAN = pod2man | ||
21 | 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/ | |||
27 | file://uuid-nostrip.patch \ | 27 | file://uuid-nostrip.patch \ |
28 | file://install-pc.patch \ | 28 | file://install-pc.patch \ |
29 | file://ldflags.patch \ | 29 | file://ldflags.patch \ |
30 | file://libtool-tag.patch \ | ||
30 | " | 31 | " |
31 | SRC_URI[md5sum] = "5db0d43a9022a6ebbbc25337ae28942f" | 32 | SRC_URI[md5sum] = "5db0d43a9022a6ebbbc25337ae28942f" |
32 | SRC_URI[sha256sum] = "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0" | 33 | SRC_URI[sha256sum] = "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0" |
@@ -37,6 +38,7 @@ inherit autotools update-alternatives | |||
37 | 38 | ||
38 | EXTRA_OECONF = "--without-dce --without-cxx --without-perl --without-perl-compat --without-php --without-pgsql" | 39 | EXTRA_OECONF = "--without-dce --without-cxx --without-perl --without-perl-compat --without-php --without-pgsql" |
39 | EXTRA_OECONF = "--includedir=${includedir}/ossp" | 40 | EXTRA_OECONF = "--includedir=${includedir}/ossp" |
41 | EXTRA_OEMAKE_class-target = "LIBTOOLFLAGS='--tag=CC'" | ||
40 | 42 | ||
41 | do_configure_prepend() { | 43 | do_configure_prepend() { |
42 | # This package has a completely custom aclocal.m4, which should be acinclude.m4. | 44 | # 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 2a3f4b743d..57989a2602 100644 --- a/meta/recipes-support/libffi/libffi_3.2.1.bb +++ b/meta/recipes-support/libffi/libffi_3.2.1.bb | |||
@@ -20,7 +20,7 @@ SRC_URI[md5sum] = "83b89587607e3eb65c70d361f13bab43" | |||
20 | SRC_URI[sha256sum] = "d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37" | 20 | SRC_URI[sha256sum] = "d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37" |
21 | 21 | ||
22 | EXTRA_OECONF += "--disable-builddir" | 22 | EXTRA_OECONF += "--disable-builddir" |
23 | 23 | EXTRA_OEMAKE_class-target = "LIBTOOLFLAGS='--tag=CC'" | |
24 | inherit autotools texinfo | 24 | inherit autotools texinfo |
25 | 25 | ||
26 | FILES_${PN}-dev += "${libdir}/libffi-${PV}" | 26 | FILES_${PN}-dev += "${libdir}/libffi-${PV}" |
@@ -30,3 +30,4 @@ FILES_${PN}-dev += "${libdir}/libffi-${PV}" | |||
30 | MIPS_INSTRUCTION_SET = "mips" | 30 | MIPS_INSTRUCTION_SET = "mips" |
31 | 31 | ||
32 | BBCLASSEXTEND = "native nativesdk" | 32 | BBCLASSEXTEND = "native nativesdk" |
33 | |||
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" | |||
29 | inherit autotools texinfo binconfig-disabled pkgconfig | 29 | inherit autotools texinfo binconfig-disabled pkgconfig |
30 | 30 | ||
31 | EXTRA_OECONF = "--disable-asm" | 31 | EXTRA_OECONF = "--disable-asm" |
32 | EXTRA_OEMAKE_class-target = "LIBTOOLFLAGS='--tag=CC'" | ||
32 | 33 | ||
33 | PACKAGECONFIG ??= "capabilities" | 34 | PACKAGECONFIG ??= "capabilities" |
34 | PACKAGECONFIG[capabilities] = "--with-capabilities,--without-capabilities,libcap" | 35 | PACKAGECONFIG[capabilities] = "--with-capabilities,--without-capabilities,libcap" |