From 6475bb23b98160bfe6c5b2acf3e5e76ad8a05345 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 10 Jul 2020 10:28:43 -0700 Subject: busybox: Forward port the clang patch to 1.32 release Signed-off-by: Khem Raj --- ...r_to_globals-and-bb_errno-to-be-non-const.patch | 23 ++++++---------------- recipes-core/busybox/busybox_1.31.%.bbappend | 9 --------- recipes-core/busybox/busybox_1.32.%.bbappend | 9 +++++++++ 3 files changed, 15 insertions(+), 26 deletions(-) delete mode 100644 recipes-core/busybox/busybox_1.31.%.bbappend create mode 100644 recipes-core/busybox/busybox_1.32.%.bbappend diff --git a/recipes-core/busybox/busybox/0001-Turn-ptr_to_globals-and-bb_errno-to-be-non-const.patch b/recipes-core/busybox/busybox/0001-Turn-ptr_to_globals-and-bb_errno-to-be-non-const.patch index c14950a..4f4bbbd 100644 --- a/recipes-core/busybox/busybox/0001-Turn-ptr_to_globals-and-bb_errno-to-be-non-const.patch +++ b/recipes-core/busybox/busybox/0001-Turn-ptr_to_globals-and-bb_errno-to-be-non-const.patch @@ -113,8 +113,6 @@ Signed-off-by: Khem Raj shell/ash.c | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) -diff --git a/coreutils/test.c b/coreutils/test.c -index 868ffbecb..d11fccf5b 100644 --- a/coreutils/test.c +++ b/coreutils/test.c @@ -401,7 +401,7 @@ struct test_statics { @@ -126,11 +124,9 @@ index 868ffbecb..d11fccf5b 100644 #define S (*test_ptr_to_statics) #define args (S.args ) -diff --git a/include/libbb.h b/include/libbb.h -index 111d1b790..a52265e77 100644 --- a/include/libbb.h +++ b/include/libbb.h -@@ -341,7 +341,7 @@ struct BUG_off_t_size_is_misdetected { +@@ -342,7 +342,7 @@ struct BUG_off_t_size_is_misdetected { #if defined(__GLIBC__) /* glibc uses __errno_location() to get a ptr to errno */ /* We can just memorize it once - no multithreading in busybox :) */ @@ -139,17 +135,15 @@ index 111d1b790..a52265e77 100644 #undef errno #define errno (*bb_errno) #endif -@@ -2152,7 +2152,7 @@ struct globals; +@@ -2168,7 +2168,7 @@ struct globals; /* '*const' ptr makes gcc optimize code much better. * Magic prevents ptr_to_globals from going into rodata. * If you want to assign a value, use SET_PTR_TO_GLOBALS(x) */ -extern struct globals *const ptr_to_globals; +extern struct globals *ptr_to_globals; - /* At least gcc 3.4.6 on mipsel system needs optimization barrier */ - #define barrier() __asm__ __volatile__("":::"memory") - #define SET_PTR_TO_GLOBALS(x) do { \ -diff --git a/libbb/lineedit.c b/libbb/lineedit.c -index fbabc6c12..026c42c4c 100644 + + #if defined(__clang_major__) && __clang_major__ >= 9 + /* Clang/llvm drops assignment to "constant" storage. Silently. --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -181,7 +181,7 @@ struct lineedit_statics { @@ -161,11 +155,9 @@ index fbabc6c12..026c42c4c 100644 #define S (*lineedit_ptr_to_statics) #define state (S.state ) -diff --git a/shell/ash.c b/shell/ash.c -index c5588ea66..6f07f7d6d 100644 --- a/shell/ash.c +++ b/shell/ash.c -@@ -297,10 +297,9 @@ typedef long arith_t; +@@ -300,10 +300,9 @@ typedef long arith_t; * set "-DBB_GLOBAL_CONST=''" in CONFIG_EXTRA_CFLAGS to disable * this optimization. */ @@ -178,6 +170,3 @@ index c5588ea66..6f07f7d6d 100644 /* ============ Hash table sizes. Configurable. */ --- -2.23.0 - diff --git a/recipes-core/busybox/busybox_1.31.%.bbappend b/recipes-core/busybox/busybox_1.31.%.bbappend deleted file mode 100644 index f26df7e..0000000 --- a/recipes-core/busybox/busybox_1.31.%.bbappend +++ /dev/null @@ -1,9 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SRC_URI_append_toolchain-clang = "\ - file://0001-Turn-ptr_to_globals-and-bb_errno-to-be-non-const.patch \ -" - -# networking/tls_pstm_sqr_comba.c:514:4: error: inline assembly requires more registers than available -# SQRADD2(*tmpx++, *tmpy--); -# ^ -TOOLCHAIN_x86 = "gcc" diff --git a/recipes-core/busybox/busybox_1.32.%.bbappend b/recipes-core/busybox/busybox_1.32.%.bbappend new file mode 100644 index 0000000..f26df7e --- /dev/null +++ b/recipes-core/busybox/busybox_1.32.%.bbappend @@ -0,0 +1,9 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +SRC_URI_append_toolchain-clang = "\ + file://0001-Turn-ptr_to_globals-and-bb_errno-to-be-non-const.patch \ +" + +# networking/tls_pstm_sqr_comba.c:514:4: error: inline assembly requires more registers than available +# SQRADD2(*tmpx++, *tmpy--); +# ^ +TOOLCHAIN_x86 = "gcc" -- cgit v1.2.3-54-g00ecf