diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-02-17 07:47:21 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-21 09:32:43 +0000 |
commit | 66a833a21c1fa600d31295799b0aabc281f40786 (patch) | |
tree | 554632408416e41bf0a0c52c9500866e496f6d09 /meta/recipes-devtools | |
parent | 91a1baaf57153a86b7e14318c9d36e1cc38e3077 (diff) | |
download | poky-66a833a21c1fa600d31295799b0aabc281f40786.tar.gz |
pseudo: Fix build when security flags are enabled
filter out PIE options
(From OE-Core rev: 138fdeacb822705f9d3d363753f93ff653e7928b)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch | 44 | ||||
-rw-r--r-- | meta/recipes-devtools/pseudo/pseudo_1.7.5.bb | 1 |
2 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch b/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch new file mode 100644 index 0000000000..43504eaab9 --- /dev/null +++ b/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From b5545c08e6c674c49aef14b47a56a3e92df4d2a7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 17 Feb 2016 07:36:34 +0000 | ||
4 | Subject: [pseudo][PATCH] configure: Prune PIE flags | ||
5 | |||
6 | LDFLAGS are not taken from environment and CFLAGS is used for LDFLAGS | ||
7 | however when using security options -fpie and -pie options are coming | ||
8 | as part of ARCH_FLAGS and they get into LDFLAGS of shared objects as | ||
9 | well so we end up with conflicting options -shared -pie, which gold | ||
10 | rejects outright and bfd linker lets the one appearning last in cmdline | ||
11 | take effect. This create quite a unpleasant situation in OE when | ||
12 | security flags are enabled and gold or not-gold options are used | ||
13 | it errors out but errors are not same. | ||
14 | |||
15 | Anyway, with this patch we filter pie options from ARCH_FLAGS | ||
16 | ouright and take control of generating PIC objects | ||
17 | |||
18 | Helps with errors like | ||
19 | |||
20 | | /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: pseudo_client.o: relocation R_X86_64_PC32 against symbol `pseudo_util_debug_flags' can not be used when making a shared object; recompile with -fPIC | ||
21 | | /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: final link failed: Bad value | ||
22 | | collect2: error: ld returned 1 exit status | ||
23 | | make: *** [lib/pseudo/lib64/libpseudo.so] Error 1 | ||
24 | |||
25 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
26 | --- | ||
27 | Upstream-Status: Submitted | ||
28 | |||
29 | configure | 2 ++ | ||
30 | 1 file changed, 2 insertions(+) | ||
31 | |||
32 | diff --git a/configure b/configure | ||
33 | index e5ef9ce..83b0890 100755 | ||
34 | --- a/configure | ||
35 | +++ b/configure | ||
36 | @@ -339,3 +339,5 @@ sed -e ' | ||
37 | s,@ARCH@,'"$opt_arch"',g | ||
38 | s,@BITS@,'"$opt_bits"',g | ||
39 | ' < Makefile.in > Makefile | ||
40 | + | ||
41 | +sed -i -e 's/\-[f]*pie//g' Makefile | ||
42 | -- | ||
43 | 1.8.3.1 | ||
44 | |||
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb b/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb index 195a50878b..88bd1f5556 100644 --- a/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb +++ b/meta/recipes-devtools/pseudo/pseudo_1.7.5.bb | |||
@@ -2,6 +2,7 @@ require pseudo.inc | |||
2 | 2 | ||
3 | SRC_URI = " \ | 3 | SRC_URI = " \ |
4 | http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \ | 4 | http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \ |
5 | file://0001-configure-Prune-PIE-flags.patch \ | ||
5 | file://fallback-passwd \ | 6 | file://fallback-passwd \ |
6 | file://fallback-group \ | 7 | file://fallback-group \ |
7 | " | 8 | " |