Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3370445imm; Tue, 29 May 2018 06:11:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoop6pf+cT4NXYk1Zg/fj7NqNhyMlxuDUtUFZ1nVE8hZOhm3t+9sWjIwp5qEaU/0EcIAuw3 X-Received: by 2002:a62:e30f:: with SMTP id g15-v6mr17448565pfh.68.1527599488055; Tue, 29 May 2018 06:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527599488; cv=none; d=google.com; s=arc-20160816; b=gWFAeq02NWYda1xzqX1Mgu+T0+AracEK0xh1/QUFFtZKIZWwXRIMs4Kv6TrBheEX/X dXCYwJblaUtYSMJlXxzzJ3BP0wPbRNbmx118gme618V56k3F0/rO0Mzx2lE0TDUOn3uq p4frTJNsTvJBDYU81WJs5fV3fkQyYmM+EwatxDYLkbUIFkwSeoKuo5nDUGSIRDF4RRer dASiCIZBrYVR61soiyk+KbhgpqTq+L0k37b9cA9GwkOlMbrbA/WVHb+erYfEAXOEzFZm iKjPQvPGiHmV9u6SUxEBnqnaTRlJxFXQwt1oyc3gnkwMjO1h5iR3lD4kXXAAS9PQ1zKz n8CA== 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 :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=AlPMZ5HkcqjlE8oMdF2LBb5muBKuA7tbUJXALRt6vLk=; b=GYLTak/2YvMITJD1a6AbIyKSi3pwl10W0qx+y30mbvmt8kn5+9bpiq6h88V1HSwKB5 DGbD3Ko2DR3JUAQ28JYUY0iAsQagpiCRvnAkCQCiUTIMBGcHz2ZHeJON/VStJsEVZbiF RHp71uK1BjQvG/PYGa6C+C4HZUG8iUDKy7vBJ92gZ7FIh4o1ZuE0r7mbJDGaPEycng+n X5kJXtGWT7fzK+HSLksR3E2y+560Nv7P+lyP3l+EE0JRHxRAMGixUsA77OkTjcA922yo ZT6HKsFtZSmIzKtaVqgydh4p2VkvybtPNIr8uBZviUkpc05CDgjYLmQ8pufjTB94f3ZQ A3GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=V4q9NpIq; 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 p66-v6si32048824pfg.329.2018.05.29.06.11.13; Tue, 29 May 2018 06:11:28 -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=@nifty.com header.s=dec2015msa header.b=V4q9NpIq; 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 S934248AbeE2NI4 (ORCPT + 99 others); Tue, 29 May 2018 09:08:56 -0400 Received: from conssluserg-05.nifty.com ([210.131.2.90]:17330 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933444AbeE2NIw (ORCPT ); Tue, 29 May 2018 09:08:52 -0400 Received: from mail-ua0-f176.google.com (mail-ua0-f176.google.com [209.85.217.176]) (authenticated) by conssluserg-05.nifty.com with ESMTP id w4TD8lrA014125; Tue, 29 May 2018 22:08:48 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com w4TD8lrA014125 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527599328; bh=AlPMZ5HkcqjlE8oMdF2LBb5muBKuA7tbUJXALRt6vLk=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=V4q9NpIqSLzRaFShrovGHU90Da0xGJKdNlnA9yclqn0qNavqaM9owsfrAL1U9HZFB fACVcWibSHcf+CBnW44PhMBBodXRvScpGy63WLl4hHCbXf8O9WVbqn2Sg+gOmSzxaI W1/mW6W47k9o6GxpKXWY14dAONqvWOlAqxc3+lpyGiKd6cUH86eVqfpFVvAsCbaYc+ hQuxrruvTa/2uLLF8/8XQl0fGYcllR77GUzNXlGje748+b4FuaQek6pLawsyHlGSmK MpX6F+RAXA/PZnRMi+nE3PHI0j56r1SzHBp871OkKMPnO7o8kQFo/P/8IRFBEOIbje uW36lVZiM608Q== X-Nifty-SrcIP: [209.85.217.176] Received: by mail-ua0-f176.google.com with SMTP id y8-v6so9915826ual.5; Tue, 29 May 2018 06:08:48 -0700 (PDT) X-Gm-Message-State: ALKqPwejLyN51XhRxT72mRgGTezHjioYzbvMaUQi697D1r0rhjAk2qUI FRvgdXhf/w/r8AyK5fv2p2tZZXzo347dvG4QfN4= X-Received: by 2002:ab0:13c9:: with SMTP id n9-v6mr10979795uae.140.1527599327344; Tue, 29 May 2018 06:08:47 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:55d8:0:0:0:0:0 with HTTP; Tue, 29 May 2018 06:08:06 -0700 (PDT) In-Reply-To: <20180528182735.18257-1-luc.vanoostenryck@gmail.com> References: <20180528182735.18257-1-luc.vanoostenryck@gmail.com> From: Masahiro Yamada Date: Tue, 29 May 2018 22:08:06 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] kbuild: add endianness flag to CHEKCFLAGS To: Luc Van Oostenryck Cc: Jonas Bonn , Stefan Kristiansson , Stafford Horne , "James E . J . Bottomley" , Helge Deller , Martin Schwidefsky , Heiko Carstens , Michal Marek , Linux Kbuild mailing list , Linux Kernel Mailing List , openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linux-s390 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 2018-05-29 3:27 GMT+09:00 Luc Van Oostenryck : > The kernel depends on macros like __BYTE_ORDER__, > __BIG_ENDIAN__ or __LITTLE_ENDIAN__. > > OTOH, sparse doesn't know about the endianness of the kernel and > by default uses the same as the machine on which sparse was built. > > Ensure that sparse can predefine the macros corresponding to > how the kernel was configured by adding -m{big,little}-endian > to CHECKFLAGS in the main Makefile (and so for all archs). > Also, remove the equivalent done in arch specific Makefiles. > > Signed-off-by: Luc Van Oostenryck > --- Applied to linux-kbuild. Thanks. > Makefile | 3 +++ > arch/openrisc/Makefile | 1 - > arch/parisc/Makefile | 2 +- > arch/s390/Makefile | 2 +- > 4 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/Makefile b/Makefile > index 56ba070df..6c6610913 100644 > --- a/Makefile > +++ b/Makefile > @@ -878,6 +878,9 @@ ifeq ($(CONFIG_STRIP_ASM_SYMS),y) > LDFLAGS_vmlinux += $(call ld-option, -X,) > endif > > +# insure the checker run with the right endianness > +CHECKFLAGS += $(if $(CONFIG_CPU_BIG_ENDIAN),-mbig-endian,-mlittle-endian) > + > # Default kernel image to build when no specific target is given. > # KBUILD_IMAGE may be overruled on the command line or > # set in the environment > diff --git a/arch/openrisc/Makefile b/arch/openrisc/Makefile > index cf8802962..89076a66e 100644 > --- a/arch/openrisc/Makefile > +++ b/arch/openrisc/Makefile > @@ -25,7 +25,6 @@ LDFLAGS_vmlinux := > LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) > > KBUILD_CFLAGS += -pipe -ffixed-r10 -D__linux__ > -CHECKFLAGS += -mbig-endian > > ifeq ($(CONFIG_OPENRISC_HAVE_INST_MUL),y) > KBUILD_CFLAGS += $(call cc-option,-mhard-mul) > diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile > index 34ac503e2..348ae4779 100644 > --- a/arch/parisc/Makefile > +++ b/arch/parisc/Makefile > @@ -22,7 +22,7 @@ KBUILD_IMAGE := vmlinuz > KBUILD_DEFCONFIG := default_defconfig > > NM = sh $(srctree)/arch/parisc/nm > -CHECKFLAGS += -D__hppa__=1 -mbig-endian > +CHECKFLAGS += -D__hppa__=1 > LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) > export LIBGCC > > diff --git a/arch/s390/Makefile b/arch/s390/Makefile > index c79936d02..68a690442 100644 > --- a/arch/s390/Makefile > +++ b/arch/s390/Makefile > @@ -18,7 +18,7 @@ KBUILD_CFLAGS += -m64 > KBUILD_AFLAGS += -m64 > UTS_MACHINE := s390x > STACK_SIZE := 16384 > -CHECKFLAGS += -D__s390__ -D__s390x__ -mbig-endian > +CHECKFLAGS += -D__s390__ -D__s390x__ > > export LD_BFD > > -- > 2.17.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Best Regards Masahiro Yamada