[cfe-dev] Building CLANG from Source with GCC and Gold

Richard Smith via cfe-dev cfe-dev at lists.llvm.org
Thu Sep 14 15:55:45 PDT 2017


On 14 September 2017 at 13:30, Samuel Goodrick via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hello all,
>
> I am trying to do some work on clang on a Linux system, and the default
> linker, ld is requiring far too much memory to link the program. I want to
> try using Gold or perhaps LLD, but I have been unable to configure the
> CMake files properly to change the Linker.
>
> I have attempted to edit the CMake variables like so:
> cmake -DCMAKE_LINKER=/usr/bin/ld.gold -DCMAKE_CXX_LINK_EXECUTABLE="<CMAKE_LINKER>
> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET>
> <LINK_LIBRARIES>" -G "Unix Makefiles" ../llvm
>
>
> but was ultimately unsuccessful. I get the error:
> /usr/bin/ld.gold: -Werror=date-time: unknown option
>
> so I removed the <FLAGS> option to bypass the this problem, which results in the error:
> /usr/bin/ld.gold: -Wl,-allow-shlib-undefined: unknown option
>
> Has anyone been able to build CLANG with a non-default linker on Linux? How did you configure your CMake files to do so?
>
> I use -DLLVM_ENABLE_LLD=TRUE to link with lld.
I used to use gold; I think I used something like -DLLVM_USE_LINKER=ld.gold

> Thanks
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170914/620e2846/attachment.html>


More information about the cfe-dev mailing list