summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-02-17 07:47:21 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-21 09:32:01 +0000
commit138fdeacb822705f9d3d363753f93ff653e7928b (patch)
treec04956962efcc741b1455a466e7f51f987893098 /meta
parent9c3d461c4d54d684b38ec4c038a1c3c2fb9923f0 (diff)
downloadopenembedded-core-138fdeacb822705f9d3d363753f93ff653e7928b.tar.gz
openembedded-core-138fdeacb822705f9d3d363753f93ff653e7928b.tar.bz2
openembedded-core-138fdeacb822705f9d3d363753f93ff653e7928b.zip
pseudo: Fix build when security flags are enabled
filter out PIE options Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch44
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_1.7.5.bb1
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 @@
+From b5545c08e6c674c49aef14b47a56a3e92df4d2a7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 17 Feb 2016 07:36:34 +0000
+Subject: [pseudo][PATCH] configure: Prune PIE flags
+
+LDFLAGS are not taken from environment and CFLAGS is used for LDFLAGS
+however when using security options -fpie and -pie options are coming
+as part of ARCH_FLAGS and they get into LDFLAGS of shared objects as
+well so we end up with conflicting options -shared -pie, which gold
+rejects outright and bfd linker lets the one appearning last in cmdline
+take effect. This create quite a unpleasant situation in OE when
+security flags are enabled and gold or not-gold options are used
+it errors out but errors are not same.
+
+Anyway, with this patch we filter pie options from ARCH_FLAGS
+ouright and take control of generating PIC objects
+
+Helps with errors like
+
+| /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
+| /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
+| collect2: error: ld returned 1 exit status
+| make: *** [lib/pseudo/lib64/libpseudo.so] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ configure | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure b/configure
+index e5ef9ce..83b0890 100755
+--- a/configure
++++ b/configure
+@@ -339,3 +339,5 @@ sed -e '
+ s,@ARCH@,'"$opt_arch"',g
+ s,@BITS@,'"$opt_bits"',g
+ ' < Makefile.in > Makefile
++
++sed -i -e 's/\-[f]*pie//g' Makefile
+--
+1.8.3.1
+
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
SRC_URI = " \
http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \
+ file://0001-configure-Prune-PIE-flags.patch \
file://fallback-passwd \
file://fallback-group \
"