On Sun, Jun 1, 2025 at 12:26 PM Bin Meng <[email protected]> wrote:
>
> It was observed that getty crashes on RISC-V 64-bit target, with the
> busybox binary compiled by clang/LLVM 17 with -O2. Not only getty,
> but also some other applets like syslogd/vi are broken too.
>
> Commit 5156b245 ("Make const ptr assign as function call in clang")
> introduced XZALLOC_CONST_PTR() to defeat the compiler optimization,
> however it only fixed a small number of broken places when compiling
> busybox with clang/LLVM. A large number of places remain broken.
>
> This commit renames existing ASSIGN_CONST_PTR() to _ASSIGN_CONST_PTR()
> and makes the new ASSIGN_CONST_PTR() an out-of-line function to prevent
> clang from reading pointer before it is assigned. With that, previous
> XZALLOC_CONST_PTR() is no longer necessary and gets removed.
>
> Signed-off-by: Bin Meng <[email protected]>
>
> ---
> This commit supersedes previous one [1] as the fix is generic instead
> of only fixing getty codes.
>
> [1] https://lists.busybox.net/pipermail/busybox/2025-May/091486.html
>
>  coreutils/test.c   |  2 +-
>  include/libbb.h    | 10 +++++-----
>  libbb/const_hack.c |  4 ++--
>  libbb/lineedit.c   |  2 +-
>  shell/ash.c        |  6 +++---
>  5 files changed, 12 insertions(+), 12 deletions(-)
>

+ Denys Vlasenko in cc
_______________________________________________
busybox mailing list
[email protected]
https://lists.busybox.net/mailman/listinfo/busybox

Reply via email to