Page MenuHomePhabricator

[cmake] Dedup linker flag check polyfill
Needs ReviewPublic

Authored by Ericson2314 on Jul 25 2022, 8:34 PM.

Details

Reviewers
phosek
Group Reviewers
Restricted Project
Restricted Project
Restricted Project
Summary

Finishing what https://reviews.llvm.org/D117537 started. This is also
what @phosek wanted.

We had two issues before, which are now fixed.

  1. HandleOutOfTreeLLVM didn't work with compiler-rt

    Removed in D125561
  1. CMake's CMP0056 couldn't be relied upon

    Locally forced on in D118546

Diff Detail

Unit TestsFailed

TimeTest
6,140 mslibcxx CI Clang-cl (DLL) > llvm-libc++-shared-clangcl-cfg-in.std/input_output/filesystems/class_directory_iterator/directory_iterator_members::ctor.pass.cpp
Script: -- : 'COMPILED WITH'; 'C:/Program Files/LLVM/bin/clang-cl.exe' C:\ws\w9\llvm-project\libcxx-ci\libcxx\test\std\input.output\filesystems\class.directory_iterator\directory_iterator.members\ctor.pass.cpp --driver-mode=g++ --target=x86_64-pc-windows-msvc -nostdinc++ -I C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/include/c++/v1 -I C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/include/c++/v1 -I C:/ws/w9/llvm-project/libcxx-ci/libcxx/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -DTEST_WINDOWS_DLL -nostdlib -L C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/lib -lc++ -lmsvcrt -lmsvcprt -loldnames -o C:\ws\w9\llvm-project\libcxx-ci\build\clang-cl-dll\test\std\input.output\filesystems\class.directory_iterator\directory_iterator.members\Output\ctor.pass.cpp.dir\t.tmp.exe
5,940 mslibcxx CI Clang-cl (DLL) > llvm-libc++-shared-clangcl-cfg-in.std/input_output/filesystems/class_rec_dir_itr/rec_dir_itr_members::ctor.pass.cpp
Script: -- : 'COMPILED WITH'; 'C:/Program Files/LLVM/bin/clang-cl.exe' C:\ws\w9\llvm-project\libcxx-ci\libcxx\test\std\input.output\filesystems\class.rec.dir.itr\rec.dir.itr.members\ctor.pass.cpp --driver-mode=g++ --target=x86_64-pc-windows-msvc -nostdinc++ -I C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/include/c++/v1 -I C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/include/c++/v1 -I C:/ws/w9/llvm-project/libcxx-ci/libcxx/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -DTEST_WINDOWS_DLL -nostdlib -L C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/lib -lc++ -lmsvcrt -lmsvcprt -loldnames -o C:\ws\w9\llvm-project\libcxx-ci\build\clang-cl-dll\test\std\input.output\filesystems\class.rec.dir.itr\rec.dir.itr.members\Output\ctor.pass.cpp.dir\t.tmp.exe
5,670 mslibcxx CI Clang-cl (DLL) > llvm-libc++-shared-clangcl-cfg-in.std/input_output/filesystems/fs_op_funcs/fs_op_canonical::canonical.pass.cpp
Script: -- : 'COMPILED WITH'; 'C:/Program Files/LLVM/bin/clang-cl.exe' C:\ws\w9\llvm-project\libcxx-ci\libcxx\test\std\input.output\filesystems\fs.op.funcs\fs.op.canonical\canonical.pass.cpp --driver-mode=g++ --target=x86_64-pc-windows-msvc -nostdinc++ -I C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/include/c++/v1 -I C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/include/c++/v1 -I C:/ws/w9/llvm-project/libcxx-ci/libcxx/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -DTEST_WINDOWS_DLL -nostdlib -L C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/lib -lc++ -lmsvcrt -lmsvcprt -loldnames -o C:\ws\w9\llvm-project\libcxx-ci\build\clang-cl-dll\test\std\input.output\filesystems\fs.op.funcs\fs.op.canonical\Output\canonical.pass.cpp.dir\t.tmp.exe
5,730 mslibcxx CI Clang-cl (DLL) > llvm-libc++-shared-clangcl-cfg-in.std/input_output/filesystems/fs_op_funcs/fs_op_copy::copy.pass.cpp
Script: -- : 'COMPILED WITH'; 'C:/Program Files/LLVM/bin/clang-cl.exe' C:\ws\w9\llvm-project\libcxx-ci\libcxx\test\std\input.output\filesystems\fs.op.funcs\fs.op.copy\copy.pass.cpp --driver-mode=g++ --target=x86_64-pc-windows-msvc -nostdinc++ -I C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/include/c++/v1 -I C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/include/c++/v1 -I C:/ws/w9/llvm-project/libcxx-ci/libcxx/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -DTEST_WINDOWS_DLL -nostdlib -L C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/lib -lc++ -lmsvcrt -lmsvcprt -loldnames -o C:\ws\w9\llvm-project\libcxx-ci\build\clang-cl-dll\test\std\input.output\filesystems\fs.op.funcs\fs.op.copy\Output\copy.pass.cpp.dir\t.tmp.exe
5,720 mslibcxx CI Clang-cl (DLL) > llvm-libc++-shared-clangcl-cfg-in.std/input_output/filesystems/fs_op_funcs/fs_op_copy_file::copy_file.pass.cpp
Script: -- : 'COMPILED WITH'; 'C:/Program Files/LLVM/bin/clang-cl.exe' C:\ws\w9\llvm-project\libcxx-ci\libcxx\test\std\input.output\filesystems\fs.op.funcs\fs.op.copy_file\copy_file.pass.cpp --driver-mode=g++ --target=x86_64-pc-windows-msvc -nostdinc++ -I C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/include/c++/v1 -I C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/include/c++/v1 -I C:/ws/w9/llvm-project/libcxx-ci/libcxx/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -DTEST_WINDOWS_DLL -nostdlib -L C:/ws/w9/llvm-project/libcxx-ci/build/clang-cl-dll/lib -lc++ -lmsvcrt -lmsvcprt -loldnames -o C:\ws\w9\llvm-project\libcxx-ci\build\clang-cl-dll\test\std\input.output\filesystems\fs.op.funcs\fs.op.copy_file\Output\copy_file.pass.cpp.dir\t.tmp.exe
View Full Test Results (370 Failed)

Event Timeline

Ericson2314 created this revision.Jul 25 2022, 8:34 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 25 2022, 8:34 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Ericson2314 requested review of this revision.Jul 25 2022, 8:34 PM
Herald added projects: Restricted Project, Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptJul 25 2022, 8:34 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript

Retrigger CI

I wonder if we can de-duplicate the checks and re-use the results across the projects.

compiler-rt/cmake/config-ix.cmake
177–178

I really wold rather prefer -ztext as the spelling rather than -Wl,-z,text. -z flags are passed through the driver to the linker. This would mean that we match the behaviour with things like -fuse-ld=lld below.

196

Similar, -zglobal would be preferable IMO.

Ericson2314 added inline comments.Jul 28 2022, 3:46 PM
compiler-rt/cmake/config-ix.cmake
196

@compnerd there are some other occurences -Wl,-z in this file, would like them all to be plain -z?

phosek accepted this revision.Jul 29 2022, 12:03 AM

LGTM

Ericson2314 edited the summary of this revision. (Show Details)Aug 1 2022, 8:27 AM