summaryrefslogtreecommitdiffstats
path: root/recipes-core
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-09-10 19:12:00 -0700
committerKhem Raj <raj.khem@gmail.com>2019-09-11 08:30:15 -0700
commit41ef02b0c594f2e77fb17c1e71cc061e835101bc (patch)
treed5a371b11588b9d9e7e531501246ca687a1c92c7 /recipes-core
parentedf7810e838990f3ae2d50af947608baa2623fa1 (diff)
downloadmeta-clang-41ef02b0c594f2e77fb17c1e71cc061e835101bc.tar.gz
busybox: Update non-const patch to remaining patterns
This was noticed when /bin/ash crashed that there are more instances of this optimization which causes same kind of failures in few other applets As a side benefit busybox compiled with clang works totally fine on riscv64 now Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes-core')
-rw-r--r--recipes-core/busybox/busybox/0001-Turn-ptr_to_globals-and-bb_errno-to-be-non-const.patch56
-rw-r--r--recipes-core/busybox/busybox_%.bbappend6
2 files changed, 55 insertions, 7 deletions
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 481b125..c14950a 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
@@ -1,4 +1,4 @@
1From c7580fdb4be69a872291ccf22334091cace749fc Mon Sep 17 00:00:00 2001 1From d941b59087d34cb93053b638c066bf080122e7bb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 16 Jan 2019 22:39:24 -0800 3Date: Wed, 16 Jan 2019 22:39:24 -0800
4Subject: [PATCH] Turn ptr_to_globals and bb_errno to be non const 4Subject: [PATCH] Turn ptr_to_globals and bb_errno to be non const
@@ -107,9 +107,25 @@ r14 is 0x0 and writing to this ofcourse ends up in segfault
107 107
108Signed-off-by: Khem Raj <raj.khem@gmail.com> 108Signed-off-by: Khem Raj <raj.khem@gmail.com>
109--- 109---
110 include/libbb.h | 4 ++-- 110 coreutils/test.c | 2 +-
111 1 file changed, 2 insertions(+), 2 deletions(-) 111 include/libbb.h | 4 ++--
112 112 libbb/lineedit.c | 2 +-
113 shell/ash.c | 5 ++---
114 4 files changed, 6 insertions(+), 7 deletions(-)
115
116diff --git a/coreutils/test.c b/coreutils/test.c
117index 868ffbecb..d11fccf5b 100644
118--- a/coreutils/test.c
119+++ b/coreutils/test.c
120@@ -401,7 +401,7 @@ struct test_statics {
121 };
122
123 /* See test_ptr_hack.c */
124-extern struct test_statics *const test_ptr_to_statics;
125+extern struct test_statics *test_ptr_to_statics;
126
127 #define S (*test_ptr_to_statics)
128 #define args (S.args )
113diff --git a/include/libbb.h b/include/libbb.h 129diff --git a/include/libbb.h b/include/libbb.h
114index 111d1b790..a52265e77 100644 130index 111d1b790..a52265e77 100644
115--- a/include/libbb.h 131--- a/include/libbb.h
@@ -132,6 +148,36 @@ index 111d1b790..a52265e77 100644
132 /* At least gcc 3.4.6 on mipsel system needs optimization barrier */ 148 /* At least gcc 3.4.6 on mipsel system needs optimization barrier */
133 #define barrier() __asm__ __volatile__("":::"memory") 149 #define barrier() __asm__ __volatile__("":::"memory")
134 #define SET_PTR_TO_GLOBALS(x) do { \ 150 #define SET_PTR_TO_GLOBALS(x) do { \
151diff --git a/libbb/lineedit.c b/libbb/lineedit.c
152index fbabc6c12..026c42c4c 100644
153--- a/libbb/lineedit.c
154+++ b/libbb/lineedit.c
155@@ -181,7 +181,7 @@ struct lineedit_statics {
156 };
157
158 /* See lineedit_ptr_hack.c */
159-extern struct lineedit_statics *const lineedit_ptr_to_statics;
160+extern struct lineedit_statics * lineedit_ptr_to_statics;
161
162 #define S (*lineedit_ptr_to_statics)
163 #define state (S.state )
164diff --git a/shell/ash.c b/shell/ash.c
165index c5588ea66..6f07f7d6d 100644
166--- a/shell/ash.c
167+++ b/shell/ash.c
168@@ -297,10 +297,9 @@ typedef long arith_t;
169 * set "-DBB_GLOBAL_CONST=''" in CONFIG_EXTRA_CFLAGS to disable
170 * this optimization.
171 */
172-#ifndef BB_GLOBAL_CONST
173-# define BB_GLOBAL_CONST const
174-#endif
175
176+#undef BB_GLOBAL_CONST
177+#define BB_GLOBAL_CONST
178
179 /* ============ Hash table sizes. Configurable. */
180
135-- 181--
1362.22.0 1822.23.0
137 183
diff --git a/recipes-core/busybox/busybox_%.bbappend b/recipes-core/busybox/busybox_%.bbappend
index 959466e..f26df7e 100644
--- a/recipes-core/busybox/busybox_%.bbappend
+++ b/recipes-core/busybox/busybox_%.bbappend
@@ -1,7 +1,9 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2SRC_URI_append_toolchain-clang = "\ 2SRC_URI_append_toolchain-clang = "\
3 file://0001-Turn-ptr_to_globals-and-bb_errno-to-be-non-const.patch \ 3 file://0001-Turn-ptr_to_globals-and-bb_errno-to-be-non-const.patch \
4 " 4"
5 5
6# networking/tls_pstm_sqr_comba.c:514:4: error: inline assembly requires more registers than available
7# SQRADD2(*tmpx++, *tmpy--);
8# ^
6TOOLCHAIN_x86 = "gcc" 9TOOLCHAIN_x86 = "gcc"
7TOOLCHAIN_riscv64 = "gcc"