On Wed, Jun 5, 2019 at 5:51 PM Luís Marques <[email protected]> wrote:
> Hello,
>
> This patch mainly intends to add Clang/LLVM support, which currently is 
> broken.
>
> Problem: the const pointer trick (used by the struct globals, etc.) is
> technically undefined behavior. In practice, it causes problems with
> an LLVM-based toolchain, since LLVM optimizes away the store to the
> const pointer (despite the memory barrier), and therefore the applets
> crash when they dereference the null pointers.

Can you experiment with LLVM and find a definition of SET_PTR_TO_GLOBALS()
which works for it?

> There already was a
> preprocessor define (BB_GLOBAL_CONST) in busybox to deal with this
> issue, but it only applied to the ash applet.

..and the way it's done now, it simply kills the optimization.
Sad. I much prefer to retain it.

Please send your patches with git send-email. Your current email
contains unicode chars, hence gmail exports it in base64,
which "patch" too does not grok.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to