[llvm] r318532 - [CMake] Allow for Solaris ld -V output on stdout

Michal Gorny via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 09:12:14 PST 2017


Author: mgorny
Date: Fri Nov 17 09:12:14 2017
New Revision: 318532

URL: http://llvm.org/viewvc/llvm-project?rev=318532&view=rev
Log:
[CMake] Allow for Solaris ld -V output on stdout

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 D35755 which is needed for
proper Solaris support).

Patch by Rainer Orth.

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

Modified:
    llvm/trunk/cmake/modules/AddLLVM.cmake

Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=318532&r1=318531&r2=318532&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Fri Nov 17 09:12:14 2017
@@ -169,7 +169,8 @@ if(NOT WIN32 AND NOT APPLE)
   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()




More information about the llvm-commits mailing list