Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4950895yba; Mon, 13 May 2019 02:41:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwA+MbJwLVvtdnvWoM1PDVu5sUwCabrBRW6N/hUFZBaMXBTBGIfc8yE72RmD6WmiOMjUUAS X-Received: by 2002:a17:902:18b:: with SMTP id b11mr4132154plb.264.1557740512870; Mon, 13 May 2019 02:41:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557740512; cv=none; d=google.com; s=arc-20160816; b=Z5itWR1slxNGJQnuItRoa1sLOkGAOiVBVtdNy0ZOEiui1vCYZj3EypYGNKNtx6jtID aizWUjbAY20EkdEKLMl7fjhzt/TkEC/n3+SWAMtO8JNeA/xS5W3BPxiNXR4+Q8y/rUdM olGsIjAutGqHurIuPgsPFhJvwzcgXDaTv9vs7xbzKtmt8+9qvw14HDRpASi0Sc6jLly9 pcwlnUz00B7i4KHdlur2PtfNKp+tG+hLLxHy7B+4hizh9qZNOfbWaj7Z0yKKyGZBOgQe s/qQNSITmSioUho4y9tif5EXgTo1wTT2PXkPqf/hAedpcoPSWrInAQFn5B9otvEUPNur 08Tw== 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:dkim-signature; bh=OCBAgYZcl/Mx9I9kBUc9k0z+VS+2s/+/8BKjMe5L/4M=; b=N/7T7JE4TCQZ/u2+C3pCHyrPBrpcFwCRuULzzqIyWIDRGHvQg8exo+1mHB3toO4r9P acNTuZxBH0xi5dNhJLX3jwrdMRqSnW7dXgJ2vnehSxHwMRvkxJ5IbEdXtC+Ku8VQDUCJ weF3gG7KH2VidnNwqZ95Sf9+32yfFRHheXdTd5Zq5mU5gM1yNYaPtJg7+c0TtspFDM/s QeewP6LubQyA0dIy5TQjWqegyX8PDrj4syPGPsM1/v2rfKAqwobUW4k6WgS7SH6OU2rJ 4jc4L1l1hCkzlgwfdXDEBvAxRFQ0Ge8O1ZkPbmiYQYb7CvpIFrzUPn7O63vRPM45Ic/e xRNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=SZjZHRBa; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g14si14717265plo.287.2019.05.13.02.41.36; Mon, 13 May 2019 02:41:52 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=SZjZHRBa; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727640AbfEMHj6 (ORCPT + 99 others); Mon, 13 May 2019 03:39:58 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:50387 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727272AbfEMHj5 (ORCPT ); Mon, 13 May 2019 03:39:57 -0400 Received: by mail-it1-f193.google.com with SMTP id i10so14879099ite.0 for ; Mon, 13 May 2019 00:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OCBAgYZcl/Mx9I9kBUc9k0z+VS+2s/+/8BKjMe5L/4M=; b=SZjZHRBaI2LN21jyRT5EZkLIQdXHRrkgReZnW+swFod0bdKDie3+g+WGtklY0kC311 D1KKaZ2x7uQDR0V2qnPwQzvKPDzqAA94Zpm8YHT/sOwgUG6HPRnEqu85XA+O1k0sypE5 bbop+wUKsZ4yMehyLmsJ9459MhRGj3LYgqRz4uO/ypZ8wYUyM8rWxxtLJhVeYmIoNPzJ P0BGjN9KPs18zjGreU5S/Jg8qeugpnE19O6Fjj/RYomOU65m0ow3YaAVxRMZqaRgh++4 kfjbw31MpcBw/JJVWa6iRCoFOI7x3lquY0Qvqmfqv/Cd/3KZ+WPUFvwRRIVAPicbMYQz mSPw== 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=OCBAgYZcl/Mx9I9kBUc9k0z+VS+2s/+/8BKjMe5L/4M=; b=AX7UvDkgkSmtmgyXodgHSYbXwRTGijMs6cwLf+G6ct76I7hQfbQAfgwZejvYNTkj0Z LbkATqQ6HO7TXeA1KLuuR+JKgCbbWSM4I5DoSUS8V0qut9GBnfu4X7q2HGkYd5i+XX8B MZ1ZdPiF4u9e4JbMMQw5Wcr5Z/AF13XJ/iwIcOFvS6rJqbryGy31aezJCuXBM1T3Y2qA XmuexOGHnRSccc9BgtjSAfthHoXw/SPgWT/XjTkh6CkOjPPokJ/cRQxX172/MrPV4E+X 5/39orImB6FtzliEDAX7Xx1eQ9clGAjr3XoJVNBAxZqbLEuc5a9l/gI4ha44xZQNKTVS Prew== X-Gm-Message-State: APjAAAW8d7N0fdOacf/mtwJotjFPDLAhmfekwg5uyLxyZlR9GLjxruUf WOYQOmch/z71PxBrfVeKXV0TcvVX0fzd9olebpSuqQ== X-Received: by 2002:a05:660c:10f:: with SMTP id w15mr11634340itj.166.1557733196690; Mon, 13 May 2019 00:39:56 -0700 (PDT) MIME-Version: 1.0 References: <20190412143538.11780-1-hch@lst.de> In-Reply-To: From: Dmitry Vyukov Date: Mon, 13 May 2019 09:39:45 +0200 Message-ID: Subject: Re: [PATCH, RFC] byteorder: sanity check toolchain vs kernel endianess To: Arnd Bergmann 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 From: Arnd Bergmann Date: Sat, May 11, 2019 at 2:51 AM To: Dmitry Vyukov Cc: Nick Kossifidis, Christoph Hellwig, Linus Torvalds, Andrew Morton, linux-arch, Linux Kernel Mailing List, linuxppc-dev > 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. Thanks! This clears a lot. This may be a bug in our magic as we try to build kernel files outside of make with own flags (required to extract parts of kernel interfaces). So don't spend time looking for the Makefile bugs yet.