[Toybox] gcc vs llvm -static-libasan
Rob Landley
rob at landley.net
Tue Jul 9 12:18:50 PDT 2024
On 7/9/24 12:35, enh wrote:
> On Tue, Jul 9, 2024 at 10:02 AM enh <enh at google.com> wrote:
>> On Tue, Jul 9, 2024 at 8:47 AM Rob Landley <rob at landley.net> wrote:
>>
>> i'll forward this to the llvm asan folks anyway, in particular the
>> "gcc and llvm use different flags" is the kind of papercut that i
>> think both gcc and llvm have been trying harder to avoid lately.
>
> https://github.com/llvm/llvm-project/pull/98194 for that.
Wunderbar. (I think it's related to the stroopwafel.)
When does your AOSP toolchain update in the main build so I can commit/push a
change using it for ASAN=1 builds without inconveniencing you?
> apparently your "static asan" request is even harder than i thought...
Last time I tried setting up a container we wound up debugging stdin handling in
bionic's _start code (although that _was_ because the laptop I was using at the
time had an old processor throwing illegal instruction errors, so I needed to
build a kernel and run it through qemu and used mkroot, which triggered some sad
initramfs behavior in the kernel.)
The current laptop seems to run the binaries so far. (I'm grinding through make
tests even, just static build without ASAN enabled...)
> the folks who actually know what they're talking about (because they
> implemented all of these things), fully static asan isn't a thing ---
It is for gcc/glibc, although I expect they're only implementing half the tests
the LLVM guys have...
> "bionic's hwasan support is a special well-integrated combination that
> works in static binaries, but everything else relies on symbol
> interposition and the presence of the dynamic loader".
>
> so my default knee-jerk "have you tried hwasan?" was closer to the
> mark than i realized at the time :-)
Does qemu-system-aarrcchh6644 emulate hwasan? If so, how do I get a dynamic
bionic chroot of a reasonable size to boot under qemu to test binaries? (If the
NDK doesn't have an extractable sysroot dir, does AOSP have some sort of "lunch
shellprompt"?)
Or should I stick with the glibc one once I can check that in? (Dynamic linked
bionic would allow more of the utf-8 plumbing to work, and thus get tested by
me, but I have to finish replacing -lcrypt with lib/crypt.c before "make
defconfig" builds under bionic, so I'm busy here for a while yet...)
Rob
More information about the Toybox
mailing list