diff options
Diffstat (limited to 'meta-initramfs/recipes-devtools/klibc')
26 files changed, 150 insertions, 254 deletions
diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-Define-in_-structs-for-non-glibc-system-libs.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-Define-in_-structs-for-non-glibc-system-libs.patch index e7a0cce837..c782cf03c8 100644 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-Define-in_-structs-for-non-glibc-system-libs.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-Define-in_-structs-for-non-glibc-system-libs.patch @@ -12,12 +12,12 @@ to infer that these structs should be defined in linux/in.h Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + usr/include/net/if.h | 11 +++++++++++ usr/include/netinet/in.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) -diff --git a/usr/include/net/if.h b/usr/include/net/if.h -index 116a176..6246b12 100644 --- a/usr/include/net/if.h +++ b/usr/include/net/if.h @@ -1,6 +1,17 @@ @@ -38,8 +38,6 @@ index 116a176..6246b12 100644 #include <sys/socket.h> #include <sys/types.h> #include <linux/if.h> -diff --git a/usr/include/netinet/in.h b/usr/include/netinet/in.h -index 2952bb2..0c95bc9 100644 --- a/usr/include/netinet/in.h +++ b/usr/include/netinet/in.h @@ -5,6 +5,42 @@ @@ -82,6 +80,6 @@ index 2952bb2..0c95bc9 100644 +#define __UAPI_DEF_IF_IFREQ 1 +#endif + + #include <sys/types.h> #include <klibc/extern.h> #include <stdint.h> - #include <endian.h> /* Must be included *before* <linux/in.h> */ diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-Define-ulocked_-fgets-fread-fwrite-aliases.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-Define-ulocked_-fgets-fread-fwrite-aliases.patch deleted file mode 100644 index eee144dc4a..0000000000 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-Define-ulocked_-fgets-fread-fwrite-aliases.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 241f423a015279cb29b7ad1a34386ef1c32007fc Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Sun, 9 Dec 2018 16:47:16 -0800 -Subject: [PATCH] Define ulocked_{fgets|fread|fwrite} aliases - -latest clang converts the normal calls to the unlocked variant -equivalents - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Cc: Andrea Adami <andrea.adami@gmail.com> ---- - usr/klibc/fgets.c | 2 ++ - usr/klibc/fread2.c | 2 ++ - usr/klibc/fwrite2.c | 2 ++ - 3 files changed, 6 insertions(+) - -diff --git a/usr/klibc/fgets.c b/usr/klibc/fgets.c -index dbf742c6..2e9fcb65 100644 ---- a/usr/klibc/fgets.c -+++ b/usr/klibc/fgets.c -@@ -25,3 +25,5 @@ char *fgets(char *s, int n, FILE *f) - - return s; - } -+char *fgets_unlocked(char *s, int n, FILE *f) -+ __alias("fgets"); -diff --git a/usr/klibc/fread2.c b/usr/klibc/fread2.c -index 7dca56b1..5c234766 100644 ---- a/usr/klibc/fread2.c -+++ b/usr/klibc/fread2.c -@@ -11,3 +11,5 @@ size_t fread(void *ptr, size_t size, size_t nmemb, FILE * f) - { - return _fread(ptr, size * nmemb, f) / size; - } -+size_t fread_unlocked(void *ptr, size_t size, size_t nmemb, FILE *f) -+ __alias("fread"); -diff --git a/usr/klibc/fwrite2.c b/usr/klibc/fwrite2.c -index cebc017c..3e0bb57d 100644 ---- a/usr/klibc/fwrite2.c -+++ b/usr/klibc/fwrite2.c -@@ -11,3 +11,5 @@ size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE * f) - { - return _fwrite(ptr, size * nmemb, f) / size; - } -+size_t fwrite_unlocked(void *ptr, size_t size, size_t nmemb, FILE *f) -+ __alias("fwrite"); --- -2.19.2 - diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-Fix-missing-include-in-sys-mman.h.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-Fix-missing-include-in-sys-mman.h.patch deleted file mode 100644 index 4bedef8052..0000000000 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-Fix-missing-include-in-sys-mman.h.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 36360b16833400de7818151be5588b16ac4fd5bc Mon Sep 17 00:00:00 2001 -From: Barret Rhoden <brho@google.com> -Date: Thu, 14 Mar 2019 17:30:38 -0400 -Subject: [PATCH] Fix missing include in sys/mman.h - -Linux commit 746c9398f5ac ("arch: move common mmap flags to -linux/mman.h") moved a few mmap flags, particularly MAP_PRIVATE, from -asm/mman.h to linux/mman.h. This broke klibc's build, which uses -MAP_PRIVATE. - -linux/mman.h includes asm/mman.h, so this commit merely includes -linux/mman.h instead of asm/mman.h. - -Signed-off-by: Barret Rhoden <brho@google.com> -Signed-off-by: Ben Hutchings <ben@decadent.org.uk> ---- -Upstream-Status: Backport [https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=d4853d030639cf3542ae39129c18b654d8d4f020] - usr/include/sys/mman.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/usr/include/sys/mman.h b/usr/include/sys/mman.h -index 56f0b65c..3fd626e7 100644 ---- a/usr/include/sys/mman.h -+++ b/usr/include/sys/mman.h -@@ -7,7 +7,7 @@ - - #include <klibc/extern.h> - #include <sys/types.h> --#include <asm/mman.h> -+#include <linux/mman.h> - - #define MAP_FAILED ((void *)-1) - --- -2.23.0 - diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch deleted file mode 100644 index 181dcfb6de..0000000000 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 4b4147b76518d31a88fb2c58cdbf2236e159a25c Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 8 Sep 2017 23:10:54 -0700 -Subject: [PATCH] Kbuild.klibc: Add path to compiler headers via -isystem - -We need to include this path so it can find compiler headers e.g. -stdarg.h which is called from wrapper stdarg.h using include_next - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - ---- - scripts/Kbuild.klibc | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc -index 101f86f..1d5cdc4 100644 ---- a/scripts/Kbuild.klibc -+++ b/scripts/Kbuild.klibc -@@ -105,7 +105,8 @@ KLIBCOBJCOPY := $(OBJCOPY) - KLIBCOBJDUMP := $(OBJDUMP) - - # klibc include paths --KLIBCCPPFLAGS := -nostdinc -iwithprefix include \ -+KLIBCCPPFLAGS := -nostdinc -iwithprefix include \ -+ -isystem $(shell $(CC) -print-file-name=include) \ - -I$(KLIBCINC)/arch/$(KLIBCARCHDIR) \ - -I$(KLIBCINC)/bits$(KLIBCBITSIZE) \ - -I$(KLIBCOBJ)/../include \ diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch deleted file mode 100644 index 1ba05a811e..0000000000 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch +++ /dev/null @@ -1,28 +0,0 @@ -From b6185401fc3daa7fa8ba2b84db3e4da3b94a9867 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 26 Jul 2017 16:13:16 -0700 -Subject: [PATCH] Kbuild.klibc: Use -print-libgcc-file-name instead of - --print-libgcc - --print-libgcc-file-name works with clang and gcc unlike --print-libgcc -which is gcc specific - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - ---- - scripts/Kbuild.klibc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc -index f500d53..101f86f 100644 ---- a/scripts/Kbuild.klibc -+++ b/scripts/Kbuild.klibc -@@ -128,7 +128,7 @@ KLIBCCFLAGS += $(KLIBCCPPFLAGS) $(KLIBCREQFLAGS) $(KLIBCARCHREQFLAGS) \ - KLIBCAFLAGS += -D__ASSEMBLY__ $(KLIBCCFLAGS) - KLIBCSTRIPFLAGS += --strip-all -R .comment -R .note - --KLIBCLIBGCC_DEF := $(shell $(KLIBCCC) $(KLIBCCFLAGS) --print-libgcc) -+KLIBCLIBGCC_DEF := $(shell $(KLIBCCC) $(KLIBCCFLAGS) -print-libgcc-file-name) - KLIBCLIBGCC ?= $(KLIBCLIBGCC_DEF) - KLIBCCRT0 := $(KLIBCOBJ)/arch/$(KLIBCARCHDIR)/crt0.o - KLIBCLIBC := $(KLIBCOBJ)/libc.a diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-always-use-bfd-linker.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-always-use-bfd-linker.patch index de04d691fe..895254889c 100644 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-always-use-bfd-linker.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-always-use-bfd-linker.patch @@ -10,6 +10,8 @@ linking issues on such distros Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch index fcf4f891a4..5ac0d4596a 100644 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch @@ -11,11 +11,11 @@ which is a bit harder in OE Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + usr/klibc/arch/arm/MCONFIG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/usr/klibc/arch/arm/MCONFIG b/usr/klibc/arch/arm/MCONFIG -index 303c6ac..48d2685 100644 --- a/usr/klibc/arch/arm/MCONFIG +++ b/usr/klibc/arch/arm/MCONFIG @@ -10,7 +10,7 @@ diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-dash-Specify-format-string-in-fmtstr.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-dash-Specify-format-string-in-fmtstr.patch deleted file mode 100644 index 46a23987f5..0000000000 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-dash-Specify-format-string-in-fmtstr.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 8beffe501c1ac5b35d62004735c4157c74183901 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Sun, 9 Jul 2017 13:51:25 -0700 -Subject: [PATCH] dash: Specify format string in fmtstr() - -Fixes build with hardening flags - -usr/dash/jobs.c:429:3: error: format not a string literal and no format arguments [-Werror=format-security] - col = fmtstr(s, 32, strsignal(st)); - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - ---- - usr/dash/jobs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c -index 009bbfe..299bcac 100644 ---- a/usr/dash/jobs.c -+++ b/usr/dash/jobs.c -@@ -426,7 +426,7 @@ sprint_status(char *s, int status, int sigonly) - goto out; - #endif - } -- col = fmtstr(s, 32, strsignal(st)); -+ col = fmtstr(s, 32, "%s", strsignal(st)); - #ifdef WCOREDUMP - if (WCOREDUMP(status)) { - col += fmtstr(s + col, 16, " (core dumped)"); diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-include-linux-sysinfo.h-directly.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-include-linux-sysinfo.h-directly.patch index 04c97fc5ee..d49dfc1924 100644 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-include-linux-sysinfo.h-directly.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-include-linux-sysinfo.h-directly.patch @@ -12,17 +12,17 @@ override to avoid this assumption Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + usr/include/sys/sysinfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/usr/include/sys/sysinfo.h b/usr/include/sys/sysinfo.h -index dba68dc..d145c0b 100644 --- a/usr/include/sys/sysinfo.h +++ b/usr/include/sys/sysinfo.h -@@ -5,7 +5,7 @@ - #ifndef _SYS_SYSINFO_H +@@ -6,7 +6,7 @@ #define _SYS_SYSINFO_H + #include <sys/types.h> -#include <linux/kernel.h> +#include <linux/sysinfo.h> diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch index 94818e3669..e4ae3728a4 100644 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch @@ -12,12 +12,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> usr/klibc/Kbuild | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild -index 98caf2e9..b34521e0 100644 --- a/usr/klibc/Kbuild +++ b/usr/klibc/Kbuild -@@ -168,7 +168,8 @@ $(SOHASH): $(SOLIB) $(SOLIB).hash - targets += interp.o +@@ -190,7 +190,8 @@ $(SOHASH): $(SOLIB) $(SOLIB).hash + targets += shared-stub.o quiet_cmd_interp = BUILD $@ - cmd_interp = $(KLIBCCC) $(klibccflags) -D__ASSEMBLY__ \ diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-add-getrandom-syscall.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-add-getrandom-syscall.patch index 0768f6d514..80e6c6b11c 100644 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-add-getrandom-syscall.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-add-getrandom-syscall.patch @@ -7,14 +7,14 @@ needed by latest kexec-tools for qemuarm64 (kashan) Signed-off-by: Andrea Adami <andrea.adami@gmail.com> --- +Upstream-Status: Pending + usr/klibc/SYSCALLS.def | 1 + 1 file changed, 1 insertion(+) -diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def -index 6b3bf4c..d4184ba 100644 --- a/usr/klibc/SYSCALLS.def +++ b/usr/klibc/SYSCALLS.def -@@ -274,6 +274,7 @@ int syslog::klogctl(int, char *, int); +@@ -275,6 +275,7 @@ int syslog::klogctl(int, char *, int); int sysinfo(struct sysinfo *); long kexec_load(void *, unsigned long, struct kexec_segment *, unsigned long); <x86_64,ppc64,s390x> long kexec_file_load(int, int, unsigned long, const char *, unsigned long); @@ -22,6 +22,3 @@ index 6b3bf4c..d4184ba 100644 /* * Low-level I/O (generally architecture-specific); --- -2.7.4 - diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-klibc_2.0.4-add-kexec_file_load-syscall.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc_2.0.4-add-kexec_file_load-syscall.patch index 3d8d987c43..16885488e4 100644 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-klibc_2.0.4-add-kexec_file_load-syscall.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc_2.0.4-add-kexec_file_load-syscall.patch @@ -7,14 +7,14 @@ for supported archs only (matched in kexec-tools) Signed-off-by: Andrea Adami <andrea.adami@gmail.com> --- +Upstream-Status: Pending + usr/klibc/SYSCALLS.def | 1 + 1 file changed, 1 insertion(+) -diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def -index c56e8f9..6b3bf4c 100644 --- a/usr/klibc/SYSCALLS.def +++ b/usr/klibc/SYSCALLS.def -@@ -273,6 +273,7 @@ int reboot::__reboot(int, int, int, void *); +@@ -274,6 +274,7 @@ int reboot::__reboot(int, int, int, void int syslog::klogctl(int, char *, int); int sysinfo(struct sysinfo *); long kexec_load(void *, unsigned long, struct kexec_segment *, unsigned long); @@ -22,6 +22,3 @@ index c56e8f9..6b3bf4c 100644 /* * Low-level I/O (generally architecture-specific); --- -2.7.4 - diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-mkfifo-Implement-mkfifo.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-mkfifo-Implement-mkfifo.patch index 3bc081d4e9..4378ca5610 100644 --- a/meta-initramfs/recipes-devtools/klibc/files/0001-mkfifo-Implement-mkfifo.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-mkfifo-Implement-mkfifo.patch @@ -6,6 +6,8 @@ Subject: [PATCH] mkfifo: Implement mkfifo Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + usr/utils/mkfifo.c | 5 +++++ 1 file changed, 5 insertions(+) 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..2f203ef0a4 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-workaround-for-overlapping-sections-in-binary.patch @@ -0,0 +1,47 @@ +From 911130ce429cbf6a92d0fbd17f0ff638ec941df2 Mon Sep 17 00:00:00 2001 +From: Petr Ovtchenkov <ptr@void-ptr.info> +Date: Sun, 7 Feb 2021 00:04:36 -0800 +Subject: [PATCH] workaround for overlapping sections in binary + +Problem: binary (typesize.bin) created from object file (typesize.o) +with 'objcopy -O binary ... '. But typesize.o has relocatable objects that all +copied with offset 0. This will lead to overlapping sections in binary. +By fortunate syscalls.pl check magic bytes and ring the bell. + +This is naive workaround: skip .note.gnu.property section that overlap +.rodata section. + +This not a bug of objcopy, https://sourceware.org/bugzilla/show_bug.cgi?id=27314 + +Related commit: + + commit de6f630e6be90d6d32d8bf2fed3f856b0c32f7ba + Author: H. Peter Anvin <hpa at zytor.com> + Date: Sat Jun 10 11:15:19 2006 -0700 + + [klibc] Detect the sizes of various types, and make available to sysstub.ph. + + This additional code effectively queries the C compiler for the sizes of + various types, and makes an associative array %typesize available to + sysstub.ph. This is currently not used, but it's expected that some + architectures, e.g. s390, will need this to determine which registers + go where, and how many registers are needed. + +Upstream-Status: Submitted [https://lists.zytor.com/archives/klibc/2021-February/004583.html] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + usr/klibc/syscalls/Kbuild | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/usr/klibc/syscalls/Kbuild ++++ b/usr/klibc/syscalls/Kbuild +@@ -71,7 +71,7 @@ $(obj)/typesize.c: $(srctree)/$(KLIBCSRC + + # Convert typesize.o to typesize.bin + quiet_cmd_mkbin = OBJCOPY $@ +- cmd_mkbin = $(KLIBCOBJCOPY) -O binary --only-section .rodata $< $@ ++ cmd_mkbin = $(KLIBCOBJCOPY) -O binary --remove-section .note.gnu.property $< $@ + + $(obj)/typesize.bin: $(obj)/typesize.o FORCE + $(call if_changed,mkbin) diff --git a/meta-initramfs/recipes-devtools/klibc/files/armv4-fix-v4bx.patch b/meta-initramfs/recipes-devtools/klibc/files/armv4-fix-v4bx.patch index 4a334fa252..7b29eaf200 100644 --- a/meta-initramfs/recipes-devtools/klibc/files/armv4-fix-v4bx.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/armv4-fix-v4bx.patch @@ -9,13 +9,15 @@ which is "" in case of armv5 or thumbs. Signed-off-by: Andrea Adami <andrea.adami@gmail.com> --- +Upstream-Status: Pending + usr/klibc/arch/arm/MCONFIG | 1 + 1 file changed, 1 insertion(+) --- a/usr/klibc/arch/arm/MCONFIG +++ b/usr/klibc/arch/arm/MCONFIG -@@ -29,6 +29,7 @@ else - KLIBCSHAREDFLAGS = -Ttext-segment 0x01800000 +@@ -23,6 +23,7 @@ else + # Extra linkflags when building the shared version of the library ifeq ($(CONFIG_AEABI),y) KLIBCREQFLAGS += -mabi=aapcs-linux -mno-thumb-interwork +KLIBCLDFLAGS += $(FIX_ARMV4_EABI_BX) diff --git a/meta-initramfs/recipes-devtools/klibc/files/cross-clang.patch b/meta-initramfs/recipes-devtools/klibc/files/cross-clang.patch new file mode 100644 index 0000000000..f39701a65e --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/cross-clang.patch @@ -0,0 +1,26 @@ +Upstream-Status: Pending + +--- a/scripts/Kbuild.klibc ++++ b/scripts/Kbuild.klibc +@@ -113,10 +113,8 @@ KLIBCCPPFLAGS := -nostdinc -iwithpref + -I$(KLIBCINC)/arch/$(KLIBCARCHDIR) \ + -I$(KLIBCINC)/bits$(KLIBCBITSIZE) \ + -I$(KLIBCOBJ)/../include \ +- -I$(KLIBCINC) +-ifeq ($(cc-name),clang) +-KLIBCCPPFLAGS += -isystem $(shell $(KLIBCCC) $(KLIBCCFLAGS) --print-file-name=include) +-endif ++ -I$(KLIBCINC) \ ++ -I$(shell $(KLIBCCC) $(KLIBCCFLAGS) --print-file-name=include) + + # kernel include paths + KLIBCKERNELSRC ?= $(srctree) +@@ -137,7 +135,7 @@ KLIBCCFLAGS += $(KLIBCCPPFLAGS) $(K + KLIBCAFLAGS += -D__ASSEMBLY__ $(KLIBCCFLAGS) + KLIBCSTRIPFLAGS += --strip-all -R .comment -R .note + +-KLIBCLIBGCC_DEF := $(shell $(KLIBCCC) $(KLIBCCFLAGS) $(if $(filter gcc,$(cc-name)),--print-libgcc,--print-libgcc-file-name)) ++KLIBCLIBGCC_DEF := $(shell $(KLIBCCC) $(KLIBCCFLAGS) --print-libgcc-file-name) + KLIBCLIBGCC ?= $(KLIBCLIBGCC_DEF) + KLIBCCRT0 := $(KLIBCOBJ)/arch/$(KLIBCARCHDIR)/crt0.o + KLIBCLIBC := $(KLIBCOBJ)/libc.a diff --git a/meta-initramfs/recipes-devtools/klibc/files/klcc-consider-sysroot.patch b/meta-initramfs/recipes-devtools/klibc/files/klcc-consider-sysroot.patch index 5f47d3f20a..af76564901 100644 --- a/meta-initramfs/recipes-devtools/klibc/files/klcc-consider-sysroot.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/klcc-consider-sysroot.patch @@ -3,6 +3,8 @@ From: Andrea Adami <andrea.adami@gmail.com> Date: Fri, 19 Sep 2014 23:09:29 +0200 --- +Upstream-Status: Pending + klcc/klcc.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-initramfs/recipes-devtools/klibc/files/klcc-cross-accept-clang-options.patch b/meta-initramfs/recipes-devtools/klibc/files/klcc-cross-accept-clang-options.patch index 3b7031e981..a3a0695637 100644 --- a/meta-initramfs/recipes-devtools/klibc/files/klcc-cross-accept-clang-options.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/klcc-cross-accept-clang-options.patch @@ -5,16 +5,34 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> --- a/klcc/klcc.in +++ b/klcc/klcc.in -@@ -207,6 +207,12 @@ while ( defined($a = shift(@ARGV)) ) { +@@ -207,6 +207,30 @@ while ( defined($a = shift(@ARGV)) ) { } elsif ( $a =~ /^--([sysroot=])(.*)$/ ) { # Override gcc encoded sysroot push(@ccopt, $a); ++ } elsif ( $a eq '-nostartfiles' ) { ++ # Allow clang options ++ push(@ccopt, $a); ++ } elsif ( $a eq '-nostdlib' ) { ++ # Allow clang options ++ push(@ccopt, $a); ++ } elsif ( $a eq '-nodefaultlibs' ) { ++ # Allow clang options ++ push(@ccopt, $a); ++ } elsif ( $a eq '-no-pie' ) { ++ # Allow clang options ++ push(@ccopt, $a); + } elsif ( $a eq '-no-integrated-as' ) { + # Allow clang options + push(@ccopt, $a); + } elsif ( $a =~ '--unwindlib=.*' ) { + # Allow clang options + push(@ccopt, $a); ++ } elsif ( $a =~ '-rtlib=.*' ) { ++ # Allow clang options ++ push(@ccopt, $a); ++ } elsif ( $a =~ '--dyld-prefix=.*' ) { ++ # Allow clang options ++ push(@ccopt, $a); } else { die "$0: unknown option: $a\n"; } diff --git a/meta-initramfs/recipes-devtools/klibc/files/klibc-config-eabi.patch b/meta-initramfs/recipes-devtools/klibc/files/klibc-config-eabi.patch deleted file mode 100644 index a6998f86d6..0000000000 --- a/meta-initramfs/recipes-devtools/klibc/files/klibc-config-eabi.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 1118cc971917abe19ddb029aa80417f6fd6bb343 Mon Sep 17 00:00:00 2001 -From: Thomas Kunze <thommycheck@gmx.de> -Date: Sat, 6 Aug 2011 05:30:14 +0000 -Subject: [PATCH] klibc: initial commit of version 1.5.24 - -Patch was imported from the OpenEmbedded git server -(git://git.openembedded.org/openembedded) -as of commit id b6764cf32ec93547531130dca364fb95e1c495f4 -Signed-off-by: Thomas Kunze <thommycheck@gmx.de> - ---- - defconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/defconfig -+++ b/defconfig -@@ -6,5 +6,5 @@ CONFIG_KLIBC_ZLIB=y - CONFIG_REGPARM=y - # ARM options - # CONFIG_KLIBC_THUMB is not set --# CONFIG_AEABI is not set -+CONFIG_AEABI=y - # CONFIG_DEBUG_INFO is not set diff --git a/meta-initramfs/recipes-devtools/klibc/files/use-env-for-perl.patch b/meta-initramfs/recipes-devtools/klibc/files/use-env-for-perl.patch index eac128cc09..d2a19909f0 100644 --- a/meta-initramfs/recipes-devtools/klibc/files/use-env-for-perl.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/use-env-for-perl.patch @@ -1,3 +1,5 @@ +Upstream-Status: Pending + Patch was imported from the OpenEmbedded git server (git://git.openembedded.org/openembedded) as of commit id 676cbb54d42c89a4832871064cfcb7ee2ad372ee @@ -10,8 +12,6 @@ that /usr/bin/env perl will always return ours (if it has been built). Signed-off-by: Tom Rini <tom_rini@mentor.com> -Index: klibc-1.5.20/klcc/makeklcc.pl -=================================================================== --- a/klcc/makeklcc.pl +++ b/klcc/makeklcc.pl @@ -26,7 +26,7 @@ sub pathsearch($) { diff --git a/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.6.bb b/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.13.bb index 4011aa231e..4011aa231e 100644 --- a/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.6.bb +++ b/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.13.bb diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.6.bb b/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.13.bb index c835fd647a..0de580781b 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.6.bb +++ b/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.13.bb @@ -3,7 +3,7 @@ SUMMARY = "klibc utils for initramfs statically compiled" FILESPATH =. "${FILE_DIRNAME}/klibc-${PV}:" PACKAGES = "${PN}" -FILES_${PN} = "" +FILES:${PN} = "" KLIBC_UTILS_VARIANT = "static" KLIBC_UTILS_PKGNAME = "klibc-static-utils" diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-utils.inc b/meta-initramfs/recipes-devtools/klibc/klibc-utils.inc index 00cb86d3e6..4e9fea88d1 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-utils.inc +++ b/meta-initramfs/recipes-devtools/klibc/klibc-utils.inc @@ -50,7 +50,7 @@ EXTRA_KLIBC_DEPS = "${@oe.utils.conditional('KLIBC_UTILS_VARIANT', 'shared', '${ PACKAGES_DYNAMIC += "^${KLIBC_UTILS_PKGNAME}-.*" -python populate_packages_prepend () { +python populate_packages:prepend () { base_bin_dir = d.expand('${base_bindir}') do_split_packages(d, base_bin_dir, '(.*)', '${KLIBC_UTILS_PKGNAME}-%s', 'Klibc util for %s', extra_depends='${EXTRA_KLIBC_DEPS}', allow_links=True, allow_dirs=True) base_sbin_dir = d.expand('${base_sbindir}') diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.6.bb b/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.13.bb index 06e71cb7b8..2f26093cbe 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.6.bb +++ b/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.13.bb @@ -3,7 +3,7 @@ SUMMARY = "klibc utils for initramfs" FILESPATH =. "${FILE_DIRNAME}/klibc-${PV}:" PACKAGES = "${PN}" -FILES_${PN} = "" +FILES:${PN} = "" KLIBC_UTILS_VARIANT = "shared" KLIBC_UTILS_PKGNAME = "klibc-utils" diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc b/meta-initramfs/recipes-devtools/klibc/klibc.inc index 26689f87e7..6093e19b7c 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc.inc +++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc @@ -2,40 +2,39 @@ DESCRIPTION = "klibc is intended to be a minimalistic libc subset for \ use with initramfs. It is deliberately written for small size, \ minimal entaglement, and portability, not speed." SECTION = "libs" -LICENSE = "BSD-3-Clause & GPL-2.0 & MIT & Zlib" +LICENSE = "BSD-3-Clause & GPL-2.0-only & MIT & Zlib" LIC_FILES_CHKSUM = "file://usr/klibc/LICENSE;md5=d75181f10e998c21eb147f6d2e43ce8b" DEPENDS = "linux-libc-headers perl-native" -SRCREV = "22b36d1ae34416bc48869619cbb0cccb2070f48f" -SRC_URI = "git://git.kernel.org/pub/scm/libs/klibc/klibc.git \ +SRC_URI = "${KERNELORG_MIRROR}/linux/libs/klibc/2.0/klibc-${PV}.tar.xz \ ${ARMPATCHES} \ file://klcc-consider-sysroot.patch \ file://klcc-cross-accept-clang-options.patch \ - file://0001-dash-Specify-format-string-in-fmtstr.patch \ file://0001-Define-in_-structs-for-non-glibc-system-libs.patch \ file://0001-include-linux-sysinfo.h-directly.patch \ file://0001-mkfifo-Implement-mkfifo.patch \ file://0001-always-use-bfd-linker.patch \ - file://0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch \ - file://0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch \ file://0001-arm-Do-not-set-a-fallback-march-and-mtune.patch \ file://0001-klibc_2.0.4-add-kexec_file_load-syscall.patch \ file://0001-klibc-add-getrandom-syscall.patch \ file://0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch \ - file://0001-Define-ulocked_-fgets-fread-fwrite-aliases.patch \ - file://0001-Fix-missing-include-in-sys-mman.h.patch \ + file://cross-clang.patch \ + file://0001-workaround-for-overlapping-sections-in-binary.patch \ " ARMPATCHES ?= "" -ARMPATCHES_arm = "file://klibc-config-eabi.patch \ +ARMPATCHES:arm = " \ file://armv4-fix-v4bx.patch \ " +SRC_URI[sha256sum] = "d673a294f742d59368222ff5c38462d81098c55063799de6fb8a7ba3d4af0436" -S = "${WORKDIR}/git" +S = "${WORKDIR}/klibc-${PV}" -OPTFLAGS = "${TUNE_CCARGS} -Os" -OPTFLAGS_append_toolchain-clang = " -fno-builtin-bcmp" +OPTFLAGS = "${TUNE_CCARGS} -Os -fcommon" +OPTFLAGS:append = " ${DEBUG_PREFIX_MAP}" +OPTFLAGS:append:toolchain-clang = " -fno-builtin-bcmp" +OPTFLAGS:append:toolchain-clang:mipsarch = " -no-integrated-as" PARALLEL_MAKE = "" EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \ @@ -58,21 +57,22 @@ do_configure () { ln -sf "${STAGING_DIR_TARGET}${exec_prefix}" linux } -do_compile_prepend_toolchain-clang() { +do_compile:prepend:toolchain-clang() { sed -i -e 's#$(KLIBCROSS)gcc#$(KLIBCROSS)clang#g' ${S}/Makefile } INHIBIT_PACKAGE_STRIP = "1" INHIBIT_PACKAGE_DEBUG_SPLIT = "1" -INSANE_SKIP_${PN} = "already-stripped" -INSANE_SKIP_libklibc-dev = "dev-elf" +INSANE_SKIP:${PN} = "already-stripped" +INSANE_SKIP:libklibc-dev = "dev-elf" KLIBC_ARCH = "${TARGET_ARCH}" -KLIBC_ARCH_aarch64 = "arm64" -KLIBC_ARCH_armeb = "arm" -KLIBC_ARCH_mipsel = "mips" -KLIBC_ARCH_mips64el = "mips64" -KLIBC_ARCH_x86 = "i386" -KLIBC_ARCH_x86-64 = "x86_64" -KLIBC_ARCH_powerpc = "ppc" -KLIBC_ARCH_powerpc64 = "ppc64" +KLIBC_ARCH:aarch64 = "arm64" +KLIBC_ARCH:armeb = "arm" +KLIBC_ARCH:mipsel = "mips" +KLIBC_ARCH:mips64el = "mips64" +KLIBC_ARCH:x86 = "i386" +KLIBC_ARCH:x86-64 = "x86_64" +KLIBC_ARCH:powerpc = "ppc" +KLIBC_ARCH:powerpc64 = "ppc64" +KLIBC_ARCH:powerpc64le = "ppc64" THIS_LIBKLIBC = "libklibc (= ${PV}-${PR})" diff --git a/meta-initramfs/recipes-devtools/klibc/klibc_2.0.6.bb b/meta-initramfs/recipes-devtools/klibc/klibc_2.0.13.bb index 7df0b0a3d5..8dda9a8cdc 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc_2.0.6.bb +++ b/meta-initramfs/recipes-devtools/klibc/klibc_2.0.13.bb @@ -16,9 +16,9 @@ do_install() { PACKAGES = "libklibc libklibc-staticdev libklibc-dev" -FILES_libklibc = "${libdir}/klibc-*.so" -FILES_libklibc-staticdev = "${libdir}/klibc/lib/libc.a" -FILES_libklibc-dev = "${libdir}/klibc.so \ +FILES:libklibc = "${libdir}/klibc-*.so" +FILES:libklibc-staticdev = "${libdir}/klibc/lib/libc.a" +FILES:libklibc-dev = "${libdir}/klibc.so \ ${libdir}/klibc/lib/* \ ${libdir}/klibc/include/* \ " |