[flang-commits] [flang] 3119bdb - [Flang][CMake] Add explicit libFortranCommon dependency for f18 etc.

Rainer Orth via flang-commits flang-commits at lists.llvm.org
Tue Apr 28 04:30:24 PDT 2020


Author: Rainer Orth
Date: 2020-04-28T13:28:41+02:00
New Revision: 3119bdb5d6955e85ddb45e9319608fa8a5915330

URL: https://github.com/llvm/llvm-project/commit/3119bdb5d6955e85ddb45e9319608fa8a5915330
DIFF: https://github.com/llvm/llvm-project/commit/3119bdb5d6955e85ddb45e9319608fa8a5915330.diff

LOG: [Flang][CMake] Add explicit libFortranCommon dependency for f18 etc.

When I tried Solaris builds with `-DBUILD_SHARED_LIBS=ON`, some commands failed
to link:

  [ 94%] Linking CXX executable ../../../../bin/f18
  Undefined                       first referenced
   symbol                             in file
  Fortran::common::IntrinsicTypeDefaultKinds::set_sizeIntegerKind(int) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
  Fortran::common::IntrinsicTypeDefaultKinds::set_subscriptIntegerKind(int) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
  Fortran::common::EnumIndexToString[abi:cxx11](int, char const*) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
  Fortran::common::IntrinsicTypeDefaultKinds::set_defaultIntegerKind(int) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
  Fortran::common::IntrinsicTypeDefaultKinds::IntrinsicTypeDefaultKinds() CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
  Fortran::common::IntrinsicTypeDefaultKinds::set_defaultRealKind(int) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
  ld: fatal: symbol referencing errors

This patch fixes this by adding explicit dependencies on `libFortranCommon`
to the affected commands.

Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and
`x86-64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D78761

Added: 
    

Modified: 
    flang/tools/f18-parse-demo/CMakeLists.txt
    flang/tools/f18/CMakeLists.txt
    flang/unittests/Evaluate/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/flang/tools/f18-parse-demo/CMakeLists.txt b/flang/tools/f18-parse-demo/CMakeLists.txt
index ab13d602542f..d60d7d6d5cbd 100644
--- a/flang/tools/f18-parse-demo/CMakeLists.txt
+++ b/flang/tools/f18-parse-demo/CMakeLists.txt
@@ -5,5 +5,6 @@ add_flang_tool(f18-parse-demo
 
 target_link_libraries(f18-parse-demo
   PRIVATE
+  FortranCommon
   FortranParser
   )

diff  --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt
index 70e09ef55144..c3c43c04edd7 100644
--- a/flang/tools/f18/CMakeLists.txt
+++ b/flang/tools/f18/CMakeLists.txt
@@ -5,6 +5,7 @@ add_flang_tool(f18
 
 target_link_libraries(f18
   PRIVATE
+  FortranCommon
   FortranParser
   FortranEvaluate
   FortranSemantics

diff  --git a/flang/unittests/Evaluate/CMakeLists.txt b/flang/unittests/Evaluate/CMakeLists.txt
index 54c816ef6c55..21aa2edfccb7 100644
--- a/flang/unittests/Evaluate/CMakeLists.txt
+++ b/flang/unittests/Evaluate/CMakeLists.txt
@@ -41,6 +41,7 @@ add_executable(expression-test
 )
 
 target_link_libraries(expression-test
+  FortranCommon
   FortranEvaluateTesting
   FortranEvaluate
   FortranSemantics
@@ -64,6 +65,7 @@ add_executable(intrinsics-test
 )
 
 target_link_libraries(intrinsics-test
+  FortranCommon
   FortranEvaluateTesting
   FortranEvaluate
   FortranDecimal
@@ -130,6 +132,7 @@ add_executable(folding-test
 )
 
 target_link_libraries(folding-test
+  FortranCommon
   FortranEvaluateTesting
   FortranEvaluate
   FortranSemantics


        


More information about the flang-commits mailing list