[PATCH] D102453: [CMake][ELF] Add -fno-semantic-interposition for GCC and Clang>=13
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 12 14:05:45 PST 2022
MaskRay added a comment.
In D102453#3238081 <https://reviews.llvm.org/D102453#3238081>, @ljmf00 wrote:
> This patch makes compilation fail when running with sanitization and debug mode, it seems. Brief log here:
>
> FAILED: lib/libLTO.so.14git
> : && /usr/bin/clang++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -
> Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthroug
> h -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -fn
> o-omit-frame-pointer -O1 -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all -fsanitize-address-use-after-scope -fsa
> nitize=fuzzer-no-link -fsanitize-blacklist=/mnt/Workspace/Repos/collab/github/llvm/llvm-project/llvm/utils/sanitizers/ubsan_ignorelist.txt -fdiagnostics-color
> -g -Wl,-z,nodelete -fuse-ld=lld -Wl,--gdb-index -Wl,--color-diagnostics -Wl,--version-script,"/mnt/Workspace/Repos/collab/github/llvm/llvm-project/build/
> tools/lto/LTO.exports" -shared -Wl,-soname,libLTO.so.14git -o lib/libLTO.so.14git tools/lto/CMakeFiles/LTO.dir/LTODisassembler.cpp.o tools/lto/CMakeFiles/LTO.
> dir/lto.cpp.o -Wl,-rpath,"\$ORIGIN/../lib" lib/libLLVM-14git.so && :
> ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol lto_module_is_object_file_for_target; recompile with -fPIC
> >>> defined in tools/lto/CMakeFiles/LTO.dir/lto.cpp.o
> >>> referenced by lto.cpp:175 (/mnt/Workspace/Repos/collab/github/llvm/llvm-project/llvm/tools/lto/lto.cpp:175)
> >>> tools/lto/CMakeFiles/LTO.dir/lto.cpp.o:(lto_module_is_object_file_for_target)
>
> ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol lto_module_has_objc_category; recompile with -fPIC
> >>> defined in tools/lto/CMakeFiles/LTO.dir/lto.cpp.o
> >>> referenced by lto.cpp:183 (/mnt/Workspace/Repos/collab/github/llvm/llvm-project/llvm/tools/lto/lto.cpp:183)
> >>> tools/lto/CMakeFiles/LTO.dir/lto.cpp.o:(lto_module_has_objc_category)
>
> ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol lto_module_is_object_file_in_memory_for_target; recompile with -fPIC
> >>> defined in tools/lto/CMakeFiles/LTO.dir/lto.cpp.o
> >>> referenced by lto.cpp:200 (/mnt/Workspace/Repos/collab/github/llvm/llvm-project/llvm/tools/lto/lto.cpp:200)
> >>> tools/lto/CMakeFiles/LTO.dir/lto.cpp.o:(lto_module_is_object_file_in_memory_for_target)
>
> ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol lto_module_create; recompile with -fPIC
> >>> defined in tools/lto/CMakeFiles/LTO.dir/lto.cpp.o
> >>> referenced by lto.cpp:208 (/mnt/Workspace/Repos/collab/github/llvm/llvm-project/llvm/tools/lto/lto.cpp:208)
> >>> tools/lto/CMakeFiles/LTO.dir/lto.cpp.o:(lto_module_create)
>
> ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol lto_module_create_from_fd; recompile with -fPIC
> >>> defined in tools/lto/CMakeFiles/LTO.dir/lto.cpp.o
> >>> referenced by lto.cpp:219 (/mnt/Workspace/Repos/collab/github/llvm/llvm-project/llvm/tools/lto/lto.cpp:219)
> >>> tools/lto/CMakeFiles/LTO.dir/lto.cpp.o:(lto_module_create_from_fd)
>
> ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol lto_module_create_from_fd_at_offset; recompile with -fPIC
> >>> defined in tools/lto/CMakeFiles/LTO.dir/lto.cpp.o
> >>> referenced by lto.cpp:233 (/mnt/Workspace/Repos/collab/github/llvm/llvm-project/llvm/tools/lto/lto.cpp:233)
> >>> tools/lto/CMakeFiles/LTO.dir/lto.cpp.o:(lto_module_create_from_fd_at_offset)
What's your Clang version? Clang -DLLVM_USE_SANITIZER=Address works well for me (and sanitizer* build bots) with both Debug and Release.
If it's problems in older Clang versions, we can just disable the older versions.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102453/new/
https://reviews.llvm.org/D102453
More information about the llvm-commits
mailing list