From: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
To: Fangrui Song <maskray@google.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH 0/3] Allow LLD 13.0.0 and improve compatibility with gold and clang
Date: Thu, 29 Jul 2021 07:45:47 -0700 [thread overview]
Message-ID: <CAMe9rOrRfbY71fZwD8kCQG7UbOz21yOukz+phwAuGJqXuspgsQ@mail.gmail.com> (raw)
In-Reply-To: <20210728215227.isyi523unti65q6e@google.com>
On Wed, Jul 28, 2021 at 2:52 PM Fangrui Song <maskray@google.com> wrote:
>
> On 2021-07-28, H.J. Lu wrote:
> >On Sun, Jul 25, 2021 at 8:58 PM Fangrui Song via Libc-alpha
> ><libc-alpha@sourceware.org> wrote:
> >>
> >> The patches allow LLD 13.0.0 to build glibc. LLD's compatibility with
> >> GNU ld is generally better than gold's compatibility with GNU ld.
> >>
> >> The first two commits improve gold and clang compatibility as well.
> >> (There is still a long way for clang to build glibc.)
> >>
> >> About `make check` results:
> >>
> >> I can't configure glibc --enable-static-pie with gold, so I use
> >> --disable-static-pie with gold.
> >>
> >> * gold (--disable-static-pie) has 160 FAIL.
> >> * ld.bfd has 152 FAIL.
There should be no unexpected failures on x86 with ld.bfd. If
it isn't the case for you, you should open a binutils bug.
> >> * ld.lld has 159 FAIL.
> >>
> >> ## I have investigated a few failures.
> >>
> >> The tst-ifunc-isa-*.c failures are not ld.lld's fault.
> >> The lld linked tst-ifunc-isa-* work with LD_BIND_NOW=1.
> >> The tests happen to work with GNU ld because the IRELATIVE for foo_ifunc
> >> is placed after JUMP_SLOT in .repa.plt. The test needs to call
> >> __x86_get_cpuid_feature_leaf which is defined in a different TU. IMHO
> >> such ifunc does not guaranteed to work.
> >>
> >> For gmon/tst-gmon-gprof*, ld.lld linked tst-gmon-gprof has a f3 line,
> >> which appears more correct to me. But the test considers it a failure.
> >>
> >> % cat gmon/tst-gmon-gprof.out
> >> --- expected
> >> +++ actual
> >> @@ -1,2 +1,3 @@
> >> f1 2000
> >> f2 1000
> >> +f3 1
> >> FAIL
> >>
> >>
> >> For malloc/tst-compathooks-on,
> >>
> >> malloc/tst-compathooks-on: Symbol `__free_hook' has different size in shared object, consider re-linking
> >>
> >> the root cause is that lld's symbol versioning is different from GNU ld in an unusal case:
> >>
> >> __asm__ (".symver " "__free_hook" "," "__free_hook" "@" "GLIBC_2.2.5");
> >>
> >> This leaves two symbols __free_hook and __free_hook@GLIBC_2.2.5.
> >> __free_hook is then attached a default version GLIBC_2.2.5.
> >> I think malloc/malloc-debug.c uses a fragile versioned symbol here.
> >> If the inline asm uses @@ the failure should go away.
> >>
> >>
> >> In summary, I think the failed tests touch some dark corners of the toolchain.
Please open a separate bug for each distinct failed test with lld.
Thanks.
> >> These things do not really matter for real world applications.
> >>
> >
> >Please open a separate bug for each issue you are trying to fix and reference
> >the bug in your patch.
> >
> >Thanks.
>
> I filed:
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=28151 elf: Some tst-audit* tests need ld --audit and --depaudit which do not work with gold or ld.lld
> https://sourceware.org/bugzilla/show_bug.cgi?id=28152 elf: clang integrated assembler and ld.lld do not support .tls_common
> https://sourceware.org/bugzilla/show_bug.cgi?id=28153 [test] gmon/tst-gmon-gprof* may have a f3 line when built with ld.lld
> https://sourceware.org/bugzilla/show_bug.cgi?id=28154 [test] sysdeps/x86/tst-ifunc-isa-* lazy binding failure with ld.lld
>
> If there is a need to amend patches, I'll attach the BZ numbers.
--
H.J.
next prev parent reply other threads:[~2021-07-29 14:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 3:57 [PATCH 0/3] Allow LLD 13.0.0 and improve compatibility with gold and clang Fangrui Song via Libc-alpha
2021-07-26 3:58 ` [PATCH 1/3] elf: Replace .tls_common with .tbss definition Fangrui Song via Libc-alpha
2021-07-29 14:26 ` H.J. Lu via Libc-alpha
2021-07-29 16:21 ` Fangrui Song via Libc-alpha
2021-07-26 3:58 ` [PATCH 2/3] elf: Skip tst-auditlogmod-* if the linker doesn't support --depaudit Fangrui Song via Libc-alpha
2021-07-29 14:23 ` H.J. Lu via Libc-alpha
2021-07-29 16:28 ` Fangrui Song via Libc-alpha
2021-07-26 3:58 ` [PATCH 3/3] configure: Allow LD to be LLD 13.0.0 or above Fangrui Song via Libc-alpha
2021-07-28 18:02 ` [PATCH 0/3] Allow LLD 13.0.0 and improve compatibility with gold and clang H.J. Lu via Libc-alpha
2021-07-28 21:52 ` Fangrui Song via Libc-alpha
2021-07-29 14:45 ` H.J. Lu via Libc-alpha [this message]
2021-07-30 7:57 ` Florian Weimer via Libc-alpha
2021-07-31 6:34 ` Fāng-ruì Sòng via Libc-alpha
2021-07-31 6:41 ` Florian Weimer via Libc-alpha
2021-08-02 20:55 ` Fāng-ruì Sòng via Libc-alpha
2021-08-02 4:02 ` Siddhesh Poyarekar
2021-08-02 4:23 ` Siddhesh Poyarekar
2021-08-08 16:50 ` Fāng-ruì Sòng via Libc-alpha
2021-08-08 2:54 ` Fāng-ruì Sòng via Libc-alpha
2021-08-08 16:45 ` Siddhesh Poyarekar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMe9rOrRfbY71fZwD8kCQG7UbOz21yOukz+phwAuGJqXuspgsQ@mail.gmail.com \
--to=libc-alpha@sourceware.org \
--cc=hjl.tools@gmail.com \
--cc=maskray@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).