Skip to content
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

zig cc: undefined symbol: __ubsan_handle_add_overflow #17097

Open
xzto opened this issue Sep 8, 2023 · 1 comment
Open

zig cc: undefined symbol: __ubsan_handle_add_overflow #17097

xzto opened this issue Sep 8, 2023 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@xzto
Copy link

xzto commented Sep 8, 2023

Zig Version

0.12.0-dev.289+b642bb92e

Steps to Reproduce and Observed Behavior

// overflow.c
unsigned foo(unsigned a, unsigned b) {
    return a + b;
}

int main(void) {return 0;}

$ zig cc overflow.c -fsanitize=unsigned-integer-overflow

LLD Link... ld.lld: error: undefined symbol: __ubsan_handle_add_overflow
>>> referenced by overflow.c:2
>>>               /home/xzto/.cache/zig/o/f31c2c508be8c5b115df26da78214296/overflow.o:(foo)

It works if you replace zig cc with clang.

Expected Behavior

Successful compilation.

@xzto xzto added the bug Observed behavior contradicts documented or intended behavior label Sep 8, 2023
@rohlem
Copy link
Contributor

rohlem commented Sep 9, 2023

I think the main tracking issue for UBSan is currently #5163 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

2 participants