summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/pseudo
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/pseudo')
-rw-r--r--meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch44
-rw-r--r--meta/recipes-devtools/pseudo/files/glibc238.patch59
-rw-r--r--meta/recipes-devtools/pseudo/files/older-glibc-symbols.patch4
-rw-r--r--meta/recipes-devtools/pseudo/pseudo.inc1
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_git.bb16
5 files changed, 12 insertions, 112 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
deleted file mode 100644
index 43504eaab9..0000000000
--- a/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1From b5545c08e6c674c49aef14b47a56a3e92df4d2a7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 17 Feb 2016 07:36:34 +0000
4Subject: [pseudo][PATCH] configure: Prune PIE flags
5
6LDFLAGS are not taken from environment and CFLAGS is used for LDFLAGS
7however when using security options -fpie and -pie options are coming
8as part of ARCH_FLAGS and they get into LDFLAGS of shared objects as
9well so we end up with conflicting options -shared -pie, which gold
10rejects outright and bfd linker lets the one appearning last in cmdline
11take effect. This create quite a unpleasant situation in OE when
12security flags are enabled and gold or not-gold options are used
13it errors out but errors are not same.
14
15Anyway, with this patch we filter pie options from ARCH_FLAGS
16ouright and take control of generating PIC objects
17
18Helps 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
25Signed-off-by: Khem Raj <raj.khem@gmail.com>
26---
27Upstream-Status: Submitted
28
29 configure | 2 ++
30 1 file changed, 2 insertions(+)
31
32diff --git a/configure b/configure
33index 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--
431.8.3.1
44
diff --git a/meta/recipes-devtools/pseudo/files/glibc238.patch b/meta/recipes-devtools/pseudo/files/glibc238.patch
deleted file mode 100644
index da4b8caee3..0000000000
--- a/meta/recipes-devtools/pseudo/files/glibc238.patch
+++ /dev/null
@@ -1,59 +0,0 @@
1glibc 2.38 would include __isoc23_strtol and similar symbols. This is trggerd by
2_GNU_SOURCE but we have to set that for other definitions. Therefore play with defines
3to turn this off within pseudo_wrappers.c. Elsewhere we can switch to _DEFAULT_SOURCE
4rather than _GNU_SOURCE.
5
6Upstream-Status: Pending
7
8Index: git/pseudo_wrappers.c
9===================================================================
10--- git.orig/pseudo_wrappers.c
11+++ git/pseudo_wrappers.c
12@@ -6,6 +6,15 @@
13 * SPDX-License-Identifier: LGPL-2.1-only
14 *
15 */
16+/* glibc 2.38 would include __isoc23_strtol and similar symbols. This is trggerd by
17+ * _GNU_SOURCE but we have to set that for other definitions. Therefore play with defines
18+ * to turn this off.
19+ */
20+#include <features.h>
21+#undef __GLIBC_USE_ISOC2X
22+#undef __GLIBC_USE_C2X_STRTOL
23+#define __GLIBC_USE_C2X_STRTOL 0
24+
25 #include <assert.h>
26 #include <stdlib.h>
27 #include <limits.h>
28Index: git/pseudo_util.c
29===================================================================
30--- git.orig/pseudo_util.c
31+++ git/pseudo_util.c
32@@ -8,6 +8,14 @@
33 */
34 /* we need access to RTLD_NEXT for a horrible workaround */
35 #define _GNU_SOURCE
36+/* glibc 2.38 would include __isoc23_strtol and similar symbols. This is trggerd by
37+ * _GNU_SOURCE but we have to set that for other definitions. Therefore play with defines
38+ * to turn this off.
39+ */
40+#include <features.h>
41+#undef __GLIBC_USE_ISOC2X
42+#undef __GLIBC_USE_C2X_STRTOL
43+#define __GLIBC_USE_C2X_STRTOL 0
44
45 #include <ctype.h>
46 #include <errno.h>
47Index: git/pseudo_client.c
48===================================================================
49--- git.orig/pseudo_client.c
50+++ git/pseudo_client.c
51@@ -6,7 +6,7 @@
52 * SPDX-License-Identifier: LGPL-2.1-only
53 *
54 */
55-#define _GNU_SOURCE
56+#define _DEFAULT_SOURCE
57
58 #include <stdio.h>
59 #include <signal.h>
diff --git a/meta/recipes-devtools/pseudo/files/older-glibc-symbols.patch b/meta/recipes-devtools/pseudo/files/older-glibc-symbols.patch
index c453b5f735..f42b32b8d9 100644
--- a/meta/recipes-devtools/pseudo/files/older-glibc-symbols.patch
+++ b/meta/recipes-devtools/pseudo/files/older-glibc-symbols.patch
@@ -28,10 +28,10 @@ diff --git a/Makefile.in b/Makefile.in
28@@ -120,7 +120,7 @@ $(PSEUDODB): pseudodb.o $(SHOBJS) $(DBOBJS) pseudo_ipc.o | $(BIN) 28@@ -120,7 +120,7 @@ $(PSEUDODB): pseudodb.o $(SHOBJS) $(DBOBJS) pseudo_ipc.o | $(BIN)
29 libpseudo: $(LIBPSEUDO) 29 libpseudo: $(LIBPSEUDO)
30 30
31 $(LIBPSEUDO): $(WRAPOBJS) pseudo_client.o pseudo_ipc.o $(SHOBJS) | $(LIB) 31 $(LIBPSEUDO): $(WRAPOBJS) pseudo_client.o pseudo_client_scanf.o pseudo_ipc.o $(SHOBJS) | $(LIB)
32- $(CC) $(CFLAGS) $(CFLAGS_PSEUDO) -shared -o $(LIBPSEUDO) \ 32- $(CC) $(CFLAGS) $(CFLAGS_PSEUDO) -shared -o $(LIBPSEUDO) \
33+ $(CC) $(CFLAGS) -Lprebuilt/$(shell uname -m)-linux/lib/ $(CFLAGS_PSEUDO) -shared -o $(LIBPSEUDO) \ 33+ $(CC) $(CFLAGS) -Lprebuilt/$(shell uname -m)-linux/lib/ $(CFLAGS_PSEUDO) -shared -o $(LIBPSEUDO) \
34 pseudo_client.o pseudo_ipc.o \ 34 pseudo_client.o pseudo_client_scanf.o pseudo_ipc.o \
35 $(WRAPOBJS) $(SHOBJS) $(LDFLAGS) $(CLIENT_LDFLAGS) 35 $(WRAPOBJS) $(SHOBJS) $(LDFLAGS) $(CLIENT_LDFLAGS)
36 36
37diff --git a/pseudo_wrappers.c b/pseudo_wrappers.c 37diff --git a/pseudo_wrappers.c b/pseudo_wrappers.c
diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-devtools/pseudo/pseudo.inc
index 36283ffa74..22c934977d 100644
--- a/meta/recipes-devtools/pseudo/pseudo.inc
+++ b/meta/recipes-devtools/pseudo/pseudo.inc
@@ -124,7 +124,6 @@ do_compile:append:class-native () {
124 fi 124 fi
125} 125}
126 126
127
128do_install () { 127do_install () {
129 oe_runmake 'DESTDIR=${D}' ${MAKEOPTS} 'LIB=lib/pseudo/lib$(MARK64)' install 128 oe_runmake 'DESTDIR=${D}' ${MAKEOPTS} 'LIB=lib/pseudo/lib$(MARK64)' install
130} 129}
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index c70b509233..385b6f34d9 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -1,21 +1,18 @@
1require pseudo.inc 1require pseudo.inc
2 2
3SRC_URI = "git://git.yoctoproject.org/pseudo;branch=master;protocol=https \ 3SRC_URI = "git://git.yoctoproject.org/pseudo;branch=master;protocol=https \
4 file://0001-configure-Prune-PIE-flags.patch \
5 file://glibc238.patch \
6 file://fallback-passwd \ 4 file://fallback-passwd \
7 file://fallback-group \ 5 file://fallback-group \
8 " 6 "
9SRC_URI:append:class-native = " \ 7SRC_URI:append:class-native = " \
10 http://downloads.yoctoproject.org/mirror/sources/pseudo-prebuilt-2.33.tar.xz;subdir=git/prebuilt;name=prebuilt \ 8 http://downloads.yoctoproject.org/mirror/sources/pseudo-prebuilt-2.33.tar.xz;subdir=${BB_GIT_DEFAULT_DESTSUFFIX}/prebuilt;name=prebuilt \
11 file://older-glibc-symbols.patch" 9 file://older-glibc-symbols.patch"
12SRC_URI:append:class-nativesdk = " \ 10SRC_URI:append:class-nativesdk = " \
13 http://downloads.yoctoproject.org/mirror/sources/pseudo-prebuilt-2.33.tar.xz;subdir=git/prebuilt;name=prebuilt \ 11 http://downloads.yoctoproject.org/mirror/sources/pseudo-prebuilt-2.33.tar.xz;subdir=${BB_GIT_DEFAULT_DESTSUFFIX}/prebuilt;name=prebuilt \
14 file://older-glibc-symbols.patch" 12 file://older-glibc-symbols.patch"
15SRC_URI[prebuilt.sha256sum] = "ed9f456856e9d86359f169f46a70ad7be4190d6040282b84c8d97b99072485aa" 13SRC_URI[prebuilt.sha256sum] = "ed9f456856e9d86359f169f46a70ad7be4190d6040282b84c8d97b99072485aa"
16 14
17SRCREV = "0d292df61aeb886ae8ca33d9edc3b6d0ff5c0f0f" 15SRCREV = "2c43381180f9cfef4c0a8bb0c1658a86c3fcc876"
18S = "${WORKDIR}/git"
19PV = "1.9.0+git" 16PV = "1.9.0+git"
20 17
21# largefile and 64bit time_t support adds these macros via compiler flags globally 18# largefile and 64bit time_t support adds these macros via compiler flags globally
@@ -27,3 +24,10 @@ TARGET_CC_ARCH:remove = "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS
27 24
28# error: use of undeclared identifier '_STAT_VER' 25# error: use of undeclared identifier '_STAT_VER'
29COMPATIBLE_HOST:libc-musl = 'null' 26COMPATIBLE_HOST:libc-musl = 'null'
27
28#| ./ports/linux/pseudo_wrappers.c:80:14: error: use of unknown builtin '__builtin_apply' [-Wimplicit-function-declaration]
29#| void *res = __builtin_apply((void (*)()) real_syscall, __builtin_apply_args(), sizeof(long) * 7);
30#| ^
31#| ./ports/linux/pseudo_wrappers.c:80:57: error: use of unknown builtin '__builtin_apply_args' [-Wimplicit-function-declaration]
32#| void *res = __builtin_apply((void (*)()) real_syscall, __builtin_apply_args(), sizeof(long) * 7);
33TOOLCHAIN = "gcc"