-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nativesdk-clang does not find its sanitizer/*.h include files #978
Comments
I too have this issue for the native and target toolchain, clang is installed under /usr/lib/clang/$version but the sanitizers are under /usr/lib/clang/$version.$minor.$patch |
…issue Instead of moving the whole install under major.minor.patch, create a symlink so both can be included Fixes kraj#978 Signed-off-by: Khem Raj <[email protected]>
@dkl and @FederAndInk can you test the patch in #994 and report back ? |
Sure, thanks, testing this right now 👍 |
I think the problem is that the compiler headers path it pointing to recipe-sysroot-native and not recipe-sysroot. The patch I posted will not solve that problem. On the other hand if you add
This will work. |
Actually I am building clang for the target and using it on the "target", with the patch you posted, it is now working |
I will be testing the sdk variant soon |
isn't a bit weird to put a nativesdk version in |
ok so looks like you're right, trying
|
yeah I dont think its the right solution, I was just saying this to prove the problem as we understand. I think correct fix would be to fix the compiler to look into target sysroot for compiler headers. |
OK, so this patch atleast fixes one case. So maybe we can merge this one and keep searching to solve the second one in nativesdk cross compiler include search path fixes. |
ok I see your point
right, thanks again :) |
Yes reopen it and please sent a pull request for scarthgap |
…issue Instead of moving the whole install under major.minor.patch, create a symlink so both can be included Fixes kraj#978 Signed-off-by: Khem Raj <[email protected]> Signed-off-by: Ludovic Jozeau <[email protected]> (cherry picked from commit a219212)
…issue Instead of moving the whole install under major.minor.patch, create a symlink so both can be included Fixes #978 Signed-off-by: Khem Raj <[email protected]> Signed-off-by: Ludovic Jozeau <[email protected]> (cherry picked from commit a219212)
After the patch which adds the symlink to
( |
right, I guess the same logic should be applied to compiler-rt recipe too |
…issue Source: meta-clang MR: 158405 Type: Integration Disposition: Merged from meta-clang ChangeID: 7d9bf6d Description: Instead of moving the whole install under major.minor.patch, create a symlink so both can be included Fixes kraj/meta-clang#978 Signed-off-by: Khem Raj <[email protected]> Signed-off-by: Ludovic Jozeau <[email protected]> (cherry picked from commit a219212) Signed-off-by: Jeremy A. Puhlman <[email protected]>
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 withnativesdk-clang
andcompiler-rt-sanitizers
, it showsfatal 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:
and then
and then installing the SDK and using a compile command like
$CLANGCC -fsanitize=address foo.c -c
, where foo.c is simplyExpected behavior
With gcc and
gcc-sanitizers
it works fine, so I'm assuming that clang should automatically use the include path fromcompiler-rt-sanitizers
too.Additional context
Possible work-around: Add
-isystem "$SDKTARGETSYSROOT/usr/lib/clang/18.1.5/include"
when compiling affected projectsThe text was updated successfully, but these errors were encountered: