From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id AAE921F8C6 for ; Thu, 29 Jul 2021 14:49:24 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CA28C39B3C1F for ; Thu, 29 Jul 2021 14:49:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA28C39B3C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627570163; bh=/iMdN5LgdrNnDnd4VHN/ZaBJ0maUhjBKelh2Xl2ifPs=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=bAjR3+9B8rD6tSaIM6/VB/qLALLFzt2SxWaS5PCYy9yR5d/tOvZ2Qw4fgrSDObPyC f0x3KFPOGyiPMHk3/Czl6yrYPFi4cz72qpAxzen21Kl2lZxizWEdDQrxhdZ7I4eI4b A0zev34cbXBtId+moAsYG4f4cUwKaMo+qSP+aOq0= Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id DE0F6393A423 for ; Thu, 29 Jul 2021 14:46:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DE0F6393A423 Received: by mail-pj1-x102d.google.com with SMTP id o44-20020a17090a0a2fb0290176ca3e5a2fso9705190pjo.1 for ; Thu, 29 Jul 2021 07:46:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/iMdN5LgdrNnDnd4VHN/ZaBJ0maUhjBKelh2Xl2ifPs=; b=KZihbDCHCArOugn4wVzkYE+IiBepwQ4quza0Rbxcvi/Zew9BhXwjhfyiDcDgZ0duGW xVq1B+Ama9zqifQZb16Zt65Wa5/j5Q0MdFJHZGYhY/yqd06N5O8dnzhEd8jF5gK50hbD oy5cFLO7AuuvBPolKWFV3msLWmhNvvD+ZNE/A5AIG+YLjSi6MFQjw8khwiqLvg4D/UBy J8ChvBOJWpyenHBQvzdaxQqyN/AHj+hBqoyTMfKnmbMBaFnCVHlQYZUCgz/sEeIaZ/NC vkb8IqB89dgJIsQXfK6AlFULySD6b+XChDB9L3odp+FFC2NfLIxf29Q7v1sprVnCITnh DK0w== X-Gm-Message-State: AOAM531r/5dG0xVoY7E1+kVn18HdgEO0dXT10dMgztFkdxMWGHUM4tSo 4Owr1sy5HT+sN3KmS9YFdtkxCztOTHDrCY2kVoE= X-Google-Smtp-Source: ABdhPJxwlakiFSI589Q9oR0II0lhhkiyflnJceaCOzEweL5nPLnVWxssbJ4HMDXz4+1u1YlcG0P2GZqbFDyZp94Z4BU= X-Received: by 2002:a63:114d:: with SMTP id 13mr4223235pgr.180.1627569982883; Thu, 29 Jul 2021 07:46:22 -0700 (PDT) MIME-Version: 1.0 References: <20210726035802.275992-1-maskray@google.com> <20210728215227.isyi523unti65q6e@google.com> In-Reply-To: <20210728215227.isyi523unti65q6e@google.com> Date: Thu, 29 Jul 2021 07:45:47 -0700 Message-ID: Subject: Re: [PATCH 0/3] Allow LLD 13.0.0 and improve compatibility with gold and clang To: Fangrui Song Content-Type: text/plain; charset="UTF-8" X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: "H.J. Lu via Libc-alpha" Reply-To: "H.J. Lu" Cc: GNU C Library Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Wed, Jul 28, 2021 at 2:52 PM Fangrui Song wrote: > > On 2021-07-28, H.J. Lu wrote: > >On Sun, Jul 25, 2021 at 8:58 PM Fangrui Song via Libc-alpha > > 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.