* [PATCH 1/3] KVM: powerpc: remove -I. header search paths
2019-01-11 3:22 [PATCH 0/3] powerpc: some header search path cleanups Masahiro Yamada
@ 2019-01-11 3:22 ` Masahiro Yamada
2019-01-24 3:40 ` [1/3] " Michael Ellerman
2019-01-11 3:22 ` [PATCH 2/3] powerpc: remove redundant header search path additions Masahiro Yamada
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2019-01-11 3:22 UTC (permalink / raw)
To: linux-kbuild, linuxppc-dev, Michael Ellerman
Cc: Masahiro Yamada, linux-kernel, kvm-ppc
The header search path -I. in kernel Makefiles is very suspicious;
it allows the compiler to search for headers in the top of $(srctree),
where obviously no header file exists.
Commit 46f43c6ee022 ("KVM: powerpc: convert marker probes to event
trace") first added these options, but they are completely useless.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/powerpc/kvm/Makefile | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
index 64f1135..3223aec 100644
--- a/arch/powerpc/kvm/Makefile
+++ b/arch/powerpc/kvm/Makefile
@@ -10,11 +10,6 @@ common-objs-y = $(KVM)/kvm_main.o $(KVM)/eventfd.o
common-objs-$(CONFIG_KVM_VFIO) += $(KVM)/vfio.o
common-objs-$(CONFIG_KVM_MMIO) += $(KVM)/coalesced_mmio.o
-CFLAGS_e500_mmu.o := -I.
-CFLAGS_e500_mmu_host.o := -I.
-CFLAGS_emulate.o := -I.
-CFLAGS_emulate_loadstore.o := -I.
-
common-objs-y += powerpc.o emulate_loadstore.o
obj-$(CONFIG_KVM_EXIT_TIMING) += timing.o
obj-$(CONFIG_KVM_BOOK3S_HANDLER) += book3s_exports.o
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [1/3] KVM: powerpc: remove -I. header search paths
2019-01-11 3:22 ` [PATCH 1/3] KVM: powerpc: remove -I. header search paths Masahiro Yamada
@ 2019-01-24 3:40 ` Michael Ellerman
0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2019-01-24 3:40 UTC (permalink / raw)
To: Masahiro Yamada, linux-kbuild, linuxppc-dev
Cc: Masahiro Yamada, linux-kernel, kvm-ppc
On Fri, 2019-01-11 at 03:22:31 UTC, Masahiro Yamada wrote:
> The header search path -I. in kernel Makefiles is very suspicious;
> it allows the compiler to search for headers in the top of $(srctree),
> where obviously no header file exists.
>
> Commit 46f43c6ee022 ("KVM: powerpc: convert marker probes to event
> trace") first added these options, but they are completely useless.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/c142e9741e61577c45f2441214c999f2
cheers
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/3] powerpc: remove redundant header search path additions
2019-01-11 3:22 [PATCH 0/3] powerpc: some header search path cleanups Masahiro Yamada
2019-01-11 3:22 ` [PATCH 1/3] KVM: powerpc: remove -I. header search paths Masahiro Yamada
@ 2019-01-11 3:22 ` Masahiro Yamada
2019-01-11 3:22 ` [PATCH 3/3] powerpc: math-emu: remove unneeded header search paths Masahiro Yamada
2019-01-18 2:50 ` [PATCH 0/3] powerpc: some header search path cleanups Masahiro Yamada
3 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2019-01-11 3:22 UTC (permalink / raw)
To: linux-kbuild, linuxppc-dev, Michael Ellerman
Cc: Masahiro Yamada, Paul Mackerras, linux-kernel
The same path -Iarch/$(ARCH) is passed to KBUILD_CPPFLAGS,
KBUILD_AFLAGS, and KBUILD_CFLAGS.
As you see in scripts/Makefile.lib, KBUILD_CPPFLAGS is passed
to c_flags and a_flags as well.
Passing it to KBUILD_CPPFLAGS is enough.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/powerpc/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 488c9ed..ac03334 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -213,9 +213,9 @@ endif
asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1)
KBUILD_CPPFLAGS += -Iarch/$(ARCH) $(asinstr)
-KBUILD_AFLAGS += -Iarch/$(ARCH) $(AFLAGS-y)
+KBUILD_AFLAGS += $(AFLAGS-y)
KBUILD_CFLAGS += $(call cc-option,-msoft-float)
-KBUILD_CFLAGS += -pipe -Iarch/$(ARCH) $(CFLAGS-y)
+KBUILD_CFLAGS += -pipe $(CFLAGS-y)
CPP = $(CC) -E $(KBUILD_CFLAGS)
CHECKFLAGS += -m$(BITS) -D__powerpc__ -D__powerpc$(BITS)__
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] powerpc: math-emu: remove unneeded header search paths
2019-01-11 3:22 [PATCH 0/3] powerpc: some header search path cleanups Masahiro Yamada
2019-01-11 3:22 ` [PATCH 1/3] KVM: powerpc: remove -I. header search paths Masahiro Yamada
2019-01-11 3:22 ` [PATCH 2/3] powerpc: remove redundant header search path additions Masahiro Yamada
@ 2019-01-11 3:22 ` Masahiro Yamada
2019-01-18 2:50 ` [PATCH 0/3] powerpc: some header search path cleanups Masahiro Yamada
3 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2019-01-11 3:22 UTC (permalink / raw)
To: linux-kbuild, linuxppc-dev, Michael Ellerman
Cc: Masahiro Yamada, Paul Mackerras, linux-kernel
The header search path -I. in kernel Makefiles is very suspicious;
it allows the compiler to search for headers in the top of $(srctree),
where obviously no header file exists.
-Iinclude/math-emu seems unnecessary because all files include headers
in the form of #include <math-emu/...>.
I was able to build without these header search paths.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/powerpc/math-emu/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/math-emu/Makefile b/arch/powerpc/math-emu/Makefile
index 494df26..a879403 100644
--- a/arch/powerpc/math-emu/Makefile
+++ b/arch/powerpc/math-emu/Makefile
@@ -17,4 +17,4 @@ obj-$(CONFIG_SPE) += math_efp.o
CFLAGS_fabs.o = -fno-builtin-fabs
CFLAGS_math.o = -fno-builtin-fabs
-ccflags-y = -I. -Iinclude/math-emu -w
+ccflags-y = -w
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] powerpc: some header search path cleanups
2019-01-11 3:22 [PATCH 0/3] powerpc: some header search path cleanups Masahiro Yamada
` (2 preceding siblings ...)
2019-01-11 3:22 ` [PATCH 3/3] powerpc: math-emu: remove unneeded header search paths Masahiro Yamada
@ 2019-01-18 2:50 ` Masahiro Yamada
3 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2019-01-18 2:50 UTC (permalink / raw)
To: linuxppc-dev, Michael Ellerman
Cc: Linux Kbuild mailing list, Linux Kernel Mailing List, kvm-ppc,
Paul Mackerras
Hi Michael,
On Fri, Jan 11, 2019 at 2:20 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> I am trying to get rid of crappy magic from Kbuild core makefiles.
>
> Before that, I want to drop as many useless paths as possible.
> Actually, many Makefiles are adding around pointless options.
>
> This series cleans some powerpc Makefiles.
> (only compile-tested by 0day bot)
Could you apply this series to ppc tree if you are fine with it?
> Masahiro Yamada (3):
> KVM: powerpc: remove -I. header search paths
> powerpc: remove redundant header search path additions
> powerpc: math-emu: remove unneeded header search paths
>
> arch/powerpc/Makefile | 4 ++--
> arch/powerpc/kvm/Makefile | 5 -----
> arch/powerpc/math-emu/Makefile | 2 +-
> 3 files changed, 3 insertions(+), 8 deletions(-)
>
> --
> 2.7.4
>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 6+ messages in thread