diff options
| author | Khem Raj <raj.khem@gmail.com> | 2025-05-24 07:57:43 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-05-29 15:14:37 +0100 |
| commit | 3e5469456e100598c17a519e3a54f77485616565 (patch) | |
| tree | 47365290fa78c770dbc4c94d14610f8ebf694999 /meta | |
| parent | dc35424a2d00d84c225d834a4dafa11e14269ce7 (diff) | |
| download | poky-3e5469456e100598c17a519e3a54f77485616565.tar.gz | |
busybox: Do not define global 'const' with clang
This helps fix segfaults when compiling with clang, the option to
define global const is configurable now in busybox [1] [2]
Turn ptr_to_globals and bb_errno to be non const
writing to a const variable is undefined behavior
This is undefined as per (C99 6.7.3 paragraph 5) see [1]
errno and ptr_to_globals is written to in code, this fails with
segfaults when compiled with clang
[1] https://git.busybox.net/busybox/commit/?id=1f925038a
[2] https://lists.busybox.net/pipermail/busybox/2022-January/089413.html
(From OE-Core rev: 091d162f29dfefe2716d3b793cea55b9f14d684d)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-core/busybox/busybox.inc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc index 638b40c758..4ebaeb92c9 100644 --- a/meta/recipes-core/busybox/busybox.inc +++ b/meta/recipes-core/busybox/busybox.inc | |||
| @@ -16,6 +16,7 @@ SECTION = "base" | |||
| 16 | # Whether to split the suid apps into a seperate binary | 16 | # Whether to split the suid apps into a seperate binary |
| 17 | BUSYBOX_SPLIT_SUID ?= "1" | 17 | BUSYBOX_SPLIT_SUID ?= "1" |
| 18 | 18 | ||
| 19 | CFLAGS:append:toolchain-clang = " -DBB_GLOBAL_CONST=''" | ||
| 19 | export EXTRA_CFLAGS = "${CFLAGS}" | 20 | export EXTRA_CFLAGS = "${CFLAGS}" |
| 20 | export EXTRA_LDFLAGS = "${LDFLAGS}" | 21 | export EXTRA_LDFLAGS = "${LDFLAGS}" |
| 21 | 22 | ||
