[klibc] [PATCH] support llvm's lld

Ben Hutchings ben at decadent.org.uk
Fri Feb 28 16:59:55 PST 2020


On Mon, 2020-01-27 at 14:05 -0800, Stanislav Fomichev 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.
[...]

Sorry for not responding to this sooner.

I'm open to adding support for building with LLVM, but it seems like
more changes will be needed.  I tried a native x86_64 build in Debian
unstable, which has LLVM 9.0.1, and got a lot of these warnings:

    clang: error: unsupported option '--print-libgcc'
    clang: error: no input files

    clang: warning: optimization flag '-falign-jumps=1' is not supported [-Wignored-optimization-argument]

and then an error:

    In file included from usr/klibc/zlib/gzio.c:10:
    In file included from /home/ben/src/klibc/klibc/usr/klibc/../include/stdio.h:11:
    /home/ben/src/klibc/klibc/usr/klibc/../include/stdarg.h:9:15: fatal error: 'stdarg.h' file not found
    #include_next <stdarg.h>
                  ^~~~~~~~~~
    1 error generated.

Ben.

-- 
Ben Hutchings
It is easier to change the specification to fit the program
than vice versa.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.zytor.com/archives/klibc/attachments/20200229/d2940956/attachment.sig>


More information about the klibc mailing list