GotsanRuntimeCheck fails for me, because of unused command-line arguments in combination with the -Werror flag.
This build error blocks the check-all target.
I run into this issue during 12.0 testing, so I think this should also be backported.
Differential D96762
[sanitizers] fix test failing for -Wunused-command-line-argument protze.joachim on Feb 16 2021, 1:52 AM. Authored by
Details GotsanRuntimeCheck fails for me, because of unused command-line arguments in combination with the -Werror flag. I run into this issue during 12.0 testing, so I think this should also be backported.
Diff Detail Event TimelineComment Actions FAILED: projects/compiler-rt/lib/tsan/CMakeFiles/GotsanRuntimeCheck cd /dev/shm/jprotze/llvm-project/compiler-rt/lib/tsan/go && env "CC=/home/pj416018/sw/UTIL/ccache/bin/clang " IN_TMPDIR=1 SILENT=1 /dev/shm/jprotze/llvm-project/compiler-rt/lib/tsan/go/buildgo.sh clang-11: error: argument unused during compilation: '-I ../rtl' [-Werror,-Wunused-command-line-argument] clang-11: error: argument unused during compilation: '-I ../..' [-Werror,-Wunused-command-line-argument] clang-11: error: argument unused during compilation: '-I ../../sanitizer_common' [-Werror,-Wunused-command-line-argument] clang-11: error: argument unused during compilation: '-I ../../../include' [-Werror,-Wunused-command-line-argument] Removing those include directories causes issues in the same compilation step. I'm using ccache-swig as a compiler cache. Probably, this tool breaks the compilation steps further down but does not filter the arguments properly. Comment Actions How about passing the CMAKE_C_FLAGS into the script? Because of ccache, I use the -Wno-unused-command-line-argument flags anyways. Comment Actions
This looks fine to me. Comment Actions This breaks building with PGO: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8854980816661584704/+/steps/package_clang/0/stdout?format=raw FAILED: projects/compiler-rt/lib/tsan/CMakeFiles/GotsanRuntimeCheck cd /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/go && env "CC=/b/s/w/ir/cache/builder/src/third_party/llvm-bootstrap-install/bin/clang " "EXTRA_CFLAGS=--gcc-toolchain=/b/s/w/ir/cache/builder/src/third_party/llvm-build-tools/gcc-10.2.0-trusty -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -fprofile-instr-use=\"/b/s/w/ir/cache/builder/src/third_party/llvm-instrumented/profdata.prof\" -flto=thin -Wall -Wno-unused-parameter" IN_TMPDIR=1 SILENT=1 /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/go/buildgo.sh error: Could not read profile "/b/s/w/ir/cache/builder/src/third_party/llvm-instrumented/profdata.prof": No such file or directory 1 error generated. Comment Actions Mkay, they I guess we need to revert. Or, Joachim, do you have any ideas for an alternative fix? We could whitelist/blacklist flags from $EXTRA_CFLAGS... I can't think of anything better atm. Comment Actions @thakis thanks for reverting the patch. I was offline over the weekend. The new patch sets -Wno-error=unused-command-line-argument if -Wno-unused-command-line-argument or -Wno-error=unused-command-line-argument is in $CMAKE_C_FLAGS instead of passing CMAKE_C_FLAGS into the script. |