Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2725999yba; Fri, 10 May 2019 17:53:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwS+OT9UQG2rJenaWJZNqzpsB4xrxr6PfuCECWJGpeoPt0j46WMRT9/2VzCPpOcFCQVbmGd X-Received: by 2002:a63:9d83:: with SMTP id i125mr12423047pgd.229.1557535999110; Fri, 10 May 2019 17:53:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557535999; cv=none; d=google.com; s=arc-20160816; b=0lI3Mow/VtCvHuehVdC7ag2EHiiIYHOBGOCEYXX2eNYHBStGDJJiIN4hrb5/BozYdP ngP0ECVAKK3SdPprG16g8d6WFrycI64j1CLUCeyw2TkZIqAoKiJTwcH9/ec+2Ic5xI6P /Xj3vs/D7t4E8LdPa4ECWQ5CK1UHwVeC7w29DR2WQXkEm5LJPncuHFqDuAj2ISW/+eGm 6FzYBd5Zm5S7wrkMeAyObrmmcATRaJkm/DxpYTIRy6y0dJpS/BsRD0FMlVpRUYpbiWgc FnvIPxYl36tn6Hifwx67O7Pqn+0q83IJJz7T5n2+o6vHSv/++rh2I8OKLaJqu/B2aKYz daKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=2yJyMuj40ehLn1VJjGCyDbn5ZrzNMv6yLbIutJnLbw0=; b=0qMgsIUO9+ebCMBfcybO7e0UcjjGAXiPeXN2hjd2WOLudShuhu4FYf1LaD4JUz1DMK gZ+7Rztw1EQSc1B6fi4lnO+v8hQ2bYb6UV+NG8C81qy3Wb2t74SidT8GRbzxTztOycOK qZjMEYRT1wn4N0SBKIRvXRXmHAOq5U1hMejFyN4jxVC5Ygfi/rxXAjcc0aEO061z4jDz g7uzpDKl8nMMytUlPWse9iAvf2xxvmUGSz0if+K9oMRLpem12KxhnL+zHB6q/GdOScqd lfq1HpGhbxM2oh6bQAP0L6Ww38ldGxFUnthG8xN+0Pv2212wpipwX7HvIV7m66O2BG7f s3Cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si8543948plx.232.2019.05.10.17.53.00; Fri, 10 May 2019 17:53:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728208AbfEKAvb (ORCPT + 99 others); Fri, 10 May 2019 20:51:31 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:38098 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727961AbfEKAvb (ORCPT ); Fri, 10 May 2019 20:51:31 -0400 Received: by mail-qt1-f193.google.com with SMTP id d13so1598567qth.5; Fri, 10 May 2019 17:51:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2yJyMuj40ehLn1VJjGCyDbn5ZrzNMv6yLbIutJnLbw0=; b=oslF2ILCtz6Ra76n5Gdli4mg1t5uTVK7flOHFONAcO6QR/C1HZJyMnQhDnsDBICH5n /DPlgM+yrTiIRHefxIdZVJTdVzACEdIyOxVdtF3lypZIf8IFfqtX42lm/iYW4z9h0WoB V2viRR6n4BfhTZB0nMuA4VTM2HO4Jpy271uaygsjvCVS4YOKjRqg05ZDWFwldAokokyc pXW0IWQoH59hDEwPp1wVpQySlIPbOaQV8NrBJ8XvudPBj6yKz6q0duBu7l7sz65WCaF3 9B9T68OZTB8RmxyXanUii4lk9QlxtPHQCgFXcYzr1c9lCTFiuUL+aDPvTqMzvmaxPxID 72yw== X-Gm-Message-State: APjAAAXdPTq2g06a2VWs1UaWFq4r95Yq8XqEcaH4Aa2pTlqZ2TKoxzw1 pSjpbBiCpO3qvSah9KDzPvsOTdFFlYdmAYBw/Ho= X-Received: by 2002:a0c:87f4:: with SMTP id 49mr11681367qvk.149.1557535885304; Fri, 10 May 2019 17:51:25 -0700 (PDT) MIME-Version: 1.0 References: <20190412143538.11780-1-hch@lst.de> In-Reply-To: From: Arnd Bergmann Date: Fri, 10 May 2019 20:51:12 -0400 Message-ID: Subject: Re: [PATCH, RFC] byteorder: sanity check toolchain vs kernel endianess To: Dmitry Vyukov Cc: Nick Kossifidis , Christoph Hellwig , Linus Torvalds , Andrew Morton , linux-arch , Linux Kernel Mailing List , linuxppc-dev Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 10, 2019 at 6:53 AM Dmitry Vyukov wrote: > > > > I think it's good to have a sanity check in-place for consistency. > > > Hi, > > This broke our cross-builds from x86. I am using: > > $ powerpc64le-linux-gnu-gcc --version > powerpc64le-linux-gnu-gcc (Debian 7.2.0-7) 7.2.0 > > and it says that it's little-endian somehow: > > $ powerpc64le-linux-gnu-gcc -dM -E - < /dev/null | grep BYTE_ORDER > #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ > > Is it broke compiler? Or I always hold it wrong? Is there some > additional flag I need to add? It looks like a bug in the kernel Makefiles to me. powerpc32 is always big-endian, powerpc64 used to be big-endian but is now usually little-endian. There are often three separate toolchains that default to the respective user space targets (ppc32be, ppc64be, ppc64le), but generally you should be able to build any of the three kernel configurations with any of those compilers, and have the Makefile pass the correct -m32/-m64/-mbig-endian/-mlittle-endian command line options depending on the kernel configuration. It seems that this is not happening here. I have not checked why, but if this is the problem, it should be easy enough to figure out. Arnd