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: AS17314 8.43.84.0/22 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_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 956101F8C6 for ; Mon, 26 Jul 2021 03:58:48 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4E14E396E42C for ; Mon, 26 Jul 2021 03:58:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E14E396E42C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627271927; bh=AXWUGZMRXZKBNKTkOiibLbC+yy7PsImb1ZfOTE+LDyI=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=j7ys1q3zTVqh3Ypw2AN62undr7l5UwggXn8aNvBMXmnL58cTUCPKBAwWcG5+IM4ZM woNHhRXXihC+2P5oMAIUr6EcwkgBioLa2Qou8PBSMpml71et0AU8c4VlGQUwgaeL/M BOgVxYH7h42X+iPQLECHVsWX6K2jxnLaAQHkqj4s= Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by sourceware.org (Postfix) with ESMTPS id 6AB55385C409 for ; Mon, 26 Jul 2021 03:58:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6AB55385C409 Received: by mail-yb1-xb4a.google.com with SMTP id a188-20020a25cac50000b029055d47682463so12180762ybg.5 for ; Sun, 25 Jul 2021 20:58: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:date:message-id:mime-version:subject:from:to:cc; bh=AXWUGZMRXZKBNKTkOiibLbC+yy7PsImb1ZfOTE+LDyI=; b=rJjVYBHAb+Y2lQ8j1DbOqxk47DR3xSu1yy5cbMbRhw8qQI929k+JmaEqy3UkI8a4EU +WzmFVMJd5BkUHupIUXfR5Uby1A7Fd5jPfWmhnxQM+q4mH1Hyl9AfQGZX6oZS8293wkX AGRkgn1bISpVQ82tMIFGcB+C0QDjgKZzAWw/lOuEDnpfUdEFj4Lv28+Afq0ISb69+ndX 4NfvFTgzPs3fgMJ/aS3o0QJpBW0/hrylS1ngHzTT8F4NRYa9W/c5fslBILZCdsFaQTQx iu0OvVbBM3sYrLX1YEIg/XhY3tEA5sU9QlTHbFZpFMEbMVU05MRFLuKag0dBM7CUU9rG gavQ== X-Gm-Message-State: AOAM531I0gKaeujGmghe4Fj2L/QzB7LTXMnQv7cinkxApv3O7WkC8JXd QntkleLN54Dnl9Vcsn/dHYXoaqPzCC9uCA7c3mj3LFxBKRaDxxuVUrasu5M10YqO93hGuSQBz70 wH8GPO0yunvn/kwUQDhOpnW+6RJC9hH1tG0HxTDEloFRzKxP7XA21mkG3vELnqfLCE4xN X-Google-Smtp-Source: ABdhPJwN3uGLMoxKEqxHMi7CsD9epmCzjbgeG/D3MCLnOFTljlHournbTVPJT5DJCO1mxHuRkf/hFS4rCEWe X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:565c:23d5:ef81:9e9d]) (user=maskray job=sendgmr) by 2002:a25:83cd:: with SMTP id v13mr1182463ybm.325.1627271902796; Sun, 25 Jul 2021 20:58:22 -0700 (PDT) Date: Sun, 25 Jul 2021 20:57:59 -0700 Message-Id: <20210726035802.275992-1-maskray@google.com> Mime-Version: 1.0 Subject: [PATCH 0/3] Allow LLD 13.0.0 and improve compatibility with gold and clang To: libc-alpha@sourceware.org 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: Fangrui Song via Libc-alpha Reply-To: Fangrui Song Cc: Fangrui Song Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" 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. * 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. These things do not really matter for real world applications. Fangrui Song (3): elf: Replace .tls_common with .tbss definition elf: Skip tst-auditlogmod-* if the linker doesn't support --depaudit configure: Allow LD to be LLD 13.0.0 or above configure | 111 +++++++++++++++++++++++++++++++++++++++++++++-- configure.ac | 24 +++++++--- elf/Makefile | 4 +- elf/tls-macros.h | 6 ++- 4 files changed, 134 insertions(+), 11 deletions(-) -- 2.32.0.432.gabb21c7263-goog