[llvm-dev] Fwd: LLD (macOS) usage?

Don Hinton via llvm-dev llvm-dev at lists.llvm.org
Sun Jan 7 09:57:44 PST 2018


I'm seeing something similar.

clang is using HOST_LINK_VERSION, obtained from ld64, as the default for
-mlinker-version.  This causes Darwin.cpp to add the arguments you are
seeing, but not handled by lld.  Perhaps -fuse-ld should be considered in
addition to -mlinker-version when adding these arguments.

As a workaround, you can try passing -mlinker-version.  Looks like anything
< 133 will work, including 0.

hth...
don



On Thu, Jan 4, 2018 at 1:14 AM, Julio César Rocha via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi. I'm using LLVM 5.0.1 on macOS 10.12.
>
> I have a very simple program (program.c):
> int main() {}
>
> When attempting to compile with LLD, I get this output:
> $ clang -fuse-ld=lld program.c
> /opt/llvm/5.0.1/bin/ld.lld: error: unknown argument: -no_deduplicate
> /opt/llvm/5.0.1/bin/ld.lld: error: unknown argument: -dynamic
> /opt/llvm/5.0.1/bin/ld.lld: error: unknown argument: -arch
> /opt/llvm/5.0.1/bin/ld.lld: error: unknown emulation: acosx_version_min
> /opt/llvm/5.0.1/bin/ld.lld: error: unable to find library -lto_library
> /opt/llvm/5.0.1/bin/ld.lld: error: /opt/llvm/5.0.1/lib/libLTO.dylib:
> invalid data encoding
> clang-5.0: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
> Looks like the flags passed to the linker are just wrong, but can't find
> any relevant documentation at llvm.org/docs.
>
> Please help?
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180107/e3ef1d6d/attachment.html>


More information about the llvm-dev mailing list