[klibc] [kvm-unit-tests PATCH v3 0/4] Update patch set

Ben Hutchings ben at decadent.org.uk
Sat Jul 25 13:57:36 PDT 2020

On Sat, 2020-07-25 at 17:47 +0100, Ben Hutchings wrote:
> On Sun, 2020-03-29 at 04:38 -0700, Bill Wendling wrote:
> > - Moved "-fcommon" to KLIBCREQFLAGS in scripts/Kbuild.klibc.
> > - Remove "dash" warning fixes which have been upstreamed.
> > - Conditionalize the inclusion of compiler flags by using the proper
> >   compiler name or "cc-option".
> > - Added "-Werror" to "cc-option" to catch flags that cause warnings.
> > - Retain "-nostdinc -iwithprefix include" and use the proper clang flag
> >   to get the path to find "stdarg.h".
> > - Move "-fno-builtin-bcmp" to KLIBCREQFLAGS in scripts/Kbuild.klibc.
> I'm just going to apply this series now, and we can worry about
> cleaning up the FLAGS variable definitions later.
> Thanks for your patience,

Unfortunately this doesn't work with Clang and lld 9.0.1.

Clang is now optimising some stdio calls to their _unlocked variants,
which we don't define.  I added definitions of all those, and was then
able to able to build everything with Clang and ld.bfd.  I've pushed
that change following these patches.

However, when I use Clang and ld.lld, it fails to link dynamically-
linked programs:

    ld.lld: error: undefined symbol: gettimeofday
    >>> referenced by main.c:842 (usr/kinit/ipconfig/main.c:842)
    >>>               usr/kinit/ipconfig/main.o:(ipconfig_main)
    >>> referenced by main.c:446 (usr/kinit/ipconfig/main.c:446)
    >>>               usr/kinit/ipconfig/main.o:(ipconfig_main)
    >>> referenced by main.c:490 (usr/kinit/ipconfig/main.c:490)
    >>>               usr/kinit/ipconfig/main.o:(ipconfig_main)

    ld.lld: error: undefined symbol: srand48
    >>> referenced by main.c:843 (usr/kinit/ipconfig/main.c:843)
    >>>               usr/kinit/ipconfig/main.o:(ipconfig_main)

    ld.lld: error: undefined symbol: setjmp
    >>> referenced by main.c:846 (usr/kinit/ipconfig/main.c:846)
    >>>               usr/kinit/ipconfig/main.o:(ipconfig_main)


Ben Hutchings
Anthony's Law of Force: Don't force it, get a larger hammer.

-------------- 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/20200725/d132d43a/attachment.sig>

More information about the klibc mailing list