From patchwork Thu Aug 5 16:25:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangrui Song X-Patchwork-Id: 44586 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5F7CC396900F for ; Thu, 5 Aug 2021 16:27:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F7CC396900F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628180860; bh=CAXLdVT0o0OosIDr+wGmU3qiLZ1m6ZAaWXmtFz6BTNQ=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qjhvKY7dbNa7kLnigc011UyjjKt/exV0n1UhQUY7kib+pATp6J2IWwNSdVtLJ/QQC xoAVq6A2ojnhpLOG0i/Cyea4pmXhBbF9hSh/nxbGiKZti7ot/ymfEKWR7R1UMfZhGe jHteLdfG8UY5zpIZBSLL4G5Y9PzqD/F0DCMpuPec= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by sourceware.org (Postfix) with ESMTPS id 384BD399A815 for ; Thu, 5 Aug 2021 16:26:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 384BD399A815 Received: by mail-qt1-x84a.google.com with SMTP id g10-20020ac8768a0000b029023c90fba3dcso2926202qtr.7 for ; Thu, 05 Aug 2021 09:26:07 -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=CAXLdVT0o0OosIDr+wGmU3qiLZ1m6ZAaWXmtFz6BTNQ=; b=eaRU5FZBtKytyyVmlYQWSkyO9CKR+kzQfBsSbFP3U3DC6FyOumbnAdD/2ChW7gYxiJ MNxcEkHs1eRnEWtjkaruydRezEhsUvOChbXtnD8M7WTQhA5littT+DktE1luv1UiWPRk lt4NZIKTEu/a9Of2C+kFkH3tvKkVJGGIvI6aoCAGqfpUWZ71mP4nejhBku/2NOwb2Ybg voWwUeyWA3fOVxIraO2hN8AS1A8UF5K0CIR+l9znY/Q6zxrTfCBwldr7sqra+ADyV6vq qLC/kD6W9Th7MvHJcQOCcvLVpVqb5rSlVNgpnNzmwnPsZzKDjQ5OO1+eWsf8QTfwNN/A LZAw== X-Gm-Message-State: AOAM532gdn1/Nfv8MlywADEn+S2Q49fIfRJ+bkfFTqEqD6h80uvwX9QT QGmvi/84jTk0JvfYOB7iatd1b4UPoqwptoDLX6uwLoYfiwaGwfswFgAiDCOEb1bs4c/8m/3oIMN ngAEgY5NNrkQMHkBeP4lvsw/+bUqcOn91mFlsBHcSnXxKLSU/UeDEvdJYHfPqE+XubY2i X-Google-Smtp-Source: ABdhPJwrAbHBr7IipNAVKJiTxCbs3K/Cw57xWXx10+o/DuVkfv8WxpiN6BRVAuE03UgZunP6wVApoJtSPAkL X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:6668:5d25:689f:8ff1]) (user=maskray job=sendgmr) by 2002:ad4:4f06:: with SMTP id fb6mr6206622qvb.37.1628180766841; Thu, 05 Aug 2021 09:26:06 -0700 (PDT) Date: Thu, 5 Aug 2021 09:25:58 -0700 Message-Id: <20210805162601.1200851-1-maskray@google.com> Mime-Version: 1.0 Subject: [PATCH v2 0/3] Allow LLD 13.0.0 and improve compatibility with gold and clang To: libc-alpha@sourceware.org X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-Patchwork-Original-From: Fangrui Song via Libc-alpha From: Fangrui Song Reply-To: Fangrui Song Errors-To: libc-alpha-bounces+patchwork=sourceware.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. 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 22 FAIL. * ld.bfd has 14 FAIL. * ld.lld has 16 FAIL. (With glibc bug BZ #28153 fixed) (I am using a variant of the Debian testing (BZ #28177 libgcc_s.so.1), so even with GNU ld there may be relatively more failures than Fedora/RedHat. % ./testrun.sh stdlib/tst-quick_exit stdlib/tst-quick_exit: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory ) `make check` only has 2 more failures with LLD than with GNU ld: BZ #28154 (LLD follows the PowerPC port of GNU ld for ifunc by placing IRELATIVE relocations in .rela.dyn). The set of dynamic symbols is the same with GNU ld and LLD, modulo unused SHN_ABS version node symbols. For comparison, gold does not support --enable-static-pie (--no-dynamic-linker is unsupported BZ #22221), yet has 6 failures more than LLD. gold linked libc.so has larger .dynsym differences with GNU ld and LLD (ISTM non-default version symbols are changed to default versions by a version script). --- I identified the lack of support of * version script on non-default version symbols * copy relocations on non-default version symbols in an earlier snapshot of LLD 13.0.0 and fixed them. The functionality of the LLD linked libc.so and ld.so looks pretty good. Fangrui Song (3): elf: Replace .tls_common with .tbss definition [BZ #28152] elf: Skip tst-auditlogmod-* if the linker doesn't support --depaudit [BZ #28151] configure: Allow LD to be LLD 13.0.0 or above [BZ #26558] configure | 111 +++++++++++++++++++++++++++++++++++++++++++++-- configure.ac | 24 +++++++--- elf/Makefile | 4 +- elf/tls-macros.h | 6 ++- 4 files changed, 134 insertions(+), 11 deletions(-)