[llvm] r307852 - [Solaris] Detect Solaris LD, use detection results to pass Solaris-ld options
Fedor Sergeev via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 6 02:26:14 PDT 2017
2017-09-05 20:21 GMT+03:00 Davide Italiano via llvm-commits <
llvm-commits at lists.llvm.org>:
> Picking a random Solaris commit.
> I'd like to bring this up sooner rather than later.
> It seems there's been a decent amount of interest/support to make
> clang working on Solaris.
> It's also not a mystery anymore that Solaris has been discontinued
> and, as it stands, the LLVM/clang support for the OS is not completed.
> I'm not entirely sure what are the plans, but in case nobody is
> interested, I'd rather avoid the maintenance burden and remove the
> support from the tree as it happened in similar circumstances (see
> e.g. https://reviews.llvm.org/D35707).
>
> Feedor, what do you think about it?
>
Well, you see, I'm *still* with Oracle but as you see I have already
switched to my personal mail here
and I would rather not represent the view of my current employer right now.
As some people already pointed out Oracle Solaris is not the only Solaris
out there.
My Solaris changes (including those that were not yet integrated) were
developed on Oracle Solaris 11,
but I tried to make them as generic as possible, so majority of them should
still relevant for other Solarii
(even non-integrated gcc toolchain detection one, which is mostly a cleanup
and non-specific bugfixes).
As for this particular change, its main part introduces a generic Unix
linker detection, not specific to Solaris at all.
Linker differentiation is most important for Solaris indeed due to Solaris
linker being so different,
but I dont see how it adds support burden (in this particular case).
best regards,
Fedor.
> On Wed, Jul 12, 2017 at 2:43 PM, Rui Ueyama via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
> > Author: ruiu
> > Date: Wed Jul 12 14:43:14 2017
> > New Revision: 307852
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=307852&view=rev
> > Log:
> > [Solaris] Detect Solaris LD, use detection results to pass Solaris-ld
> options
> >
> > Solaris ld is not the only linker available on Solaris.
> > Introducing linker detection and using LLVM_LINKER_IS_SOLARISLD to
> > select Solaris-ld specific handling.
> >
> > Patch by: Fedor Sergeev
> >
> > Differential Revision: https://reviews.llvm.org/D35325
> >
> > 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=307852&r1=307851&r2=307852&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
> > +++ llvm/trunk/cmake/modules/AddLLVM.cmake Wed Jul 12 14:43:14 2017
> > @@ -91,7 +91,7 @@ function(add_llvm_symbol_exports target_
> > DEPENDS ${export_file}
> > VERBATIM
> > COMMENT "Creating export file for ${target_name}")
> > - if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
> > + if (${LLVM_LINKER_IS_SOLARISLD})
> > set_property(TARGET ${target_name} APPEND_STRING PROPERTY
> > LINK_FLAGS " -Wl,-M,${CMAKE_CURRENT_BINARY_
> DIR}/${native_export_file}")
> > else()
> > @@ -148,13 +148,28 @@ function(add_llvm_symbol_exports target_
> > endfunction(add_llvm_symbol_exports)
> >
> > if(NOT WIN32 AND NOT APPLE)
> > + # Detect what linker we have here
> > execute_process(
> > COMMAND ${CMAKE_C_COMPILER} -Wl,--version
> > OUTPUT_VARIABLE stdout
> > - ERROR_QUIET
> > + ERROR_VARIABLE stderr
> > )
> > + set(LLVM_LINKER_DETECTED ON)
> > if("${stdout}" MATCHES "GNU gold")
> > set(LLVM_LINKER_IS_GOLD ON)
> > + message(STATUS "Linker detection: GNU Gold")
> > + elseif("${stdout}" MATCHES "^LLD")
> > + set(LLVM_LINKER_IS_LLD ON)
> > + message(STATUS "Linker detection: LLD")
> > + elseif("${stdout}" MATCHES "GNU ld")
> > + set(LLVM_LINKER_IS_GNULD ON)
> > + message(STATUS "Linker detection: GNU ld")
> > + elseif("${stderr}" MATCHES "Solaris Link Editors")
> > + set(LLVM_LINKER_IS_SOLARISLD ON)
> > + message(STATUS "Linker detection: Solaris ld")
> > + else()
> > + set(LLVM_LINKER_DETECTED OFF)
> > + message(STATUS "Linker detection: unknown")
> > endif()
> > endif()
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
>
> --
> Davide
>
> "There are no solved problems; there are only problems that are more
> or less solved" -- Henri Poincare
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170906/7db26254/attachment.html>
More information about the llvm-commits
mailing list