Received: by 10.223.164.202 with SMTP id h10csp516042wrb; Wed, 8 Nov 2017 21:57:00 -0800 (PST) X-Google-Smtp-Source: ABhQp+RXyNwucqGfcj+idbQWF/jkwaRkXgmwJ1pz3j7FGdew8AHJLc2eZ8KqKBpDlFIyphoyfp2x X-Received: by 10.99.124.91 with SMTP id l27mr2847963pgn.49.1510207020668; Wed, 08 Nov 2017 21:57:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510207020; cv=none; d=google.com; s=arc-20160816; b=Y7i8i4Xg14/dkGScUnj+WiD5oRO31A3uJ9aspgXr3GwnpUMM4ZInAaqlycyEMg6XpR NZDVF9DcbdVwcfrMLJqPR+Mmfa4ofs0usV9im+1WGlLk/8K7Tif2yWYqIvRekSXesZc2 DHteT9V75KHPbkPdYSU3+KrRpGC/zHpZ9rc51KWmKtNGYWvQcAq8rxXd4hYgQ5ZFMbm5 xmrzUSNTCuIsB+0kZHvJHAE5UgHqblgvRSTjQGiRT/ro0mcI4P0D9o0M6Q0DYOfqmUr4 Og07KrubLEjcN5imeSJTB4E6Sb2WTvgC1azPvelCXRxwpCrK2cM28NF7kzGYKI36NcaR gwnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=SyrmH1NL39UgMc9C7igqxgYOlnJymdP61XVdXRCzQsE=; b=Rq2kldaGDKcWsQlFEu2Dyz0S3vyyf9FaKbCXQuY5SIvS10WC0z5qGx4adBJImGh8lZ vxaTKFK3fR4XJdYsa28q1uKvcixKN9wYC0tcm/bljx/hDqsNzEqOg8QprodF5kGNX3bf Ay+aAaTDGXYAeQoTgVzKx+shC81h/jourO8W9XQtuIxGSi3xW3AHqFWHjGys+MKViYxD bOYOPM8FOYQID5pjdKSZE38nNlRzI6kT934Jm0Pz9j0zkXIgb+5hBglrjdgFnsSuO/Rc 2KgHzS2HORyGgWzYjHIs+ybL6pq0lHoziQf01Vbu43DJzkbPMX29VakA5WRfJ86OijNA 6q3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aqBKPMDG; 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=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o19si5874621pfk.349.2017.11.08.21.56.48; Wed, 08 Nov 2017 21:57:00 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=aqBKPMDG; 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=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751544AbdKIF4H (ORCPT + 82 others); Thu, 9 Nov 2017 00:56:07 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:47554 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751012AbdKIF4F (ORCPT ); Thu, 9 Nov 2017 00:56:05 -0500 Received: by mail-wm0-f68.google.com with SMTP id r196so14650097wmf.2 for ; Wed, 08 Nov 2017 21:56:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SyrmH1NL39UgMc9C7igqxgYOlnJymdP61XVdXRCzQsE=; b=aqBKPMDGlM4eCnwBICvHCCrl6yfz+Wnj/w78ptmDB3tMfqTufCEkxFzyv4TNEBAG0N u3+tmi/AWWER+4xvzAWY3cxKzi90g8Y/+4SU16zIJ+ZdpxzSl2LiKja13FgrJBYkyTJk AiLaJgdH4TlZ3iC0Umi525OEY8TmRFvZ+3nhc5cYaPQZYiqmCJghGr68F6kJPMDCMDZU OzyKKtAk9TzzoTccxNi7uPaVlSEWHe53FwRpqHlws5evPAL1oyZvj6LwXfpAAt9u4uTt e2KhCaKEZYquUuDfKcP+4rb9rhhs7+kUrXxkiyA5UMmltwdnMIiCg4X72sSk/hzIf1BA JghQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SyrmH1NL39UgMc9C7igqxgYOlnJymdP61XVdXRCzQsE=; b=bz3tukvblDG9Scsosi33ItXqAQrjvlBeYAnwBLwq19ljZB42MBJG/HSrPwk8/R6hxu 38QODSNtgMue+FhfwPm6Qrrw/xihr3ByoC3HYQuJbmOF5NkOyZWv5JxutUZudc5u+Nm9 RqUpUSC8MzvyNZSIU6TTJviUbyXkSX5QEHrCLjrDnkSP8qLpV4h/nbt+61iIjorhqXP9 Q1drt9OZ4HB2POMDnqXJdVwjtRMF0piz35aXRUcMtQecSrrjGGx+oyL0rqRt/Va+XqDM OnTDSyvOjyZv0KynaqpcARB2uiWHMNm/fhQTcijB4XOYamXgWdaWFaM+l5vw/bRmkKK4 hR7w== X-Gm-Message-State: AJaThX7Hfe+fcKVvc4lcIKoCEiXqWyha5TwzMlqIk+R57jEOsuW9nYse nYsDixn8A2fvQasFNgIOAqA= X-Received: by 10.80.151.175 with SMTP id e44mr3667959edb.228.1510206963878; Wed, 08 Nov 2017 21:56:03 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:40c4:1100:182b:88ec:6996:f149]) by smtp.gmail.com with ESMTPSA id t10sm4917969edb.92.2017.11.08.21.56.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Nov 2017 21:56:03 -0800 (PST) From: Luc Van Oostenryck To: Palmer Dabbelt Cc: Luc Van Oostenryck , Albert Ou , patches@groups.riscv.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] riscv: pass endianness info to sparse Date: Thu, 9 Nov 2017 06:53:53 +0100 Message-Id: <20171109055354.14716-2-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20171109055354.14716-1-luc.vanoostenryck@gmail.com> References: <20171109055354.14716-1-luc.vanoostenryck@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RISC-V is little-endian only but sparse assumes the same endianness as the building machine. This is problematic for code which expect __BYTE_ORDER__ being correctly predefined by the compiler which sparse can then pre-process differently from what gcc would, depending on the building machine endianness. To avoid any possible problem, fix this by letting sparse know about the architecture endianness. Signed-off-by: Luc Van Oostenryck --- arch/riscv/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 6719dd30e..206484dde 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -16,6 +16,8 @@ KBUILD_CFLAGS_MODULE += -fPIC KBUILD_DEFCONFIG = defconfig +CHECKFLAGS += -mlittle-endian + export BITS ifeq ($(CONFIG_ARCH_RV64I),y) BITS := 64 -- 2.14.0 From 1583442318136708471@xxx Tue Nov 07 20:57:50 +0000 2017 X-GM-THRID: 1583322856312561577 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread