Thread (3 messages) 3 messages, 3 authors, 2017-11-29

[PATCH v3] kbuild: Set KBUILD_CFLAGS before incl. arch Makefile

From: geert@linux-m68k.org (Geert Uytterhoeven)
Date: 2017-11-28 19:27:47
Also in: linux-kbuild, linux-mips, lkml

Hi Nick,

On Tue, Nov 28, 2017 at 7:18 PM, Nick Desaulniers
[off-list ref] wrote:
Thanks for merging Chris' patch, and sorry for taking so long to respond.

On Wed, Nov 22, 2017 at 8:24 PM, Masahiro Yamada
[off-list ref] wrote:
quoted
Linus suggests to move compiler flag testing to Kconfig.
Do you have an LKML link for context?

On Wed, Nov 15, 2017 at 6:32 PM, Masahiro Yamada
[off-list ref] wrote:
quoted
BTW, I notice another issue.

If we move clang settings before including arch Makefile,
"ifneq ($(CROSS_COMPILE),)" comes early.

Some arch Makefiles (arch/mips/Makefile, arch/blackfin/Makefile, etc.)
set CROSS_COMPILE there if CROSS_COMPILE is not given.

Then, we have a conflict between two requirements among arch.

[1] arm64, powerpc use ld-option in their Makefile.
    So, clang flags must be set before inc. arch Makefile.
[2] mips, blackfin, etc. may set CROSS_COMPILE in their Makefile.
    So, we want to reference CROSS_COMPILE only after inc. arch Makefile

I have no idea how to solve it.

At this moment, I guess clang is intended to support
only limited architectures.

It might be OK to be compromised here.
I definitely find it curious that certain arch's define CROSS_COMPILE
themselves.  The benefit is one less argument to supply at compile
time, but it assumes that the toolchain always has a certain prefix.
This makes sense to me when cross compiling, but seems odd when
compiling natively on that arch as the host and target.  Maybe those
arch's use that convention, or simply are always cross compiled for?

Taking a survey of all arch's currently in the kernel via `cd arch; ag
CROSS_COMPILE` and quickly eyeballing the result:

m68k if not set
And inside "ifneq ($(SUBARCH),$(ARCH))", so the prefix is not used for
native compilation.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help