From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 2D0A73858C2C for ; Sat, 29 Oct 2022 01:45:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D0A73858C2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667007926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c2KXXrahgy9m8dWG4hE1OOH/KUa+94So9WAmI+vf3Qg=; b=CxQ95mBzXczkt32YCTCDsP1qd8N4KNsiMI5IwxZs6t5xog1+6goEgQ2GPJGjni5NV27xCc yG3VV6QqjsfvisjInoNb+RoLcH+HlSLBQzd5+dY7T8iSfd6jjOC7SX4p+E2t/4TSkY9p+w LPI1AcdbqFcdHMWqjhDDE+SMsaDBixo= Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-624-GfDtUXALP8SHfMF-0I20bQ-1; Fri, 28 Oct 2022 21:45:24 -0400 X-MC-Unique: GfDtUXALP8SHfMF-0I20bQ-1 Received: by mail-il1-f199.google.com with SMTP id d6-20020a056e02214600b002fa23a188ebso6223941ilv.6 for ; Fri, 28 Oct 2022 18:45:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=c2KXXrahgy9m8dWG4hE1OOH/KUa+94So9WAmI+vf3Qg=; b=K7AhA0DF8CQ4Uw/6BK6cC3QOAEMZHEs8aknTtpDCaUlmCrovofYbDREBC3bt8ABChe JvtoKpL6SWe3fgB3Sq9o41W3xZqlZD8J9+iKsbOCc361QD24D9oSdOGcJZcj3KtB/vA3 gTZVsoOnmj8RuHDNEYhwzWyWe02vaqvBywORZzdGSxsAiydxbCqgWLWF2sEWSHAoAU3M RCogqB5nuuY6fJoKBK3Lh5QTYHI0MWl+k48gjfiY6oImMXXKllDRZbaun8tNpEXZ42o9 ViaHzK733pnV2uqeVRPiLFLnAXXdxhrC61h/3t0HDbilcBrHhZgRA9upk6bQOZQKkPDn ZtkQ== X-Gm-Message-State: ACrzQf0OXgdMjYOizg2SFonplOH390+4J8fhVvn72EtOY7woVTq+Smo/ l8PfMiwn5qQPJHaIN0AThKTGzfugwEw7Fq3EeN6iCMA6r3lz96cRovGNQ9juXtpu72bVcWQJZNY jX/NmzUuUVswrDZoSp8Md X-Received: by 2002:a6b:1484:0:b0:6c1:ae60:7ed5 with SMTP id 126-20020a6b1484000000b006c1ae607ed5mr1136562iou.164.1667007923906; Fri, 28 Oct 2022 18:45:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5nLIZEaJJVyE+ZNRVWTCd1ojejdoqi90iGuhWyg59anUFeWt5EgLT8gd0+ALFjZ2E5P7uUJw== X-Received: by 2002:a6b:1484:0:b0:6c1:ae60:7ed5 with SMTP id 126-20020a6b1484000000b006c1ae607ed5mr1136552iou.164.1667007923546; Fri, 28 Oct 2022 18:45:23 -0700 (PDT) Received: from [192.168.0.241] (192-0-145-146.cpe.teksavvy.com. [192.0.145.146]) by smtp.gmail.com with ESMTPSA id c29-20020a023f5d000000b00374bf3b62a0sm100908jaf.99.2022.10.28.18.45.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 18:45:22 -0700 (PDT) Message-ID: <644019f7-9616-f7de-7126-ff1a9d32a0d6@redhat.com> Date: Fri, 28 Oct 2022 21:45:21 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH] Correctly determine libc.so 'OUTPUT_FORMAT' when cross-compiling. To: Fangrui Song , =?UTF-8?Q?Ludovic_Court=c3=a8s?= Cc: libc-alpha@sourceware.org References: <20210701210019.5594-1-ludo@gnu.org> <87sfk0c6oi.fsf@gnu.org> <20221013205621.upcf2c2oo5diyxfx@google.com> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <20221013205621.upcf2c2oo5diyxfx@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: On 10/13/22 16:56, Fangrui Song wrote: > On 2022-10-07, Ludovic Courtès via Libc-alpha wrote: >> Hi Carlos, >> >> Carlos O'Donell skribis: >> >>> On Thu, Jul 01, 2021 at 11:00:19PM +0200, Ludovic Courtès via Libc-alpha wrote: >>>> Commit 87d583c6e8cd0e49f64da76636ebeec033298b4d replaces the sed script >>>> with an "objdump -f" invocation to determine the 'OUTPUT_FORMAT' bit of >>>> the libc.so linker script. >>>> >>>> However, when cross-compiling, for example from x86_64-linux-gnu to >>>> aarch64-linux-gnu, "objdump -f" would report the wrong >>>> format ("elf64-little").  Conversely, "aarch64-linux-gnu-objdump -f" >>>> reports "elf64-littleaarch64" as expected. >>>> >>>> This patch changes 'configure.ac' to use AC_CHECK_TOOL rather than >>>> '$CC -print-prog-name=objdump' to determine the value of the OBJDUMP >>>> variable.  That way, OBJDUMP is set to TRIPLET-objdump when >>>> cross-compiling for TRIPLET. >>> >>> I've been tackling a backlog of old glibc patches, and this one is up >>> next. Yes it's been over a year, but this patch still applies and the >>> idea is sound. I've tested this with build-many-glibcs (bmg) on x86_64 >>> and it has no impact because bmg always sets OBJDUMP. My opinion is that >>> bmg is the "base standard" for how we build native and cross tooling and >>> so it your changes work here, they should work in other instances. >>> >>> The change looks good to me. >>> >>> No regresions on x86_64. >>> >>> Would you like me to commit this? :-) >> >> I don’t have commit access AFAIK so I’ll happily defer to you.  :-) >> >> Thanks for taking the time to look at the backlog! >> >> Ludo’. > > Thanks. This looks good. Tested again with bmg to cross x86_64 to aarch64. No regressions. Pushed. Thank you! -- Cheers, Carlos.