From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
viro@ZenIV.linux.org.uk, pinskia@gmail.com, joe@perches.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] kernel: use the gnu89 standard explicitly
Date: Mon, 20 Oct 2014 12:23:12 +0300 [thread overview]
Message-ID: <20141020092312.GA12047@node.dhcp.inet.fi> (raw)
In-Reply-To: <1413772855-8613-1-git-send-email-sasha.levin@oracle.com>
On Sun, Oct 19, 2014 at 10:40:55PM -0400, Sasha Levin wrote:
> gcc5 changes the default standard to c11, which makes kernel
> build unhappy.
>
> Explicitly define the kernel standard to be gnu89 which should
> keep everything working exactly like it was before gcc5.
>
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
> ---
>
> Changes from v1:
> - I've accidently placed the statement in a CONFIG_READABLE_ASM.
> It shouldn't be there.
>
> Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Makefile b/Makefile
> index dd7e1cb..eb0c026 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -625,6 +625,7 @@ all: vmlinux
> include $(srctree)/arch/$(SRCARCH)/Makefile
>
> KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
> +KBUILD_CFLAGS += $(call cc-option,-std=gnu89,)
I'm pretty sure all gcc versions you can build kernel with supports
-std=gnu89. cc-option is redunrant.
We also need to adjust HOSTCFLAGS otherwise allmodconfig fails for me.
Singed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com.
diff --git a/Makefile b/Makefile
index 05d67af376c5..27570984f28e 100644
--- a/Makefile
+++ b/Makefile
@@ -297,7 +297,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
HOSTCC = gcc
HOSTCXX = g++
-HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
HOSTCXXFLAGS = -O2
ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
@@ -401,7 +401,8 @@ KBUILD_CPPFLAGS := -D__KERNEL__
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common \
-Werror-implicit-function-declaration \
- -Wno-format-security
+ -Wno-format-security \
+ -std=gnu89
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
--
Kirill A. Shutemov
next prev parent reply other threads:[~2014-10-20 9:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-20 2:40 [PATCH v2] kernel: use the gnu89 standard explicitly Sasha Levin
2014-10-20 9:23 ` Kirill A. Shutemov [this message]
2014-11-14 13:43 ` Andrey Ryabinin
2014-11-15 3:04 ` Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141020092312.GA12047@node.dhcp.inet.fi \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pinskia@gmail.com \
--cc=sasha.levin@oracle.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.