From patchwork Wed Apr 15 19:45:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 6222491 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 35A529F1AC for ; Wed, 15 Apr 2015 19:48:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A812202E9 for ; Wed, 15 Apr 2015 19:48:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD00A202D1 for ; Wed, 15 Apr 2015 19:48:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756275AbbDOTsn (ORCPT ); Wed, 15 Apr 2015 15:48:43 -0400 Received: from one.firstfloor.org ([193.170.194.197]:57675 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751607AbbDOTsm (ORCPT ); Wed, 15 Apr 2015 15:48:42 -0400 Received: from basil.firstfloor.org (174-25-65-185.ptld.qwest.net [174.25.65.185]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by one.firstfloor.org (Postfix) with ESMTPSA id A469B86774; Wed, 15 Apr 2015 21:48:40 +0200 (CEST) Received: by basil.firstfloor.org (Postfix, from userid 1000) id 27E87A8B54; Wed, 15 Apr 2015 12:45:52 -0700 (PDT) From: Andi Kleen To: akpm@linux-foundation.org Cc: mmarek@suse.cz, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Kleen , Segher Boessenkool Subject: [PATCH] Support gcc 6 for building Date: Wed, 15 Apr 2015 12:45:43 -0700 Message-Id: <1429127143-31745-1-git-send-email-andi@firstfloor.org> X-Mailer: git-send-email 2.3.3 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andi Kleen gcc recently switched to a new version number scheme, where every version gets a new major version number. The current version is 5.x, the next 6.x, etc. The gcc git repository trunk branch just switched to report 6.x for the next major release. This breaks the way Linux selects compiler-gccX.h based on the major version. Every new version would require adding a new compiler-gccX.h file, which wouldn't really scale. Let's assume that future gccs are fairly compatible (they are unlikely to break anything Linux is relying on). So we can just keep using compiler-gcc5.h, and select any specific differences with #if. Cc: Segher Boessenkool Signed-off-by: Andi Kleen Tested-by: Segher Boessenkool --- include/linux/compiler-gcc.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index cdf13ca..9c9a4e4 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -104,7 +104,12 @@ #define __gcc_header(x) #x #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) #define gcc_header(x) _gcc_header(x) -#include gcc_header(__GNUC__) +#if __GNUC__ < 5 +#define __LINUX_GCC_VERSION __GNUC__ +#else +#define __LINUX_GCC_VERSION 5 +#endif +#include gcc_header(__LINUX_GCC_VERSION) #if !defined(__noclone) #define __noclone /* not needed */