public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Jiri Slaby <jslaby@suse.cz>
Cc: Michal Marek <MMarek@suse.com>,
	linux-kbuild@vger.kernel.org,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: Kbuild: CC= handling broken for tools/
Date: Fri, 11 Nov 2016 16:14:27 +0100	[thread overview]
Message-ID: <20161111151427.GA27779@krava> (raw)
In-Reply-To: <f4fc1e89-bd82-917e-a986-c02b24c6b8d8@suse.cz>

On Fri, Nov 11, 2016 at 03:04:35PM +0100, Jiri Slaby wrote:
> On 11/11/2016, 03:00 PM, Jiri Olsa wrote:
> > On Fri, Nov 11, 2016 at 12:23:25PM +0100, Jiri Slaby wrote:
> >> Hi,
> >>
> >> I am trying a new gcc with new warnings enabled:
> >>
> >> make O=../a/gcc7/ CC='gcc-7' V=1 kernel/exit.o
> >> EXTRA_CFLAGS='-Wimplicit-fallthrough=3'
> >>
> >> But the build fails when building under tools/:
> >> ...
> >> make -f /home/latest/linux/tools/build/Makefile.build dir=. obj=fixdep
> >>   gcc
> >> -Wp,-MD,/home/latest/a/gcc7/tools/objtool/.exec-cmd.o.d,-MT,/home/latest/a/gcc7/tools/objtool/exec-cmd.o
> >> -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security
> >> -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes
> >> -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked
> >> -Wredundant-decls -Wshadow -Wstrict-aliasing=3 -Wstrict-prototypes
> >> -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat
> >> -Wimplicit-fallthrough=3 -ggdb3 -Wall -Wextra -std=gnu99 -O6
> >> -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC -Werror
> >> -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
> >> -I/home/latest/linux/tools/include/ -I/home/latest/linux/include/uapi
> >> -I/home/latest/linux/include -D"BUILD_STR(s)=#s"   -c -o
> >> /home/latest/a/gcc7/tools/objtool/exec-cmd.o exec-cmd.c
> >> gcc: error: unrecognized command line option ‘-Wimplicit-fallthrough=3’;
> >> did you mean ‘-Wno-fallthrough’?
> >>
> >>
> >> Apparently, CC is not respected for tools/ dir.
> >>
> >> Well, it is used (tools/build/Makefile.build):
> >> # Compile command
> >> quiet_cmd_cc_o_c = CC       $@
> >>       cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
> >>
> >>
> >> But I don't know why CFLAGS propagate from Makefile to tools/, but CC
> >> doesn't (both are exported)? Any ideas?
> > 
> > so the root Makefile assign CC directly:
> >   CC              = $(CROSS_COMPILE)gcc
> > 
> > we are trying to be a little bit smarter in perf
> > and set it only if it's not set by user
> > 
> > # Allow setting CC and AR and LD, or setting CROSS_COMPILE as a prefix.
> > $(call allow-override,CC,$(CROSS_COMPILE)gcc)
> > $(call allow-override,AR,$(CROSS_COMPILE)ar)
> > $(call allow-override,LD,$(CROSS_COMPILE)ld)
> > 
> > I did not check the other tools..
> 
> Note that I don't care about tools at all. objtool (see the dump above)
> is apparently needed to build the kernel proper, so it is built as a
> part of kernel.
> 
> BTW shouldn't it use HOSTCC anyway?

hum, probably.. adding Josh to the loop

jirka

  reply	other threads:[~2016-11-11 15:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 11:23 Kbuild: CC= handling broken for tools/ Jiri Slaby
2016-11-11 12:38 ` Michal Marek
2016-11-11 14:00 ` Jiri Olsa
2016-11-11 14:04   ` Jiri Slaby
2016-11-11 15:14     ` Jiri Olsa [this message]
2016-11-11 15:30       ` Josh Poimboeuf
2016-11-11 17:08         ` Jiri Slaby
2016-11-11 17:21           ` Josh Poimboeuf

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=20161111151427.GA27779@krava \
    --to=jolsa@redhat.com \
    --cc=MMarek@suse.com \
    --cc=jpoimboe@redhat.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox