[klibc] [PATCH] support llvm's lld

Stanislav Fomichev sdf at google.com
Tue Jan 28 08:34:04 PST 2020


On Tue, Jan 28, 2020 at 2:13 AM Anatoly Pugachev <matorola at gmail.com> wrote:
>
> On Tue, Jan 28, 2020 at 1:06 AM Stanislav Fomichev <sdf at google.com> wrote:
> >
> > When using clang+llvm and lld, I get the following error:
> >
> > ld.lld: error: -Ttext-segment is not supported. Use --image-base if you intend to set the base address
> >
> > Let's test whether linker is lld and use --image-base instead of
> > -Ttext-segment. See llvm's rationale for not supporting -Ttext-segment:
> > https://github.com/llvm/llvm-project/commit/4dc2fb123dcfe9a97ad6f3a1135053b74efd0bc9
> >
> > Note that I've tested x86_64 only, everything else is just a copy-paste.
>
> how do i test it on other arches? just trying to build it (make/cmake)
> or there's a test which could be used?
Try to build and preferably boot if you have the hardware.
Not sure how to cross-compile klibc, but something along the lines:
'make .... KLIBCARCH=aarch64 CC=.../aarch64-triplet-clang
LD=.../aarch64-triplet-ld.lld'.


More information about the klibc mailing list