Bug 1278914 - clang -fsanitize=undefined fails due to missing libclang_rt.ubsan_standalone-x86_64.a file
Summary: clang -fsanitize=undefined fails due to missing libclang_rt.ubsan_standalone-...
Keywords:
Status: CLOSED DUPLICATE of bug 1263834
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm
Version: 23
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Adam Jackson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-06 18:12 UTC by Stefan Hajnoczi
Modified: 2016-01-27 13:29 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-01-27 13:29:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Stefan Hajnoczi 2015-11-06 18:12:46 UTC
Description of problem:

clang -fsanitize=undefined results in a linker error because the missing runtime for the sanitizer is missing from the clang package.


Version-Release number of selected component (if applicable):

clang-libs-3.7.0-1.fc23.x86_64
clang-3.7.0-1.fc23.x86_64

How reproducible:

Deterministic


Steps to Reproduce:
1. cat >a.c
int main(int argc, char* argv) { return 0; }
^D
2. clang -fsanitize=undefined -o a a.c

Actual results:

/usr/bin/ld: cannot find /usr/bin/../lib/clang/3.7.0/lib/linux/libclang_rt.ubsan_standalone-x86_64.a: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Expected results:

Successful compilation.

Additional info:

I couldn't find libclang_rt.ubsan_standalone-x86_64.a using dnf whatprovides, so I guess it's simply not built/packaged yet.

Comment 1 Stefan Hajnoczi 2015-11-06 18:13:31 UTC
This is a regression, it worked fine in F22.

Comment 2 Laurent Rineau 2016-01-27 13:26:13 UTC
Same with the other sanitizers.

$ clang -o /dev/null -fsanitize=memory main.c
/usr/bin/ld: cannot find /usr/bin/../lib/clang/3.7.0/lib/linux/libclang_rt.msan-x86_64.a: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
zsh: exit 1     clang -o /dev/null -fsanitize=memory main.c
zsh: exit 1
$ clang -o /dev/null -fsanitize=address main.c
/usr/bin/ld: cannot find /usr/bin/../lib/clang/3.7.0/lib/linux/libclang_rt.asan-x86_64.a: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
zsh: exit 1     clang -o /dev/null -fsanitize=address main.c
zsh: exit 1
$ clang -o /dev/null -fsanitize=thread main.c 
/usr/bin/ld: cannot find /usr/bin/../lib/clang/3.7.0/lib/linux/libclang_rt.tsan-x86_64.a: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
zsh: exit 1     clang -o /dev/null -fsanitize=thread main.c
zsh: exit 1

Comment 3 Laurent Rineau 2016-01-27 13:26:55 UTC
Might be related to upstream issues pointed out by that ArchLinux bug report:
https://bugs.archlinux.org/task/46392

Comment 4 Laurent Rineau 2016-01-27 13:29:08 UTC

*** This bug has been marked as a duplicate of bug 1263834 ***


Note You need to log in before you can comment on or make changes to this bug.