diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-02-07 00:12:01 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-02-07 00:14:59 -0800 |
commit | 98bad0652647e2ef807c12552ac20041d335f412 (patch) | |
tree | bc2fcb99cfe7dd889ffd3c8bf24723708362a2d3 /meta-initramfs | |
parent | c00f81f02f133e276c33dc7da602c30a22496ee6 (diff) | |
download | meta-openembedded-98bad0652647e2ef807c12552ac20041d335f412.tar.gz |
klibc: Fix x86_64 build with binutils 2.36+
this patch is already on klibc mailing list
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Andrea Adami <andrea.adami@gmail.com>
Diffstat (limited to 'meta-initramfs')
-rw-r--r-- | meta-initramfs/recipes-devtools/klibc/files/0001-workaround-for-overlapping-sections-in-binary.patch | 52 | ||||
-rw-r--r-- | meta-initramfs/recipes-devtools/klibc/klibc.inc | 1 |
2 files changed, 53 insertions, 0 deletions
diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-workaround-for-overlapping-sections-in-binary.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-workaround-for-overlapping-sections-in-binary.patch new file mode 100644 index 0000000000..8ccfe447ee --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-workaround-for-overlapping-sections-in-binary.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 911130ce429cbf6a92d0fbd17f0ff638ec941df2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Petr Ovtchenkov <ptr@void-ptr.info> | ||
3 | Date: Sun, 7 Feb 2021 00:04:36 -0800 | ||
4 | Subject: [PATCH] workaround for overlapping sections in binary | ||
5 | |||
6 | Problem: binary (typesize.bin) created from object file (typesize.o) | ||
7 | with 'objcopy -O binary ... '. But typesize.o has relocatable objects that all | ||
8 | copied with offset 0. This will lead to overlapping sections in binary. | ||
9 | By fortunate syscalls.pl check magic bytes and ring the bell. | ||
10 | |||
11 | This is naive workaround: skip .note.gnu.property section that overlap | ||
12 | .rodata section. | ||
13 | |||
14 | This not a bug of objcopy, https://sourceware.org/bugzilla/show_bug.cgi?id=27314 | ||
15 | |||
16 | Related commit: | ||
17 | |||
18 | commit de6f630e6be90d6d32d8bf2fed3f856b0c32f7ba | ||
19 | Author: H. Peter Anvin <hpa at zytor.com> | ||
20 | Date: Sat Jun 10 11:15:19 2006 -0700 | ||
21 | |||
22 | [klibc] Detect the sizes of various types, and make available to sysstub.ph. | ||
23 | |||
24 | This additional code effectively queries the C compiler for the sizes of | ||
25 | various types, and makes an associative array %typesize available to | ||
26 | sysstub.ph. This is currently not used, but it's expected that some | ||
27 | architectures, e.g. s390, will need this to determine which registers | ||
28 | go where, and how many registers are needed. | ||
29 | |||
30 | Upstream-Status: Submitted [https://lists.zytor.com/archives/klibc/2021-February/004583.html] | ||
31 | |||
32 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
33 | --- | ||
34 | usr/klibc/syscalls/Kbuild | 2 +- | ||
35 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
36 | |||
37 | diff --git a/usr/klibc/syscalls/Kbuild b/usr/klibc/syscalls/Kbuild | ||
38 | index 2430b9b4..754d028e 100644 | ||
39 | --- a/usr/klibc/syscalls/Kbuild | ||
40 | +++ b/usr/klibc/syscalls/Kbuild | ||
41 | @@ -71,7 +71,7 @@ $(obj)/typesize.c: $(srctree)/$(KLIBCSRC)/syscalls.pl $(obj)/SYSCALLS.i \ | ||
42 | |||
43 | # Convert typesize.o to typesize.bin | ||
44 | quiet_cmd_mkbin = OBJCOPY $@ | ||
45 | - cmd_mkbin = $(KLIBCOBJCOPY) -O binary $< $@ | ||
46 | + cmd_mkbin = $(KLIBCOBJCOPY) -O binary --remove-section .note.gnu.property $< $@ | ||
47 | |||
48 | $(obj)/typesize.bin: $(obj)/typesize.o FORCE | ||
49 | $(call if_changed,mkbin) | ||
50 | -- | ||
51 | 2.30.0 | ||
52 | |||
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc b/meta-initramfs/recipes-devtools/klibc/klibc.inc index 6e8ec0fd56..41147eb2da 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc.inc +++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc | |||
@@ -20,6 +20,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/libs/klibc/2.0/klibc-${PV}.tar.xz \ | |||
20 | file://0001-klibc-add-getrandom-syscall.patch \ | 20 | file://0001-klibc-add-getrandom-syscall.patch \ |
21 | file://0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch \ | 21 | file://0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch \ |
22 | file://cross-clang.patch \ | 22 | file://cross-clang.patch \ |
23 | file://0001-workaround-for-overlapping-sections-in-binary.patch \ | ||
23 | " | 24 | " |
24 | 25 | ||
25 | ARMPATCHES ?= "" | 26 | ARMPATCHES ?= "" |