[Buildroot-users] UndefinedBehaviorSanitizer

Thomas Petazzoni thomas.petazzoni at bootlin.com
Wed Apr 9 09:07:30 UTC 2025


Hello David,

On Wed, 9 Apr 2025 09:58:32 +0200
David Picard <david.picard at clermont.in2p3.fr> wrote:

> I just made a full rebuild but as a matter of fact, the toolchain is not 
> copied to staging:
> $ find host staging target -iname "*libubsan*"
> host/opt/ext-toolchain/arm-buildroot-linux-gnueabihf/lib/libubsan.so.1.0.0
> host/opt/ext-toolchain/arm-buildroot-linux-gnueabihf/lib/libubsan.a
> host/opt/ext-toolchain/arm-buildroot-linux-gnueabihf/lib/libubsan.so.1
> host/opt/ext-toolchain/arm-buildroot-linux-gnueabihf/lib/libubsan.so
> host/opt/ext-toolchain/arm-buildroot-linux-gnueabihf/lib/libubsan.la

I'm pretty sure you're doing something wrong (but I'm not sure what),
because I guarantee you that the full sysroot is copied to staging.

I just built the following simple configuration:

BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y

And libubsan is both in host/opt/ext-toolchain/ where the toolchain was
extracted, and then copied into the staging directory:

./output/host/opt/ext-toolchain/aarch64-none-linux-gnu/libc/usr/lib64/libubsan.so.1.0.0
./output/host/opt/ext-toolchain/aarch64-none-linux-gnu/libc/usr/lib64/libubsan.so
./output/host/opt/ext-toolchain/aarch64-none-linux-gnu/libc/usr/lib64/libubsan.so.1
./output/host/opt/ext-toolchain/aarch64-none-linux-gnu/lib64/libubsan.so.1.0.0
./output/host/opt/ext-toolchain/aarch64-none-linux-gnu/lib64/libubsan.so
./output/host/opt/ext-toolchain/aarch64-none-linux-gnu/lib64/libubsan.a
./output/host/opt/ext-toolchain/aarch64-none-linux-gnu/lib64/libubsan.so.1
./output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libubsan.so.1.0.0
./output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libubsan.so
./output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libubsan.so.1
./output/host/aarch64-buildroot-linux-gnu/sysroot/lib/libubsan.so.1.0.0
./output/host/aarch64-buildroot-linux-gnu/sysroot/lib/libubsan.so
./output/host/aarch64-buildroot-linux-gnu/sysroot/lib/libubsan.a
./output/host/aarch64-buildroot-linux-gnu/sysroot/lib/libubsan.so.1

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com


More information about the buildroot-users mailing list