[PATCH] D39601: [CMake] Allow for Solaris ld -V output on stdout

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 08:55:25 PDT 2017


ro created this revision.
Herald added a subscriber: mgorny.

In recent versions of Solaris 11.4 (previously 12), ld -V output went to stdout instead
of stderr.  Since AddLLVM.cmake only expects it on stderr, Solaris ld wasn't properly
detected and options not understood by it are passed during the build.

The following patch fixes this, allowing for both variants.

Tested on i386-pc-solaris2.11.4 (on top of https://reviews.llvm.org/D35755 which is needed for proper
Solaris support).


https://reviews.llvm.org/D39601

Files:
  cmake/modules/AddLLVM.cmake


Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -169,7 +169,8 @@
   elseif("${stdout}" MATCHES "GNU ld")
     set(LLVM_LINKER_IS_GNULD ON)
     message(STATUS "Linker detection: GNU ld")
-  elseif("${stderr}" MATCHES "Solaris Link Editors")
+  elseif("${stderr}" MATCHES "Solaris Link Editors" OR
+         "${stdout}" MATCHES "Solaris Link Editors")
     set(LLVM_LINKER_IS_SOLARISLD ON)
     message(STATUS "Linker detection: Solaris ld")
   else()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39601.121489.patch
Type: text/x-patch
Size: 573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171103/4afad629/attachment.bin>


More information about the llvm-commits mailing list