https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68794
Bug ID: 68794
Summary: an option for -fsanitize=<foo> is accepted even if the
corresponding library is not available
Product: gcc
Version: 5.3.1
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: driver
Assignee: unassigned at gcc dot gnu.org
Reporter: doko at gcc dot gnu.org
Target Milestone: ---
[forwarded from https://bugs.debian.org/805422]
an option for -fsanitize=<foo> is accepted even if the corresponding library is
not available, e.g. undefined/ubsan on aarch64-linux-gnu. The compiler should
warn when building, not only failing when linking.
...
g++ -DDEBUG -g2 -O1 -std=c++03 -pipe -fsanitize=undefined -c fipsalgt.cpp
g++ -DDEBUG -g2 -O1 -std=c++03 -pipe -fsanitize=undefined -c dlltest.cpp
g++ -o cryptest.exe -DDEBUG -g2 -O1 -std=c++03 -pipe
-fsanitize=undefined bench.o bench2.o test.o validat1.o validat2.o
validat3.o adhoc.o datatest.o regtest.o fipsalgt.o dlltest.o
./libcryptopp.a -pthread
/usr/bin/ld: cannot find -lubsan
collect2: error: ld returned 1 exit status