diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2022-08-08 22:43:40 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-12 19:22:04 +0100 |
commit | f24bfd4a3e86f37c8fa525f90ec8d3e28e207729 (patch) | |
tree | 90f6dca424981097efd903480942f7ec708e82e4 /meta/recipes-core/glibc/glibc | |
parent | e08a78c4534543fd49dcadfd9edf3247b344f7a7 (diff) | |
download | poky-f24bfd4a3e86f37c8fa525f90ec8d3e28e207729.tar.gz |
glibc: fix new upstream build issue with DEBUG_BUILD build
* refresh 0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch
(just different commit SHA in master and 2.35 branch)
* add proposed fixes for build failure with DEBUG_BUILD:
http://errors.yoctoproject.org/Errors/Details/663898/
86_64-oe-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0=/usr/src/debug/glibc/2.36-r0 -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0=/usr/src/debug/glibc/2.36-r0 -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/recipe-sysroot= -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/recipe-sysroot-native= -Wl,-z,relro,-z,now -fuse-ld=bfd -nostdlib -nostartfiles -r -o TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/build-x86_64-oe-linux/elf/librtld.os '-Wl,-(' TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/build-x86_64-oe-linux/elf/dl-allobjs.os TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/build-x86_64-oe-linux/elf/rtld-libc.a -lgcc '-Wl,-)' \
-Wl,-Map,TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/build-x86_64-oe-linux/elf/librtld.os.map
x86_64-oe-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0=/usr/src/debug/glibc/2.36-r0 -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0=/usr/src/debug/glibc/2.36-r0 -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/recipe-sysroot= -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/recipe-sysroot-native= -Wl,-z,relro,-z,now -fuse-ld=bfd -nostdlib -nostartfiles -shared -o TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/build-x86_64-oe-linux/elf/ld.so.new \
-Wl,-z,relro -Wl,-z,defs -Wl,-z,now \
-Wl,-z,pack-relative-relocs \
TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/build-x86_64-oe-linux/elf/librtld.os -Wl,--version-script=TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/build-x86_64-oe-linux/ld.map \
-Wl,-soname=ld-linux-x86-64.so.2
TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/12.1.0/ld.bfd: TOPDIR/tmp-glibc/work/core2-64-oe-linux/glibc/2.36-r0/build-x86_64-oe-linux/elf/librtld.os: in function `_dl_load_cache_lookup':
/usr/src/debug/glibc/2.36-r0/git/elf/dl-cache.c:513: undefined reference to `strcpy'
collect2: error: ld returned 1 exit status
introduced in 2.36 version, with:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=6b9006bfb0
upstream report with this fix proposed:
https://sourceware.org/bugzilla/show_bug.cgi?id=29454
(From OE-Core rev: 57a0e5ebac924015d3059695e731b28067be4568)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glibc/glibc')
-rw-r--r-- | meta/recipes-core/glibc/glibc/0026-x86-Fix-define-STRCPY-guard-in-strcpy-sse2.S.patch | 28 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc/0027-elf-Replace-strcpy-call-with-memcpy-BZ-29454.patch | 32 |
2 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0026-x86-Fix-define-STRCPY-guard-in-strcpy-sse2.S.patch b/meta/recipes-core/glibc/glibc/0026-x86-Fix-define-STRCPY-guard-in-strcpy-sse2.S.patch new file mode 100644 index 0000000000..2d14a4c619 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0026-x86-Fix-define-STRCPY-guard-in-strcpy-sse2.S.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 1d4d09d9dff96f46674262534ce1f0e51a8252cb Mon Sep 17 00:00:00 2001 | ||
2 | From: Noah Goldstein <goldstein.w.n@gmail.com> | ||
3 | Date: Sun, 7 Aug 2022 22:42:30 +0800 | ||
4 | Subject: [PATCH] x86: Fix `#define STRCPY` guard in strcpy-sse2.S | ||
5 | |||
6 | `#ifndef STPCPY` is incorrect for checking if `STRCPY` is already | ||
7 | defined. It doesn't end up mattering as the whole check is | ||
8 | guarded by `#if IS_IN (libc)` but is incorrect none the less. | ||
9 | |||
10 | Upstream-Status: Submitted [https://sourceware.org/bugzilla/show_bug.cgi?id=29454 https://sourceware.org/pipermail/libc-alpha/2022-August/141289.html] | ||
11 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
12 | --- | ||
13 | sysdeps/x86_64/multiarch/strcpy-sse2.S | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/sysdeps/x86_64/multiarch/strcpy-sse2.S b/sysdeps/x86_64/multiarch/strcpy-sse2.S | ||
17 | index e29b411314..d6b9bae5f8 100644 | ||
18 | --- a/sysdeps/x86_64/multiarch/strcpy-sse2.S | ||
19 | +++ b/sysdeps/x86_64/multiarch/strcpy-sse2.S | ||
20 | @@ -22,7 +22,7 @@ | ||
21 | |||
22 | # include <sysdep.h> | ||
23 | |||
24 | -# ifndef STPCPY | ||
25 | +# ifndef STRCPY | ||
26 | # define STRCPY __strcpy_sse2 | ||
27 | # endif | ||
28 | |||
diff --git a/meta/recipes-core/glibc/glibc/0027-elf-Replace-strcpy-call-with-memcpy-BZ-29454.patch b/meta/recipes-core/glibc/glibc/0027-elf-Replace-strcpy-call-with-memcpy-BZ-29454.patch new file mode 100644 index 0000000000..1b347b3322 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0027-elf-Replace-strcpy-call-with-memcpy-BZ-29454.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From f0e36cf0b348dbc990af9f869196710ca89c28c2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Noah Goldstein <goldstein.w.n@gmail.com> | ||
3 | Date: Sun, 7 Aug 2022 23:54:19 +0800 | ||
4 | Subject: [PATCH] elf: Replace `strcpy` call with `memcpy` [BZ #29454] | ||
5 | |||
6 | GCC normally does this optimization for us in | ||
7 | strlen_pass::handle_builtin_strcpy but only for optimized | ||
8 | build. To avoid needing to include strcpy.S in the rtld build to | ||
9 | support the debug build, just do the optimization by hand. | ||
10 | |||
11 | Upstream-Status: Submitted [https://sourceware.org/bugzilla/show_bug.cgi?id=29454 https://sourceware.org/pipermail/libc-alpha/2022-August/141290.html] | ||
12 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
13 | --- | ||
14 | elf/dl-cache.c | 5 +++-- | ||
15 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/elf/dl-cache.c b/elf/dl-cache.c | ||
18 | index c02a95d9b5..03a6d236e8 100644 | ||
19 | --- a/elf/dl-cache.c | ||
20 | +++ b/elf/dl-cache.c | ||
21 | @@ -513,8 +513,9 @@ _dl_load_cache_lookup (const char *name) | ||
22 | we are accessing. Therefore we must make the copy of the | ||
23 | mapping data without using malloc. */ | ||
24 | char *temp; | ||
25 | - temp = alloca (strlen (best) + 1); | ||
26 | - strcpy (temp, best); | ||
27 | + size_t best_len = strlen (best) + 1; | ||
28 | + temp = alloca (best_len); | ||
29 | + memcpy (temp, best, best_len); | ||
30 | return __strdup (temp); | ||
31 | } | ||
32 | |||