Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2525512imm; Mon, 10 Sep 2018 02:30:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYEAAijCYMy55IpmH7c7YTDuEm0mJxH4+0JO0hJnuzbB1WscLFq7c+wMpshfq7MbopSkYHn X-Received: by 2002:a17:902:5617:: with SMTP id h23-v6mr20960033pli.324.1536571802143; Mon, 10 Sep 2018 02:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536571802; cv=none; d=google.com; s=arc-20160816; b=zBIku3mOM39kwtwnHNbqVwg66qKKG/coRSbDp9PPOFCmVLqOC1WnCf6i/ubgKFPA9E 39nCW1IhUDtLesdJy/DdPmvCp+PMEBAER7mhroDsQa51aTDLEZ24eBi3KtUIZwzttObJ hdvBSSHXwvUPvRz5q4KrL5fCmamUlwkXHeOxAFMOqJO7ldKFyTzdmIh5dm7dXGgyUWSv NX8XMnLVAg6TlQ/TNusqfbWt7IaKipe2uS+Ck6n7RjUV2kuVDxq2kpDWmV9nOXLwljOy us+EjjEK3gCUTlHUMCuaAQbxlRxo2J+9iMH3DF82VyL7M+waGIBGfWwcofBg96+F6e16 dZKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bHXCryUE900U9/Xi4G65zOUHDO75Un7a8t/UKIv1+Bc=; b=LdsaLE8JMQJHHpzPsuJ/mAkV4Gj2aq9V+EfdEpTW3saLd+nrGS3PwjiNivpAlitSjj w2PpkwRIKxuoXh9VZ6W+pGHfmLjiHhaFKzNIAWM/9M8XdICy5RTetbzm3ndpOtu3FiF0 XRBuGzXXVBHbt7jiIo1R8nAqaGQzrUl+CmBfBGahQLlOtQDE5IUnA6P6bYimTh3LiXnN jj44AUBtla6pae4h0TloBHRbXxFPS60lizquW4N3BdWE+sgWNXtt4L43YEyK5fQdwIgL oE8pcOuiTyMSTfZ/CkYwAUiqEQdZCpu3KJyH6dJpi9u00XHBxI7NJH81aCwAcmRLGkxp M5QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rwz5x1Eo; 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=QUARANTINE 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 2-v6si17478776pfd.39.2018.09.10.02.29.46; Mon, 10 Sep 2018 02:30:02 -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=@gmail.com header.s=20161025 header.b=Rwz5x1Eo; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727820AbeIJOVq (ORCPT + 99 others); Mon, 10 Sep 2018 10:21:46 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]:42958 "EHLO mail-wr1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbeIJOVq (ORCPT ); Mon, 10 Sep 2018 10:21:46 -0400 Received: by mail-wr1-f42.google.com with SMTP id v17-v6so21094832wrr.9; Mon, 10 Sep 2018 02:28:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=bHXCryUE900U9/Xi4G65zOUHDO75Un7a8t/UKIv1+Bc=; b=Rwz5x1Eo9qKC2G0EMfSFCuk4W16SYvpp1Jss6asCLSEwdICDWRMZbdgfK+BewKOnY3 AZVhNtYgaizmyn4e7C31G9/MW+pS+oBXYbRnMIGUrUQs9bde6GO8gRFg6zRYzp5iagPb 5tPxkQQ1kb0uF/XKEDyI0Z/rqynHeifT8Dpygq6Jfb7ydb4+0DQrThM/jtbMkfMTBLUl YqGOxxS/wqkuvKvBAwf+ud1gicnEwHWLFofqXjesrJWtpclkgF0kNV+QtI3WOm8gXMlB HTPT7Q+3tczHdXCXNFER/7F+0U7nbip192ls0B+0XJ4zRrkgIbC1KO74tv+CIIulmhED 19hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=bHXCryUE900U9/Xi4G65zOUHDO75Un7a8t/UKIv1+Bc=; b=V0KkSvBowkYq7DBES7k+fVJLwe44VqA4VG/SuQIJSysSmiK3VupUScJiaWvVXTAXHN tpIb9usN/gjDZ69q1attJCoW0TSG03E42pZpM4dryNO+8tWlMKS3OWzMedGcLqb0nc+z RtxuFi1SH08ZGVAnv5kz8SIaeEDU0kLO8emMuriJpP/H7OST/SVBkB1SX70wIAmVOzT/ MT6QheUK+1JB8XFgiEmzBJzArP5BYdebpPPjr9kBNOuNltpR3JmqC7/knTuoYJzonUuk 2lF8RjOte7X75f0DIxqvZHDDf97f9Pxh/Avgw7qYl9xICo23Qr6rdX+3GTeiU3aVy3oX ZrYQ== X-Gm-Message-State: APzg51CFCqIxLZpgDKownPTszZae8t5VNrIIURTmq5AmdZ9/phSZ/8Rt wHRG/ZmbM8whkURAnmyII1ODTaDY X-Received: by 2002:adf:dfca:: with SMTP id q10-v6mr13312647wrn.113.1536571718082; Mon, 10 Sep 2018 02:28:38 -0700 (PDT) Received: from ltop.local ([2a02:a03f:4006:df00:58a0:e14d:efc:4c92]) by smtp.gmail.com with ESMTPSA id t9-v6sm38401540wra.91.2018.09.10.02.28.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Sep 2018 02:28:37 -0700 (PDT) Date: Mon, 10 Sep 2018 11:28:36 +0200 From: Luc Van Oostenryck To: Christophe LEROY Cc: Nick Desaulniers , joe@perches.com, Kees Cook , LKML , linux-sparse@vger.kernel.org, sparse@chrisli.org Subject: Re: Conflict between sparse and commit cafa0010cd51f ("Raise the minimum required gcc version to 4.6") Message-ID: <20180910092835.v5nex5nzfgtl475m@ltop.local> References: <81a5fd11-366c-0897-4143-d8d041420a41@c-s.fr> <1324e7d6-83f8-f40f-ad34-c46e4ad3139b@c-s.fr> <20180907181337.peyfq7yvhahduvmq@ltop.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180622 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 10, 2018 at 08:49:07AM +0200, Christophe LEROY wrote: > Le 07/09/2018 ? 20:19, Nick Desaulniers a ?crit?: > > On Fri, Sep 7, 2018 at 11:13 AM Luc Van Oostenryck wrote: > > > > > > Sparse expand these macros to the same version than the compiler used > > > to compile GCC. I find a bit strange though to have sparse v0.5.2 but > > > using an old compiler. > > > > So Christophe must have a version of gcc < 4.6 installed somewhere? > > Does sparse use `cc`? If so, Christophe, does your `ls -l $(which cc)` > > point to an old version of gcc maybe? > > Indeed it looks like sparse expand these macros to the version of > the compiler it was compiled with. > > I'm building kernels for a powerpc platforms, with CROSS_COMPILE set > to ppc-linux- and ppc-linux-gcc being version 5.4 > > However my build machine is a CentOS6 and the native gcc has version > 4.4.7, so sparse expands that version. OK, I see. > Is there a way to get sparse in line with my cross compiler version > and not with the local native version ? When cross-compiling, there is also things like the machine word-size and the endianness to take in account (they also default to the native compiler used to compile sparse itself) as well as a few defines (like __PPC64__). To be in line with your cross-compiler you can use to the wrapper 'cgcc' (installed with sparse) and call it, for example, like this: $ export REAL_CC=ppc-linux-gcc $ cgcc -target=ppcc64 -D_CALL_ELF=2 -D__GCC__=5 -D__GCC_MINOR__=4 ... or, since this is for the kernel: $ export REAL_CC=ppc-linux-gcc $ make CHECK='cgcc -target=ppcc64 ... I think this should solve it. Do not hesitate to report any difficulties you may encounter. -- Luc