-
Notifications
You must be signed in to change notification settings - Fork 237
Description
Hi,
Describe the bug
When trying to compile projects using #include <sanitizer/asan_interface.h> (for example libabsl) by using clang from the Yocto SDK with nativesdk-clang and compiler-rt-sanitizers, it shows fatal error: 'sanitizer/asan_interface.h' file not found. The file exists in $OECORE_TARGET_SYSROOT/usr/lib/clang/$version/include, but clang only uses $OECORE_NATIVE_SYSROOT/usr/lib/clang/$version/include and $OECORE_TARGET_SYSROOT/usr/include.
To Reproduce
Tested with poky + meta-clang, both branch scarthgap, with the following settings appended to local.conf:
CLANGSDK = "1"
TOOLCHAIN_TARGET_TASK:append = " compiler-rt-sanitizers"and then
bitbake core-image-minimal -cpopulate_sdk
and then installing the SDK and using a compile command like $CLANGCC -fsanitize=address foo.c -c, where foo.c is simply
#include <sanitizer/asan_interface.h>
Expected behavior
With gcc and gcc-sanitizers it works fine, so I'm assuming that clang should automatically use the include path from compiler-rt-sanitizers too.
Additional context
Possible work-around: Add -isystem "$SDKTARGETSYSROOT/usr/lib/clang/18.1.5/include" when compiling affected projects