diff options
Diffstat (limited to 'meta-initramfs/recipes-devtools/klibc/files')
17 files changed, 530 insertions, 0 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 new file mode 100644 index 0000000000..e7a0cce837 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-Define-in_-structs-for-non-glibc-system-libs.patch | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | From 57e3a60b23891905733bfea7a1cb78c2377cc524 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sun, 9 Jul 2017 15:17:29 -0700 | ||
| 4 | Subject: [PATCH] Define in_* structs for non-glibc system libs | ||
| 5 | |||
| 6 | These defines and structs are required to be coming from | ||
| 7 | userspace netinet/in.h, which is being overridden in klibc | ||
| 8 | however, libc-compat.h from kernel is only written keeping | ||
| 9 | glibc in mind, and does not provide adequate guards for musl | ||
| 10 | to infer that these structs should be defined in linux/in.h | ||
| 11 | |||
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 13 | |||
| 14 | --- | ||
| 15 | usr/include/net/if.h | 11 +++++++++++ | ||
| 16 | usr/include/netinet/in.h | 36 ++++++++++++++++++++++++++++++++++++ | ||
| 17 | 2 files changed, 47 insertions(+) | ||
| 18 | |||
| 19 | diff --git a/usr/include/net/if.h b/usr/include/net/if.h | ||
| 20 | index 116a176..6246b12 100644 | ||
| 21 | --- a/usr/include/net/if.h | ||
| 22 | +++ b/usr/include/net/if.h | ||
| 23 | @@ -1,6 +1,17 @@ | ||
| 24 | #ifndef _NET_IF_H | ||
| 25 | #define _NET_IF_H | ||
| 26 | |||
| 27 | +#ifndef __GLIBC__ | ||
| 28 | +#include <linux/libc-compat.h> | ||
| 29 | +#undef __UAPI_DEF_IF_IFREQ | ||
| 30 | +#define __UAPI_DEF_IF_IFREQ 1 | ||
| 31 | +#undef __UAPI_DEF_IF_IFNAMSIZ | ||
| 32 | +#define __UAPI_DEF_IF_IFNAMSIZ 1 | ||
| 33 | +#undef __UAPI_DEF_IF_IFMAP | ||
| 34 | +#define __UAPI_DEF_IF_IFMAP 1 | ||
| 35 | +#undef __UAPI_DEF_IF_NET_DEVICE_FLAGS | ||
| 36 | +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1 | ||
| 37 | +#endif | ||
| 38 | #include <sys/socket.h> | ||
| 39 | #include <sys/types.h> | ||
| 40 | #include <linux/if.h> | ||
| 41 | diff --git a/usr/include/netinet/in.h b/usr/include/netinet/in.h | ||
| 42 | index 2952bb2..0c95bc9 100644 | ||
| 43 | --- a/usr/include/netinet/in.h | ||
| 44 | +++ b/usr/include/netinet/in.h | ||
| 45 | @@ -5,6 +5,42 @@ | ||
| 46 | #ifndef _NETINET_IN_H | ||
| 47 | #define _NETINET_IN_H | ||
| 48 | |||
| 49 | +#ifndef __GLIBC__ | ||
| 50 | +#include <linux/libc-compat.h> | ||
| 51 | + | ||
| 52 | +#undef __UAPI_DEF_IN_ADDR | ||
| 53 | +#undef __UAPI_DEF_IN_IPPROTO | ||
| 54 | +#undef __UAPI_DEF_IN_PKTINFO | ||
| 55 | +#undef __UAPI_DEF_IP_MREQ | ||
| 56 | +#undef __UAPI_DEF_SOCKADDR_IN | ||
| 57 | +#undef __UAPI_DEF_IN_CLASS | ||
| 58 | +#undef __UAPI_DEF_IN6_ADDR | ||
| 59 | +#undef __UAPI_DEF_IN6_ADDR_ALT | ||
| 60 | +#undef __UAPI_DEF_SOCKADDR_IN6 | ||
| 61 | +#undef __UAPI_DEF_IPV6_MREQ | ||
| 62 | +#undef __UAPI_DEF_IPPROTO_V6 | ||
| 63 | +#undef __UAPI_DEF_IPV6_OPTIONS | ||
| 64 | +#undef __UAPI_DEF_IN6_PKTINFO | ||
| 65 | +#undef __UAPI_DEF_IP6_MTUINFO | ||
| 66 | +#undef __UAPI_DEF_IF_IFREQ | ||
| 67 | + | ||
| 68 | +#define __UAPI_DEF_IN_ADDR 1 | ||
| 69 | +#define __UAPI_DEF_IN_IPPROTO 1 | ||
| 70 | +#define __UAPI_DEF_IN_PKTINFO 1 | ||
| 71 | +#define __UAPI_DEF_IP_MREQ 1 | ||
| 72 | +#define __UAPI_DEF_SOCKADDR_IN 1 | ||
| 73 | +#define __UAPI_DEF_IN_CLASS 1 | ||
| 74 | +#define __UAPI_DEF_IN6_ADDR 1 | ||
| 75 | +#define __UAPI_DEF_IN6_ADDR_ALT 1 | ||
| 76 | +#define __UAPI_DEF_SOCKADDR_IN6 1 | ||
| 77 | +#define __UAPI_DEF_IPV6_MREQ 1 | ||
| 78 | +#define __UAPI_DEF_IPPROTO_V6 1 | ||
| 79 | +#define __UAPI_DEF_IPV6_OPTIONS 1 | ||
| 80 | +#define __UAPI_DEF_IN6_PKTINFO 1 | ||
| 81 | +#define __UAPI_DEF_IP6_MTUINFO 1 | ||
| 82 | +#define __UAPI_DEF_IF_IFREQ 1 | ||
| 83 | +#endif | ||
| 84 | + | ||
| 85 | #include <klibc/extern.h> | ||
| 86 | #include <stdint.h> | ||
| 87 | #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 new file mode 100644 index 0000000000..eee144dc4a --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-Define-ulocked_-fgets-fread-fwrite-aliases.patch | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | From 241f423a015279cb29b7ad1a34386ef1c32007fc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sun, 9 Dec 2018 16:47:16 -0800 | ||
| 4 | Subject: [PATCH] Define ulocked_{fgets|fread|fwrite} aliases | ||
| 5 | |||
| 6 | latest clang converts the normal calls to the unlocked variant | ||
| 7 | equivalents | ||
| 8 | |||
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 10 | Cc: Andrea Adami <andrea.adami@gmail.com> | ||
| 11 | --- | ||
| 12 | usr/klibc/fgets.c | 2 ++ | ||
| 13 | usr/klibc/fread2.c | 2 ++ | ||
| 14 | usr/klibc/fwrite2.c | 2 ++ | ||
| 15 | 3 files changed, 6 insertions(+) | ||
| 16 | |||
| 17 | diff --git a/usr/klibc/fgets.c b/usr/klibc/fgets.c | ||
| 18 | index dbf742c6..2e9fcb65 100644 | ||
| 19 | --- a/usr/klibc/fgets.c | ||
| 20 | +++ b/usr/klibc/fgets.c | ||
| 21 | @@ -25,3 +25,5 @@ char *fgets(char *s, int n, FILE *f) | ||
| 22 | |||
| 23 | return s; | ||
| 24 | } | ||
| 25 | +char *fgets_unlocked(char *s, int n, FILE *f) | ||
| 26 | + __alias("fgets"); | ||
| 27 | diff --git a/usr/klibc/fread2.c b/usr/klibc/fread2.c | ||
| 28 | index 7dca56b1..5c234766 100644 | ||
| 29 | --- a/usr/klibc/fread2.c | ||
| 30 | +++ b/usr/klibc/fread2.c | ||
| 31 | @@ -11,3 +11,5 @@ size_t fread(void *ptr, size_t size, size_t nmemb, FILE * f) | ||
| 32 | { | ||
| 33 | return _fread(ptr, size * nmemb, f) / size; | ||
| 34 | } | ||
| 35 | +size_t fread_unlocked(void *ptr, size_t size, size_t nmemb, FILE *f) | ||
| 36 | + __alias("fread"); | ||
| 37 | diff --git a/usr/klibc/fwrite2.c b/usr/klibc/fwrite2.c | ||
| 38 | index cebc017c..3e0bb57d 100644 | ||
| 39 | --- a/usr/klibc/fwrite2.c | ||
| 40 | +++ b/usr/klibc/fwrite2.c | ||
| 41 | @@ -11,3 +11,5 @@ size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE * f) | ||
| 42 | { | ||
| 43 | return _fwrite(ptr, size * nmemb, f) / size; | ||
| 44 | } | ||
| 45 | +size_t fwrite_unlocked(void *ptr, size_t size, size_t nmemb, FILE *f) | ||
| 46 | + __alias("fwrite"); | ||
| 47 | -- | ||
| 48 | 2.19.2 | ||
| 49 | |||
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 new file mode 100644 index 0000000000..181dcfb6de --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | From 4b4147b76518d31a88fb2c58cdbf2236e159a25c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Fri, 8 Sep 2017 23:10:54 -0700 | ||
| 4 | Subject: [PATCH] Kbuild.klibc: Add path to compiler headers via -isystem | ||
| 5 | |||
| 6 | We need to include this path so it can find compiler headers e.g. | ||
| 7 | stdarg.h which is called from wrapper stdarg.h using include_next | ||
| 8 | |||
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 10 | |||
| 11 | --- | ||
| 12 | scripts/Kbuild.klibc | 3 ++- | ||
| 13 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc | ||
| 16 | index 101f86f..1d5cdc4 100644 | ||
| 17 | --- a/scripts/Kbuild.klibc | ||
| 18 | +++ b/scripts/Kbuild.klibc | ||
| 19 | @@ -105,7 +105,8 @@ KLIBCOBJCOPY := $(OBJCOPY) | ||
| 20 | KLIBCOBJDUMP := $(OBJDUMP) | ||
| 21 | |||
| 22 | # klibc include paths | ||
| 23 | -KLIBCCPPFLAGS := -nostdinc -iwithprefix include \ | ||
| 24 | +KLIBCCPPFLAGS := -nostdinc -iwithprefix include \ | ||
| 25 | + -isystem $(shell $(CC) -print-file-name=include) \ | ||
| 26 | -I$(KLIBCINC)/arch/$(KLIBCARCHDIR) \ | ||
| 27 | -I$(KLIBCINC)/bits$(KLIBCBITSIZE) \ | ||
| 28 | -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 new file mode 100644 index 0000000000..1ba05a811e --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | From b6185401fc3daa7fa8ba2b84db3e4da3b94a9867 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 26 Jul 2017 16:13:16 -0700 | ||
| 4 | Subject: [PATCH] Kbuild.klibc: Use -print-libgcc-file-name instead of | ||
| 5 | --print-libgcc | ||
| 6 | |||
| 7 | -print-libgcc-file-name works with clang and gcc unlike --print-libgcc | ||
| 8 | which is gcc specific | ||
| 9 | |||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | |||
| 12 | --- | ||
| 13 | scripts/Kbuild.klibc | 2 +- | ||
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc | ||
| 17 | index f500d53..101f86f 100644 | ||
| 18 | --- a/scripts/Kbuild.klibc | ||
| 19 | +++ b/scripts/Kbuild.klibc | ||
| 20 | @@ -128,7 +128,7 @@ KLIBCCFLAGS += $(KLIBCCPPFLAGS) $(KLIBCREQFLAGS) $(KLIBCARCHREQFLAGS) \ | ||
| 21 | KLIBCAFLAGS += -D__ASSEMBLY__ $(KLIBCCFLAGS) | ||
| 22 | KLIBCSTRIPFLAGS += --strip-all -R .comment -R .note | ||
| 23 | |||
| 24 | -KLIBCLIBGCC_DEF := $(shell $(KLIBCCC) $(KLIBCCFLAGS) --print-libgcc) | ||
| 25 | +KLIBCLIBGCC_DEF := $(shell $(KLIBCCC) $(KLIBCCFLAGS) -print-libgcc-file-name) | ||
| 26 | KLIBCLIBGCC ?= $(KLIBCLIBGCC_DEF) | ||
| 27 | KLIBCCRT0 := $(KLIBCOBJ)/arch/$(KLIBCARCHDIR)/crt0.o | ||
| 28 | 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 new file mode 100644 index 0000000000..de04d691fe --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-always-use-bfd-linker.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | From 63ab5102d6ef362a597941e62470bf19e6f1652b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 11 Jul 2017 08:09:52 -0700 | ||
| 4 | Subject: [PATCH] always use bfd linker | ||
| 5 | |||
| 6 | its possible that distros choose to default to gold linker | ||
| 7 | therefore explicitly asking for bfd linker would fix the | ||
| 8 | linking issues on such distros | ||
| 9 | |||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | |||
| 12 | --- | ||
| 13 | Makefile | 2 +- | ||
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/Makefile b/Makefile | ||
| 17 | index dc10fc5..40647be 100644 | ||
| 18 | --- a/Makefile | ||
| 19 | +++ b/Makefile | ||
| 20 | @@ -20,7 +20,7 @@ include $(srctree)/scripts/Kbuild.include | ||
| 21 | KLIBCROSS ?= $(CROSS_COMPILE) | ||
| 22 | export KLIBCROSS | ||
| 23 | export CC := $(KLIBCROSS)gcc | ||
| 24 | -export LD := $(KLIBCROSS)ld | ||
| 25 | +export LD := $(KLIBCROSS)ld.bfd | ||
| 26 | export AR := $(KLIBCROSS)ar | ||
| 27 | export RANLIB := $(KLIBCROSS)ranlib | ||
| 28 | export STRIP := $(KLIBCROSS)strip | ||
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 new file mode 100644 index 0000000000..fcf4f891a4 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | From ebd2b0e414c98467156b961abb470b5d07f37ea8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Fri, 29 Sep 2017 23:11:53 -0700 | ||
| 4 | Subject: [PATCH] arm: Do not set a fallback march and mtune | ||
| 5 | |||
| 6 | In OE we pass the options explicitly, there is | ||
| 7 | no need to set it inside the makefiles, we will | ||
| 8 | need to compute values for CPU_ARCH and CPU_TUNE | ||
| 9 | which is a bit harder in OE | ||
| 10 | |||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | |||
| 13 | --- | ||
| 14 | usr/klibc/arch/arm/MCONFIG | 2 +- | ||
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/usr/klibc/arch/arm/MCONFIG b/usr/klibc/arch/arm/MCONFIG | ||
| 18 | index 303c6ac..48d2685 100644 | ||
| 19 | --- a/usr/klibc/arch/arm/MCONFIG | ||
| 20 | +++ b/usr/klibc/arch/arm/MCONFIG | ||
| 21 | @@ -10,7 +10,7 @@ | ||
| 22 | CPU_ARCH ?= armv4 | ||
| 23 | CPU_TUNE ?= strongarm | ||
| 24 | |||
| 25 | -KLIBCOPTFLAGS += -Os -march=$(CPU_ARCH) -mtune=$(CPU_TUNE) | ||
| 26 | +KLIBCOPTFLAGS += -Os | ||
| 27 | KLIBCBITSIZE = 32 | ||
| 28 | KLIBCREQFLAGS += -fno-exceptions | ||
| 29 | KLIBCSTRIPFLAGS += -R .ARM.exidx | ||
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 new file mode 100644 index 0000000000..46a23987f5 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-dash-Specify-format-string-in-fmtstr.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | From 8beffe501c1ac5b35d62004735c4157c74183901 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sun, 9 Jul 2017 13:51:25 -0700 | ||
| 4 | Subject: [PATCH] dash: Specify format string in fmtstr() | ||
| 5 | |||
| 6 | Fixes build with hardening flags | ||
| 7 | |||
| 8 | usr/dash/jobs.c:429:3: error: format not a string literal and no format arguments [-Werror=format-security] | ||
| 9 | col = fmtstr(s, 32, strsignal(st)); | ||
| 10 | |||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | |||
| 13 | --- | ||
| 14 | usr/dash/jobs.c | 2 +- | ||
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c | ||
| 18 | index 009bbfe..299bcac 100644 | ||
| 19 | --- a/usr/dash/jobs.c | ||
| 20 | +++ b/usr/dash/jobs.c | ||
| 21 | @@ -426,7 +426,7 @@ sprint_status(char *s, int status, int sigonly) | ||
| 22 | goto out; | ||
| 23 | #endif | ||
| 24 | } | ||
| 25 | - col = fmtstr(s, 32, strsignal(st)); | ||
| 26 | + col = fmtstr(s, 32, "%s", strsignal(st)); | ||
| 27 | #ifdef WCOREDUMP | ||
| 28 | if (WCOREDUMP(status)) { | ||
| 29 | 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 new file mode 100644 index 0000000000..04c97fc5ee --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-include-linux-sysinfo.h-directly.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From d966d52d1e569cbc2293d841285e2b8941f28c61 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sun, 9 Jul 2017 15:56:28 -0700 | ||
| 4 | Subject: [PATCH] include linux/sysinfo.h directly | ||
| 5 | |||
| 6 | This is done to avoid the kernel header linux/kernel.h to use | ||
| 7 | __GLIBC__ define to decide on if libc implements sysinfo() API | ||
| 8 | or not. Kernel headers should be independent of such assumptions | ||
| 9 | but until its done in right place, change the local header | ||
| 10 | override to avoid this assumption | ||
| 11 | |||
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 13 | |||
| 14 | --- | ||
| 15 | usr/include/sys/sysinfo.h | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/usr/include/sys/sysinfo.h b/usr/include/sys/sysinfo.h | ||
| 19 | index dba68dc..d145c0b 100644 | ||
| 20 | --- a/usr/include/sys/sysinfo.h | ||
| 21 | +++ b/usr/include/sys/sysinfo.h | ||
| 22 | @@ -5,7 +5,7 @@ | ||
| 23 | #ifndef _SYS_SYSINFO_H | ||
| 24 | #define _SYS_SYSINFO_H | ||
| 25 | |||
| 26 | -#include <linux/kernel.h> | ||
| 27 | +#include <linux/sysinfo.h> | ||
| 28 | |||
| 29 | extern int sysinfo(struct sysinfo *info); | ||
| 30 | |||
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 new file mode 100644 index 0000000000..94818e3669 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | From cdc6edc2cfcd0ce88d6e66654d605dad303b1a75 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 11 Sep 2018 17:03:36 -0700 | ||
| 4 | Subject: [PATCH] klibc/Kbuild: Accept EXTRA_KLIBCAFLAGS | ||
| 5 | |||
| 6 | For passing additional assembler flags | ||
| 7 | |||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | usr/klibc/Kbuild | 3 ++- | ||
| 13 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild | ||
| 16 | index 98caf2e9..b34521e0 100644 | ||
| 17 | --- a/usr/klibc/Kbuild | ||
| 18 | +++ b/usr/klibc/Kbuild | ||
| 19 | @@ -168,7 +168,8 @@ $(SOHASH): $(SOLIB) $(SOLIB).hash | ||
| 20 | targets += interp.o | ||
| 21 | |||
| 22 | quiet_cmd_interp = BUILD $@ | ||
| 23 | - cmd_interp = $(KLIBCCC) $(klibccflags) -D__ASSEMBLY__ \ | ||
| 24 | + cmd_interp = $(KLIBCCC) $(klibccflags) $(EXTRA_KLIBCAFLAGS) \ | ||
| 25 | + -D__ASSEMBLY__ \ | ||
| 26 | -DLIBDIR=\"$(SHLIBDIR)\" \ | ||
| 27 | -DSOHASH=\"$(SOLIBHASH)\" \ | ||
| 28 | -c -o $@ $< | ||
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 new file mode 100644 index 0000000000..0768f6d514 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-add-getrandom-syscall.patch | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | From e4d5d5224609d7d5c824dd231f5baec868befdfa Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andrea Adami <andrea.adami@gmail.com> | ||
| 3 | Date: Tue, 4 Sep 2018 23:56:00 +0200 | ||
| 4 | Subject: [PATCH 1/1] klibc: add getrandom() syscall | ||
| 5 | |||
| 6 | needed by latest kexec-tools for qemuarm64 (kashan) | ||
| 7 | |||
| 8 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | ||
| 9 | --- | ||
| 10 | usr/klibc/SYSCALLS.def | 1 + | ||
| 11 | 1 file changed, 1 insertion(+) | ||
| 12 | |||
| 13 | diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def | ||
| 14 | index 6b3bf4c..d4184ba 100644 | ||
| 15 | --- a/usr/klibc/SYSCALLS.def | ||
| 16 | +++ b/usr/klibc/SYSCALLS.def | ||
| 17 | @@ -274,6 +274,7 @@ int syslog::klogctl(int, char *, int); | ||
| 18 | int sysinfo(struct sysinfo *); | ||
| 19 | long kexec_load(void *, unsigned long, struct kexec_segment *, unsigned long); | ||
| 20 | <x86_64,ppc64,s390x> long kexec_file_load(int, int, unsigned long, const char *, unsigned long); | ||
| 21 | +ssize_t getrandom(void *, size_t, unsigned int); | ||
| 22 | |||
| 23 | /* | ||
| 24 | * Low-level I/O (generally architecture-specific); | ||
| 25 | -- | ||
| 26 | 2.7.4 | ||
| 27 | |||
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 new file mode 100644 index 0000000000..3d8d987c43 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc_2.0.4-add-kexec_file_load-syscall.patch | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | From 90683d5eaabfa684a71411d6e3262153ac191ad8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andrea Adami <andrea.adami@gmail.com> | ||
| 3 | Date: Tue, 4 Sep 2018 23:44:30 +0200 | ||
| 4 | Subject: [PATCH 1/1] klibc_2.0.4: add kexec_file_load syscall | ||
| 5 | |||
| 6 | for supported archs only (matched in kexec-tools) | ||
| 7 | |||
| 8 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | ||
| 9 | --- | ||
| 10 | usr/klibc/SYSCALLS.def | 1 + | ||
| 11 | 1 file changed, 1 insertion(+) | ||
| 12 | |||
| 13 | diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def | ||
| 14 | index c56e8f9..6b3bf4c 100644 | ||
| 15 | --- a/usr/klibc/SYSCALLS.def | ||
| 16 | +++ b/usr/klibc/SYSCALLS.def | ||
| 17 | @@ -273,6 +273,7 @@ int reboot::__reboot(int, int, int, void *); | ||
| 18 | int syslog::klogctl(int, char *, int); | ||
| 19 | int sysinfo(struct sysinfo *); | ||
| 20 | long kexec_load(void *, unsigned long, struct kexec_segment *, unsigned long); | ||
| 21 | +<x86_64,ppc64,s390x> long kexec_file_load(int, int, unsigned long, const char *, unsigned long); | ||
| 22 | |||
| 23 | /* | ||
| 24 | * Low-level I/O (generally architecture-specific); | ||
| 25 | -- | ||
| 26 | 2.7.4 | ||
| 27 | |||
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 new file mode 100644 index 0000000000..3bc081d4e9 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-mkfifo-Implement-mkfifo.patch | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | From cf97079009ba48d10e52052b2eab7461ea4dd09b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Mon, 10 Jul 2017 20:42:50 -0700 | ||
| 4 | Subject: [PATCH] mkfifo: Implement mkfifo | ||
| 5 | |||
| 6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 7 | |||
| 8 | --- | ||
| 9 | usr/utils/mkfifo.c | 5 +++++ | ||
| 10 | 1 file changed, 5 insertions(+) | ||
| 11 | |||
| 12 | diff --git a/usr/utils/mkfifo.c b/usr/utils/mkfifo.c | ||
| 13 | index 5a758b2..f1f577e 100644 | ||
| 14 | --- a/usr/utils/mkfifo.c | ||
| 15 | +++ b/usr/utils/mkfifo.c | ||
| 16 | @@ -26,6 +26,11 @@ static int make_fifo(char *dir) | ||
| 17 | return 0; | ||
| 18 | } | ||
| 19 | |||
| 20 | +int mkfifo (const char *__p, mode_t __m) | ||
| 21 | +{ | ||
| 22 | + return mknod(__p, (__m & ~S_IFMT) | S_IFIFO, (dev_t) 0); | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | int main(int argc, char *argv[]) | ||
| 26 | { | ||
| 27 | int c, ret = 0; | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/files/armv4-fix-v4bx.patch b/meta-initramfs/recipes-devtools/klibc/files/armv4-fix-v4bx.patch new file mode 100644 index 0000000000..4a334fa252 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/armv4-fix-v4bx.patch | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | From d2fb484d995221277cce7abddcd7dfa0e8bceec3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andrea Adami <andrea.adami@gmail.com> | ||
| 3 | Date: Fri, 11 Jan 2013 17:26:40 +0000 | ||
| 4 | Subject: [PATCH] klibc_2.0.2: apply FIX_V4BX patch for armv4 targets only | ||
| 5 | |||
| 6 | Status: not applicable upstream, in OE/Yocto we use $(FIX_V4BX) | ||
| 7 | which is "" in case of armv5 or thumbs. | ||
| 8 | |||
| 9 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | ||
| 10 | |||
| 11 | --- | ||
| 12 | usr/klibc/arch/arm/MCONFIG | 1 + | ||
| 13 | 1 file changed, 1 insertion(+) | ||
| 14 | |||
| 15 | --- a/usr/klibc/arch/arm/MCONFIG | ||
| 16 | +++ b/usr/klibc/arch/arm/MCONFIG | ||
| 17 | @@ -29,6 +29,7 @@ else | ||
| 18 | KLIBCSHAREDFLAGS = -Ttext-segment 0x01800000 | ||
| 19 | ifeq ($(CONFIG_AEABI),y) | ||
| 20 | KLIBCREQFLAGS += -mabi=aapcs-linux -mno-thumb-interwork | ||
| 21 | +KLIBCLDFLAGS += $(FIX_ARMV4_EABI_BX) | ||
| 22 | else | ||
| 23 | KLIBCREQFLAGS += -mabi=apcs-gnu -mno-thumb-interwork | ||
| 24 | endif | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/files/klcc-consider-sysroot.patch b/meta-initramfs/recipes-devtools/klibc/files/klcc-consider-sysroot.patch new file mode 100644 index 0000000000..5f47d3f20a --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/klcc-consider-sysroot.patch | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | From 0cb26cf2d25d36c1fdcc4f1635e4329436ed866a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andrea Adami <andrea.adami@gmail.com> | ||
| 3 | Date: Fri, 19 Sep 2014 23:09:29 +0200 | ||
| 4 | |||
| 5 | --- | ||
| 6 | klcc/klcc.in | 3 +++ | ||
| 7 | 1 file changed, 3 insertions(+) | ||
| 8 | |||
| 9 | diff --git a/klcc/klcc.in b/klcc/klcc.in | ||
| 10 | index 43d0984..61e9385 100644 | ||
| 11 | --- a/klcc/klcc.in | ||
| 12 | +++ b/klcc/klcc.in | ||
| 13 | @@ -204,6 +204,9 @@ while ( defined($a = shift(@ARGV)) ) { | ||
| 14 | # Libraries | ||
| 15 | push(@libs, $a); | ||
| 16 | push(@libs, shift(@ARGV)) if ( $2 eq '' ); | ||
| 17 | + } elsif ( $a =~ /^--([sysroot=])(.*)$/ ) { | ||
| 18 | + # Override gcc encoded sysroot | ||
| 19 | + push(@ccopt, $a); | ||
| 20 | } else { | ||
| 21 | die "$0: unknown option: $a\n"; | ||
| 22 | } | ||
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 new file mode 100644 index 0000000000..07703aa536 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/klcc-cross-accept-clang-options.patch | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | meta-clang passes this option to compiler defaults | ||
| 2 | |||
| 3 | Upstream-Status: Pending | ||
| 4 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 5 | |||
| 6 | Index: git/klcc/klcc.in | ||
| 7 | =================================================================== | ||
| 8 | --- git.orig/klcc/klcc.in | ||
| 9 | +++ git/klcc/klcc.in | ||
| 10 | @@ -207,6 +207,9 @@ while ( defined($a = shift(@ARGV)) ) { | ||
| 11 | } elsif ( $a =~ /^--([sysroot=])(.*)$/ ) { | ||
| 12 | # Override gcc encoded sysroot | ||
| 13 | push(@ccopt, $a); | ||
| 14 | + } elsif ( $a eq '-no-integrated-as' ) { | ||
| 15 | + # Allow clang options | ||
| 16 | + push(@ccopt, $a); | ||
| 17 | } else { | ||
| 18 | die "$0: unknown option: $a\n"; | ||
| 19 | } | ||
diff --git a/meta-initramfs/recipes-devtools/klibc/files/klibc-config-eabi.patch b/meta-initramfs/recipes-devtools/klibc/files/klibc-config-eabi.patch new file mode 100644 index 0000000000..a6998f86d6 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/klibc-config-eabi.patch | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | From 1118cc971917abe19ddb029aa80417f6fd6bb343 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Thomas Kunze <thommycheck@gmx.de> | ||
| 3 | Date: Sat, 6 Aug 2011 05:30:14 +0000 | ||
| 4 | Subject: [PATCH] klibc: initial commit of version 1.5.24 | ||
| 5 | |||
| 6 | Patch was imported from the OpenEmbedded git server | ||
| 7 | (git://git.openembedded.org/openembedded) | ||
| 8 | as of commit id b6764cf32ec93547531130dca364fb95e1c495f4 | ||
| 9 | Signed-off-by: Thomas Kunze <thommycheck@gmx.de> | ||
| 10 | |||
| 11 | --- | ||
| 12 | defconfig | 2 +- | ||
| 13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 14 | |||
| 15 | --- a/defconfig | ||
| 16 | +++ b/defconfig | ||
| 17 | @@ -6,5 +6,5 @@ CONFIG_KLIBC_ZLIB=y | ||
| 18 | CONFIG_REGPARM=y | ||
| 19 | # ARM options | ||
| 20 | # CONFIG_KLIBC_THUMB is not set | ||
| 21 | -# CONFIG_AEABI is not set | ||
| 22 | +CONFIG_AEABI=y | ||
| 23 | # 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 new file mode 100644 index 0000000000..eac128cc09 --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/use-env-for-perl.patch | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | Patch was imported from the OpenEmbedded git server | ||
| 2 | (git://git.openembedded.org/openembedded) | ||
| 3 | as of commit id 676cbb54d42c89a4832871064cfcb7ee2ad372ee | ||
| 4 | |||
| 5 | klcc-cross: Add patch to use /usr/bin/env perl | ||
| 6 | Certain configurations (such as autobuilders) may build in very | ||
| 7 | deep paths (that are longer than the #! mechanism allows) which | ||
| 8 | makes it unsafe to use the direct path for perl. In our case we know | ||
| 9 | that /usr/bin/env perl will always return ours (if it has been built). | ||
| 10 | |||
| 11 | Signed-off-by: Tom Rini <tom_rini@mentor.com> | ||
| 12 | |||
| 13 | Index: klibc-1.5.20/klcc/makeklcc.pl | ||
| 14 | =================================================================== | ||
| 15 | --- a/klcc/makeklcc.pl | ||
| 16 | +++ b/klcc/makeklcc.pl | ||
| 17 | @@ -26,7 +26,7 @@ sub pathsearch($) { | ||
| 18 | return undef; | ||
| 19 | } | ||
| 20 | |||
| 21 | -print "#!${perlpath}\n"; | ||
| 22 | +print "#!/usr/bin/env perl\n"; | ||
| 23 | |||
| 24 | open(KLIBCCONF, "< $klibcconf\0") | ||
| 25 | or die "$0: cannot open $klibcconf: $!\n"; | ||
