Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp517369pxb; Mon, 25 Apr 2022 15:22:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWU5NlP4Eb2s8Q+8KcEKu7AGZo0NOfOdAyG6t6vPPBmKjcYJXjf5/H+SrailcEulLWVGff X-Received: by 2002:a17:90a:901:b0:1d9:4253:23e with SMTP id n1-20020a17090a090100b001d94253023emr13854042pjn.150.1650925366031; Mon, 25 Apr 2022 15:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650925366; cv=none; d=google.com; s=arc-20160816; b=Bwi34TgcHn89QqkoW11SAu9MQ6wcgxQvy8mm/0kEybIPnIj97i2158kLHbxqB+8xno 8i79QtCmpqYh6Fx5D2hkUDkK+PW2vzA42LLa+2cPs3jP00PTaaT3dvd5ZyHlKfH7r+TX MTNBew901npmbcoBWFobGmjBsT+pmays7yhbzL6NdB79BcVTbiiT9YPyJ//SRaBYpwQm WYu6d0DW+PzwMgrkZtRrAN8Nu1fmeRATFXa8SNaX5H2cYcxsJvT7VpIeyVNl7KGEiIrk d1Vbd3bFAl9pgi9BbNBmpmNbsxEdDEsAe9I7R2qI/z2eqHPMZwfRCf/F0wIOyF/Hh2OG ozbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3bT9S+VY2i3onixTKTaTwovdaV7rvNqFw7jUDNK3p/o=; b=v9AeJCrtIeSKVaCCXPBOmefk5fL8L3VJQ7TiiJ1TMcMKW3BgAkVo1UzGTtysppvsja 6Rat4Yu0SmuejbMosIFGjw7imeRUJ3JshR5/b9QCizmMvarwFkapN7fhJccn0T+14gq8 lKKzzG6g44B8IRlid5D5mOdPcbI/LcLtO4bnI7Qm7OKQuBVWy3B3dfXKJSAKCOvNvrVr pNu+qFy56TDVpqbFMhhI6O6yF1kqi6lXW16xldiToHpihui6hmj2/iTW4d+ndyXH0b6l RnQrhEh8+I84q8iLBR0LKWB9PHS3n4nEh6FCc5na+bTXDWq3z2GLb1brrmWCPn7nuuT0 c1Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=BjcCxH1g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s9-20020a170902a50900b00153b2d16437si16387568plq.63.2022.04.25.15.22.27; Mon, 25 Apr 2022 15:22:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=BjcCxH1g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243708AbiDYRFM (ORCPT + 99 others); Mon, 25 Apr 2022 13:05:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243336AbiDYRFL (ORCPT ); Mon, 25 Apr 2022 13:05:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2C2D1C11F for ; Mon, 25 Apr 2022 10:02:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8DB9F614F9 for ; Mon, 25 Apr 2022 17:02:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BDDFC385A7; Mon, 25 Apr 2022 17:02:05 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="BjcCxH1g" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1650906122; 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: in-reply-to:in-reply-to:references:references; bh=3bT9S+VY2i3onixTKTaTwovdaV7rvNqFw7jUDNK3p/o=; b=BjcCxH1gRx+XRu/oEPKS12iawQoa7VkVfSZYS/6iYyY8vZEaWIS2w+yUHhqPYhNIPFCA2q 224GimbDT7u0I8jZbx0tCBLASmPOQeOaH53zbJZEFyYByqiX1d4hdDtL8vq7yar3VrxjgV /XuavYSenfNrBYFbhOy2DWSk0X4vB5o= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 36a3af82 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 25 Apr 2022 17:02:02 +0000 (UTC) Date: Mon, 25 Apr 2022 19:01:57 +0200 From: "Jason A. Donenfeld" To: Arnd Bergmann Cc: Linux Kernel Mailing List , Nick Desaulniers Subject: Re: odd endianness toolchains for crosstool Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Mon, Apr 25, 2022 at 06:15:07PM +0200, Arnd Bergmann wrote: > On Mon, Apr 25, 2022 at 5:53 PM Jason A. Donenfeld wrote: > > > > Hi Arnd, > > > > On Mon, Apr 25, 2022 at 05:39:34PM +0200, Arnd Bergmann wrote: > > > I can probably do that before migrating to the new machine, but I can't > > > promise how quickly I find time to start. > > > > Oh awesome. Will keep my eye out for it. > > > > > > (And also, build ppc32 with --enable-secureplt --with-long-double-64.) > > > > > > Can you explain what those are about? Is this related to the ELFv1 > > > vs ELFv2 difference or something else? Is this needed in both the > > > ppc32 and ppc64 compilers that each come with both targets? > > > > For 32-bit, it is required. From > > : > > > > powerpc (needs gcc built with --enable-secureplt > > --with-long-double-64, and -Wl,--secure-plt to link dynamic > > binaries.) > > > > And from the INSTALL file it says: > > > > * PowerPC > > * Compiler toolchain must provide 64-bit long double, not IBM > > double-double or IEEE quad > > * For dynamic linking, compiler toolchain must be configured for > > "secure PLT" variant > > > > For 64-bit, I'm not sure, but I know that at least -mabi=elfv2 is required, > > and I think --with-long-double-64 too, according to documentation: > > > > * PowerPC64 > > * Both little and big endian variants are supported > > * Compiler toolchain must provide 64-bit long double, not IBM > > double-double or IEEE quad > > * Compiler toolchain must use the new (ELFv2) ABI regardless of > > whether it is for little or big endian > > Ok, I see. For all I can tell, the toolchain I built already uses both > --with-long-double-64 > and --enable-secureplt, as those seemt to be the default for Linux. For ppc32? I'm unable to produce working executables with the toolchain. And looking at the target info, -msecure-plt is missing, while -mlong-double-64 is there: $ ./powerpc-linux-gcc -Q --help=target | grep long-double -mlong-double- 64 $ ./powerpc-linux-gcc -Q --help=target | grep msecure-plt -msecure-plt [disabled] For ppc64, I see the same. I'll try to look into it more though. > Regarding the the ELF ABI, I'm not sure how to check, but I think it > only does ELFv1, which is the default for big-endian glibc. Yes, it only is doing ELFv1 right now. musl checks this in with this: trycppif "_CALL_ELF == 2" "$t" || fail "$0: error: unsupported powerpc64 ABI" Jason