Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang-repl][CMake][MSVC] Use LINKER: instead of -Wl #118518

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

Maetveis
Copy link
Contributor

@Maetveis Maetveis commented Dec 3, 2024

This should be more portable, and avoids passing the option to clang-cl when linking, because clang-cl accepts any -W flags (normally warning flags) during linking (#118516).

This is supported since CMake 3.12, it should be more portable too.
This also avoids passing the option to `clang-cl` when linking,
because `clang-cl` accepts any `-W` flags (normally warning flags)
during linking (llvm#118516).
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Dec 3, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 3, 2024

@llvm/pr-subscribers-clang

Author: Mészáros Gergely (Maetveis)

Changes

This is supported since CMake 3.12, it should be more portable too. This also avoids passing the option to clang-cl when linking, because clang-cl accepts any -W flags (normally warning flags) during linking (#118516).


Full diff: https://github.com/llvm/llvm-project/pull/118518.diff

1 Files Affected:

  • (modified) clang/tools/clang-repl/CMakeLists.txt (+1-1)
diff --git a/clang/tools/clang-repl/CMakeLists.txt b/clang/tools/clang-repl/CMakeLists.txt
index 7aebbe7a19436a..f9a911b0ae8e24 100644
--- a/clang/tools/clang-repl/CMakeLists.txt
+++ b/clang/tools/clang-repl/CMakeLists.txt
@@ -66,7 +66,7 @@ clang_target_link_libraries(clang-repl PRIVATE
 # start to exceed this limit, e.g. when linking for arm-linux-gnueabihf with
 # gold. This flag tells the linker to build a PLT for the full address range.
 # Linkers without this flag are assumed to support proper PLTs by default.
-set(flag_long_plt "-Wl,--long-plt")
+set(flag_long_plt "LINKER:--long-plt")
 check_linker_flag(CXX ${flag_long_plt} HAVE_LINKER_FLAG_LONG_PLT)
 if(HAVE_LINKER_FLAG_LONG_PLT)
   target_link_options(clang-repl PRIVATE ${flag_long_plt})

@Maetveis Maetveis requested a review from vgvassilev December 3, 2024 17:28
Copy link
Contributor

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Maetveis Maetveis merged commit 3b0cb89 into llvm:main Dec 4, 2024
10 checks passed
@Maetveis
Copy link
Contributor Author

Maetveis commented Dec 4, 2024

LGTM!

Thanks!

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 4, 2024

LLVM Buildbot has detected a new failure on builder libc-x86_64-debian-fullbuild-dbg-asan running on libc-x86_64-debian-fullbuild while building clang at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/171/builds/11578

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcSelectTest.SelectInvalidFD
[       OK ] LlvmLibcSelectTest.SelectInvalidFD (27 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[947/1099] Running unit test libc.test.src.sys.sendfile.sendfile_test
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcSendfileTest.CreateAndTransfer
[       OK ] LlvmLibcSendfileTest.CreateAndTransfer (374 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[948/1099] Running unit test libc.test.src.sys.mman.linux.process_mrelease_test
FAILED: projects/libc/test/src/sys/mman/linux/CMakeFiles/libc.test.src.sys.mman.linux.process_mrelease_test /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/test/src/sys/mman/linux/CMakeFiles/libc.test.src.sys.mman.linux.process_mrelease_test 
cd /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/test/src/sys/mman/linux && /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/test/src/sys/mman/linux/libc.test.src.sys.mman.linux.process_mrelease_test.__build__
[==========] Running 3 tests from 1 test suite.
[ RUN      ] LlvmLibcProcessMReleaseTest.NoError
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/sys/mman/linux/process_mrelease_test.cpp:44: FAILURE
Failed to match LIBC_NAMESPACE::process_mrelease(pidfd, 0) against Succeeds().
Expected return value to be equal to 0 but got -1.
Expected errno to be equal to "Success" but got "No such process".
[  FAILED  ] LlvmLibcProcessMReleaseTest.NoError
[ RUN      ] LlvmLibcProcessMReleaseTest.ErrorNotKilled
[       OK ] LlvmLibcProcessMReleaseTest.ErrorNotKilled (783 us)
[ RUN      ] LlvmLibcProcessMReleaseTest.ErrorNonExistingPidfd
[       OK ] LlvmLibcProcessMReleaseTest.ErrorNonExistingPidfd (9 us)
Ran 3 tests.  PASS: 2  FAIL: 1
[949/1099] Running unit test libc.test.src.sys.resource.getrlimit_setrlimit_test
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcResourceLimitsTest.SetNoFileLimit
[       OK ] LlvmLibcResourceLimitsTest.SetNoFileLimit (309 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[950/1099] Running unit test libc.test.src.sys.socket.linux.socket_test
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcSocketTest.LocalSocket
[       OK ] LlvmLibcSocketTest.LocalSocket (70 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[951/1099] Running unit test libc.test.src.sys.socket.linux.socketpair_test
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcSocketPairTest.LocalSocket
[       OK ] LlvmLibcSocketPairTest.LocalSocket (125 us)
[ RUN      ] LlvmLibcSocketPairTest.SocketFails
[       OK ] LlvmLibcSocketPairTest.SocketFails (3 us)
Ran 2 tests.  PASS: 2  FAIL: 0
[952/1099] Running unit test libc.test.src.sys.socket.linux.send_recv_test
[==========] Running 3 tests from 1 test suite.
[ RUN      ] LlvmLibcSendRecvTest.SucceedsWithSocketPair
[       OK ] LlvmLibcSendRecvTest.SucceedsWithSocketPair (181 us)
[ RUN      ] LlvmLibcSendRecvTest.SendFails
[       OK ] LlvmLibcSendRecvTest.SendFails (3 us)
[ RUN      ] LlvmLibcSendRecvTest.RecvFails
[       OK ] LlvmLibcSendRecvTest.RecvFails (3 us)
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcSelectTest.SelectInvalidFD
[       OK ] LlvmLibcSelectTest.SelectInvalidFD (27 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[947/1099] Running unit test libc.test.src.sys.sendfile.sendfile_test
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcSendfileTest.CreateAndTransfer
[       OK ] LlvmLibcSendfileTest.CreateAndTransfer (374 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[948/1099] Running unit test libc.test.src.sys.mman.linux.process_mrelease_test
FAILED: projects/libc/test/src/sys/mman/linux/CMakeFiles/libc.test.src.sys.mman.linux.process_mrelease_test /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/test/src/sys/mman/linux/CMakeFiles/libc.test.src.sys.mman.linux.process_mrelease_test 
cd /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/test/src/sys/mman/linux && /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/projects/libc/test/src/sys/mman/linux/libc.test.src.sys.mman.linux.process_mrelease_test.__build__
[==========] Running 3 tests from 1 test suite.
[ RUN      ] LlvmLibcProcessMReleaseTest.NoError
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/src/sys/mman/linux/process_mrelease_test.cpp:44: FAILURE
Failed to match LIBC_NAMESPACE::process_mrelease(pidfd, 0) against Succeeds().
Expected return value to be equal to 0 but got -1.
Expected errno to be equal to "Success" but got "No such process".
[  FAILED  ] LlvmLibcProcessMReleaseTest.NoError
[ RUN      ] LlvmLibcProcessMReleaseTest.ErrorNotKilled
[       OK ] LlvmLibcProcessMReleaseTest.ErrorNotKilled (783 us)
[ RUN      ] LlvmLibcProcessMReleaseTest.ErrorNonExistingPidfd
[       OK ] LlvmLibcProcessMReleaseTest.ErrorNonExistingPidfd (9 us)
Ran 3 tests.  PASS: 2  FAIL: 1
[949/1099] Running unit test libc.test.src.sys.resource.getrlimit_setrlimit_test
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcResourceLimitsTest.SetNoFileLimit
[       OK ] LlvmLibcResourceLimitsTest.SetNoFileLimit (309 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[950/1099] Running unit test libc.test.src.sys.socket.linux.socket_test
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcSocketTest.LocalSocket
[       OK ] LlvmLibcSocketTest.LocalSocket (70 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[951/1099] Running unit test libc.test.src.sys.socket.linux.socketpair_test
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcSocketPairTest.LocalSocket
[       OK ] LlvmLibcSocketPairTest.LocalSocket (125 us)
[ RUN      ] LlvmLibcSocketPairTest.SocketFails
[       OK ] LlvmLibcSocketPairTest.SocketFails (3 us)
Ran 2 tests.  PASS: 2  FAIL: 0
[952/1099] Running unit test libc.test.src.sys.socket.linux.send_recv_test
[==========] Running 3 tests from 1 test suite.
[ RUN      ] LlvmLibcSendRecvTest.SucceedsWithSocketPair
[       OK ] LlvmLibcSendRecvTest.SucceedsWithSocketPair (181 us)
[ RUN      ] LlvmLibcSendRecvTest.SendFails
[       OK ] LlvmLibcSendRecvTest.SendFails (3 us)
[ RUN      ] LlvmLibcSendRecvTest.RecvFails
[       OK ] LlvmLibcSendRecvTest.RecvFails (3 us)

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 6, 2024

LLVM Buildbot has detected a new failure on builder clang-ppc64-aix running on aix-ppc64 while building clang at step 3 "clean-build-dir".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/64/builds/1628

Here is the relevant piece of the build log for the reference
Step 3 (clean-build-dir) failure: Delete failed. (failure) (timed out)
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'Clang :: ClangScanDeps/verbose.test' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: rm -rf /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp
+ rm -rf /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp
RUN: at line 2: split-file /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/ClangScanDeps/verbose.test /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp
+ split-file /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/ClangScanDeps/verbose.test /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp
RUN: at line 3: sed -e "s|DIR|/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp|g" /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp/cdb.json.in > /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp/cdb.json
+ sed -e 's|DIR|/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp|g' /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp/cdb.json.in
RUN: at line 5: /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/bin/clang-scan-deps -compilation-database /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp/cdb.json -v -o /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp/result.json 2>&1 | /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/bin/FileCheck /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/ClangScanDeps/verbose.test
+ /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/bin/clang-scan-deps -compilation-database /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp/cdb.json -v -o /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/test/ClangScanDeps/Output/verbose.test.tmp/result.json
+ /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/bin/FileCheck /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/ClangScanDeps/verbose.test
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/ClangScanDeps/verbose.test:6:11: error: CHECK: expected string not found in input
// CHECK: *** Virtual File System Stats:
          ^
<stdin>:1:1: note: scanning from here
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
^
<stdin>:1:8: note: possible intended match here
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
       ^

Input file: <stdin>
Check file: /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/ClangScanDeps/verbose.test

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. 
check:6'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
check:6'1            ?                                                                                                     possible intended match
>>>>>>

--

********************


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants