diff options
Diffstat (limited to 'meta/recipes-devtools/pseudo')
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 @@ | |||
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/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 @@ | |||
1 | glibc 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 | ||
3 | to turn this off within pseudo_wrappers.c. Elsewhere we can switch to _DEFAULT_SOURCE | ||
4 | rather than _GNU_SOURCE. | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Index: 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> | ||
28 | Index: 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> | ||
47 | Index: 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 | ||
37 | diff --git a/pseudo_wrappers.c b/pseudo_wrappers.c | 37 | diff --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 | |||
128 | do_install () { | 127 | do_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 @@ | |||
1 | require pseudo.inc | 1 | require pseudo.inc |
2 | 2 | ||
3 | SRC_URI = "git://git.yoctoproject.org/pseudo;branch=master;protocol=https \ | 3 | SRC_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 | " |
9 | SRC_URI:append:class-native = " \ | 7 | SRC_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" |
12 | SRC_URI:append:class-nativesdk = " \ | 10 | SRC_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" |
15 | SRC_URI[prebuilt.sha256sum] = "ed9f456856e9d86359f169f46a70ad7be4190d6040282b84c8d97b99072485aa" | 13 | SRC_URI[prebuilt.sha256sum] = "ed9f456856e9d86359f169f46a70ad7be4190d6040282b84c8d97b99072485aa" |
16 | 14 | ||
17 | SRCREV = "0d292df61aeb886ae8ca33d9edc3b6d0ff5c0f0f" | 15 | SRCREV = "2c43381180f9cfef4c0a8bb0c1658a86c3fcc876" |
18 | S = "${WORKDIR}/git" | ||
19 | PV = "1.9.0+git" | 16 | PV = "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' |
29 | COMPATIBLE_HOST:libc-musl = 'null' | 26 | COMPATIBLE_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); | ||
33 | TOOLCHAIN = "gcc" | ||