From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 84DD738518AB for ; Sat, 26 Nov 2022 14:57:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 84DD738518AB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oywcj-0001Zi-EY; Sat, 26 Nov 2022 09:57:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=2BHfT18YpWbdaOAl4queLe35Axf9b+1AmtTcMfHPETM=; b=Q0QUmtLof9sFrhOJYMoG SV2XrHjMA2jcUcoSowwecVrWocfDzD6blSTSULO4+jq3PyV70GgLsaQSc4Xpcb7VdiiyOUjXZmOhu Sxc8+5n6ka+P4Xk303L+Og6cHFdCWpAro1vZpiHZvSUfpSYlRJnCcy53PVOvIjmWlOOuQ5Uz/+Wgg Q4+Y1xAjtZn9u8/vtRZjyWPc7kx0GAl/wgB7pIfLAFsfKg1ZMLXJ1L7YKgTwpjxYA68Cxu3Td0AD2 WxpuxsqRSEc+g7H79jVqoA3SCfHh2TKmnNVj13go9BaGuH2Frs8nAWQ9bbNCd8IajpqjQV9cBiNXX PuHxX/fgzod9iQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oywci-0007VC-UC; Sat, 26 Nov 2022 09:57:45 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Vineet Gupta Cc: libc-alpha@sourceware.org, Carlos O'Donell , Fangrui Song , nelson Chu , palmer@rivosinc.com, gnu-toolchain@rivosinc.com Subject: Re: [PATCH] Revert "Correctly determine libc.so 'OUTPUT_FORMAT' when cross-compiling." References: <20221123025932.473655-1-vineetg@rivosinc.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Sextidi 6 Frimaire an 231 de la =?utf-8?Q?R=C3=A9vol?= =?utf-8?Q?ution=2C?= jour de la =?utf-8?Q?M=C3=A2che?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 26 Nov 2022 15:57:42 +0100 In-Reply-To: <20221123025932.473655-1-vineetg@rivosinc.com> (Vineet Gupta's message of "Tue, 22 Nov 2022 18:59:32 -0800") Message-ID: <87lenx9315.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,TXREP,URIBL_BLACK autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, Vineet Gupta skribis: > This reverts commit 361d6454c034a920f2c96517c277990d390b9652. > > This trips up riscv gnu toolchain builds [1] > > riscv ld segfaults when linking libgcc because libc.so linker script > contains `OUTPUT_FORMAT(elf32-little)` vs. `OUTPUT_FORMAT(elf32-littleris= cv)`. > > This patch causes builds to lookup riscv32* prefixed objdump and failing > to find it falls back to host objdump which is the root of the issue. > The host objdump in turn generates `OUTPUT_FORMAT(elf32-little)` > > riscv glibc multilib builds lack riscv32 prefix binaries. They have a > single set of "riscv64" prefixed binaries supporting both 32 and 64-bit > abis: ilp32/ilp32d/lp64/lp64d using -march/-mabi. > > FWIW I'm not sure how this patch fixed a real problem to begin with. The rationale was described in the context of cross-compilation to aarch64-linux-gnu: https://sourceware.org/pipermail/libc-alpha/2021-July/128333.html We observed a similar issue with objcopy when cross-compiling to powerpc64le-linux-gnu: https://issues.guix.gnu.org/49417 Maybe we should see, in your case, why =E2=80=9Criscv32-linux-gnu-objdump -= f=E2=80=9D reports =E2=80=9Celf32-little=E2=80=9D instead of =E2=80=9Celf32-littlerisc= v=E2=80=9D? HTH, Ludo=E2=80=99.