Skip to content

[flang] Use clang_target_link_libraries() for clang dependency #126037

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

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Feb 6, 2025

This dependency is part of libclang-cpp, so it should use clang_target_link_libraries.

This dependency is part of libclang-cpp, so it should use
clang_target_link_libraries.
@nikic nikic requested a review from mgorny February 6, 2025 09:41
@llvmbot llvmbot added flang:driver flang Flang issues not falling into any other category labels Feb 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 6, 2025

@llvm/pr-subscribers-flang-driver

Author: Nikita Popov (nikic)

Changes

This dependency is part of libclang-cpp, so it should use clang_target_link_libraries.


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

1 Files Affected:

  • (modified) flang/unittests/Frontend/CMakeLists.txt (+5-1)
diff --git a/flang/unittests/Frontend/CMakeLists.txt b/flang/unittests/Frontend/CMakeLists.txt
index 9177997f41f53ac..2e3e7cb596c5802 100644
--- a/flang/unittests/Frontend/CMakeLists.txt
+++ b/flang/unittests/Frontend/CMakeLists.txt
@@ -12,7 +12,6 @@ add_flang_unittest(FlangFrontendTests
 
 target_link_libraries(FlangFrontendTests
   PRIVATE
-  clangBasic
   flangFrontend
   flangFrontendTool
   FortranLower
@@ -22,6 +21,11 @@ target_link_libraries(FlangFrontendTests
   FortranEvaluate
 )
 
+clang_target_link_libraries(FlangFrontendTests
+  PRIVATE
+  clangBasic
+)
+
 mlir_target_link_libraries(FlangFrontendTests
   PRIVATE
   MLIRIR

Copy link
Member

@mgorny mgorny left a comment

Choose a reason for hiding this comment

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

Thanks!

@nikic nikic merged commit 7c695e4 into llvm:main Feb 6, 2025
11 checks passed
@nikic nikic deleted the flang-clang-dep-fix branch February 6, 2025 13:11
@nikic nikic added this to the LLVM 20.X Release milestone Feb 6, 2025
@nikic
Copy link
Contributor Author

nikic commented Feb 6, 2025

/cherry-pick 7c695e4

@llvmbot
Copy link
Member

llvmbot commented Feb 6, 2025

/pull-request #126062

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 6, 2025

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building flang at step 7 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
...
PASS: UBSan-Standalone-lld-x86_64 :: TestCases/Integer/umul-overflow.cpp (94137 of 98173)
PASS: UBSan-Standalone-lld-x86_64 :: TestCases/Integer/negate-overflow.cpp (94138 of 98173)
UNSUPPORTED: UBSan-Standalone-lld-x86_64 :: TestCases/Misc/Posix/print_stack_trace.cpp (94139 of 98173)
PASS: UBSan-Standalone-lld-x86_64 :: TestCases/Integer/incdec-overflow.cpp (94140 of 98173)
PASS: UBSan-MemorySanitizer-x86_64 :: TestCases/Misc/coverage-levels.cpp (94141 of 98173)
PASS: UBSan-Standalone-lld-x86_64 :: TestCases/Integer/suppressions-builtin.cpp (94142 of 98173)
PASS: UBSan-Standalone-lld-x86_64 :: TestCases/Integer/div-zero.cpp (94143 of 98173)
PASS: UBSan-Standalone-lld-x86_64 :: TestCases/Integer/sub-overflow.cpp (94144 of 98173)
PASS: UBSan-Standalone-lld-x86_64 :: TestCases/Integer/no-recover.cpp (94145 of 98173)
TIMEOUT: MLIR :: Examples/standalone/test.toy (94146 of 98173)
******************** TEST 'MLIR :: Examples/standalone/test.toy' FAILED ********************
Exit Code: 1
Timeout: Reached timeout of 60 seconds

Command Output (stdout):
--
# RUN: at line 1
"/etc/cmake/bin/cmake" "/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/examples/standalone" -G "Ninja"  -DCMAKE_CXX_COMPILER=/usr/bin/clang++  -DCMAKE_C_COMPILER=/usr/bin/clang   -DLLVM_ENABLE_LIBCXX=OFF -DMLIR_DIR=/build/buildbot/premerge-monolithic-linux/build/lib/cmake/mlir  -DLLVM_USE_LINKER=lld  -DPython3_EXECUTABLE="/usr/bin/python3.10"
# executed command: /etc/cmake/bin/cmake /build/buildbot/premerge-monolithic-linux/llvm-project/mlir/examples/standalone -G Ninja -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DLLVM_ENABLE_LIBCXX=OFF -DMLIR_DIR=/build/buildbot/premerge-monolithic-linux/build/lib/cmake/mlir -DLLVM_USE_LINKER=lld -DPython3_EXECUTABLE=/usr/bin/python3.10
# .---command stdout------------
# | -- The CXX compiler identification is Clang 16.0.6
# | -- The C compiler identification is Clang 16.0.6
# | -- Detecting CXX compiler ABI info
# | -- Detecting CXX compiler ABI info - done
# | -- Check for working CXX compiler: /usr/bin/clang++ - skipped
# | -- Detecting CXX compile features
# | -- Detecting CXX compile features - done
# | -- Detecting C compiler ABI info
# | -- Detecting C compiler ABI info - done
# | -- Check for working C compiler: /usr/bin/clang - skipped
# | -- Detecting C compile features
# | -- Detecting C compile features - done
# | -- Looking for histedit.h
# | -- Looking for histedit.h - found
# | -- Found LibEdit: /usr/include (found version "2.11") 
# | -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
# | -- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.13") 
# | -- Using MLIRConfig.cmake in: /build/buildbot/premerge-monolithic-linux/build/lib/cmake/mlir
# | -- Using LLVMConfig.cmake in: /build/buildbot/premerge-monolithic-linux/build/lib/cmake/llvm
# | -- Linker detection: unknown
# | -- Performing Test LLVM_LIBSTDCXX_MIN
# | -- Performing Test LLVM_LIBSTDCXX_MIN - Success
# | -- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
# | -- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
# | -- Performing Test CXX_SUPPORTS_CUSTOM_LINKER
# | -- Performing Test CXX_SUPPORTS_CUSTOM_LINKER - Success
# | -- Performing Test C_SUPPORTS_FPIC
# | -- Performing Test C_SUPPORTS_FPIC - Success
# | -- Performing Test CXX_SUPPORTS_FPIC

swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Feb 10, 2025
…126037)

This dependency is part of libclang-cpp, so it should use
clang_target_link_libraries.

(cherry picked from commit 7c695e4)
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
…126037)

This dependency is part of libclang-cpp, so it should use
clang_target_link_libraries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:driver flang Flang issues not falling into any other category
Projects
Development

Successfully merging this pull request may close these issues.

4 participants