From patchwork Wed Jun 15 07:59:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangrui Song X-Patchwork-Id: 55091 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 AA90E3856DDE for ; Wed, 15 Jun 2022 08:00:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA90E3856DDE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1655280021; bh=Cqpkr2ARJWBFXg7x7hzV+1mLTV1bp/z+Syd/FZ0FBpg=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=JcNcI0W4DLfoePEfqBBMhq53gd6y0SbFVTNts5Orrrgy5ufBETGTIVlf5bj+3G5/n xoaE4fLJh9RvYbBkWILnDGjqwBbViOYni33fPf1RI4ZcQY2kGtj1MDNQVTyhPGNO9D 4bPUSEzrjMH43ytBcBAnpAwxJThfNY2bj46mfBHw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by sourceware.org (Postfix) with ESMTPS id 0CCE53858C2C for ; Wed, 15 Jun 2022 07:59:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0CCE53858C2C Received: by mail-yb1-xb49.google.com with SMTP id u128-20020a25dd86000000b0066073927e92so9682587ybg.13 for ; Wed, 15 Jun 2022 00:59:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=Cqpkr2ARJWBFXg7x7hzV+1mLTV1bp/z+Syd/FZ0FBpg=; b=tBC+z1hxtFqBtHkNmKi4LcIh70ZmSO4yAEKZ+Wkqs8s8FB6CLSY78pA4yJh30RO9nO Mn8HfR4Mdd/Lo8qxpD2M9oKy/wVjSiUIfnuFa21Y7c0InoUdtDFOTCRDY36qjEZv+Tf7 ot396VnI4zJFrscpj5fShTP1EmakC+VUwRtfVcmZ3/XJ62tEQUhWIXstyGuydKsWWW99 gThpXkmN+elFip0JtzZC3Yvql6nqcM9Cq4+FngdrblAjTro6LhTHoXp1WnG5RtFAFtZE 3WM2IOlcjanLJzWdc2RyLDMFjytbJCKLhN18R4XjJngUJ5kMxWM0iKXE2zlA6W428pwr 60nA== X-Gm-Message-State: AJIora9pjPzsXmUfz8J/KETNw0T3bE3fb1u2/nPbiCg45yO6ZjT2lhB0 wxYsASr7jfQiF/oDBy4V6f5r+4fwnyniaeONx9ynobPTkRyjLNRTj7lnymvrsVANscvF3uaEuY3 Fq1J/JYBmhtea7kttMWy2a2Za//L28xTMY+i+wg6V2suTFKY+JvL7gNwnfHk8TTtNrw== X-Google-Smtp-Source: AGRyM1sTrKN5GXWwITJ8+7ffgnf7ZH1VnANHfxGFGBri4b4aHQ510mvLqGwGr9DoHrMGQfkvRb0A2NvcUb6T X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:73fa:a66c:4a7a:d736]) (user=maskray job=sendgmr) by 2002:a25:69c4:0:b0:65c:ed2b:9106 with SMTP id e187-20020a2569c4000000b0065ced2b9106mr8938533ybc.394.1655279991321; Wed, 15 Jun 2022 00:59:51 -0700 (PDT) Date: Wed, 15 Jun 2022 00:59:43 -0700 Message-Id: <20220615075943.1776786-1-maskray@google.com> Mime-Version: 1.0 Subject: [PATCH] Revert "[PATCH] RISC-V: Use new linker emulations for glibc ABI." To: gcc-patches@gcc.gnu.org, kito.cheng@sifive.com, jrtc27@jrtc27.com, nelson.chu@sifive.com, jim.wilson.gcc@gmail.com X-Spam-Status: No, score=-20.0 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Fangrui Song via Gcc-patches From: Fangrui Song Reply-To: Fangrui Song Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This reverts commit 37d57ac9a636f2235f9060e84fb8dd7968abd1dc. The resolution to https://sourceware.org/bugzilla/show_bug.cgi?id=22962 let GCC pass -m emulation to ld and let the ld emulation configure default library paths. This scheme is problematic: * It's not ld's business to specify default -L. Different platforms have different opinions on the hierarchy and all other arches work well without ld's default -L. * If some ABI derived library paths are desired, the compiler driver is in a better position to make the decision and traditionally has done this. * -m emulation is opaque to the compiler driver. It doesn't affect -B, so data files like crt*.o, libasan_preinit.o, and libtsan_preinit.o are not affected. As is, many platforms just use symlinks to fake the lib64/{ilp32{,f},lp64{,f}} hierarchies needed by the GNU ld emulation. They can always specify -L explicitly if they want some ABI derived library paths. See also the rejected https://reviews.llvm.org/D95755 gcc/Changelog: * config/riscv/linux.h (LD_EMUL_SUFFIX): Remove. (LINK_SPEC): Remove LD_EMUL_SUFFIX. --- gcc/config/riscv/linux.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h index 38803723ba9..e0ff6e6a178 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -49,16 +49,8 @@ along with GCC; see the file COPYING3. If not see #define CPP_SPEC "%{pthread:-D_REENTRANT}" -#define LD_EMUL_SUFFIX \ - "%{mabi=lp64d:}" \ - "%{mabi=lp64f:_lp64f}" \ - "%{mabi=lp64:_lp64}" \ - "%{mabi=ilp32d:}" \ - "%{mabi=ilp32f:_ilp32f}" \ - "%{mabi=ilp32:_ilp32}" - #define LINK_SPEC "\ --melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \ +-melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv \ %{mno-relax:--no-relax} \ %{mbig-endian:-EB} \ %{mlittle-endian:-EL} \