linux/arch/arm
Masahiro Yamada 15d5761ad3 kbuild: introduce ccflags-remove-y and asflags-remove-y
CFLAGS_REMOVE_<file>.o filters out flags when compiling a particular
object, but there is no convenient way to do that for every object in
a directory.

Add ccflags-remove-y and asflags-remove-y to make it easily.

Use ccflags-remove-y to clean up some Makefiles.

The add/remove order works as follows:

 [1] KBUILD_CFLAGS specifies compiler flags used globally

 [2] ccflags-y adds compiler flags for all objects in the
     current Makefile

 [3] ccflags-remove-y removes compiler flags for all objects in the
     current Makefile (New feature)

 [4] CFLAGS_<file> adds compiler flags per file.

 [5] CFLAGS_REMOVE_<file> removes compiler flags per file.

Having [3] before [4] allows us to remove flags from most (but not all)
objects in the current Makefile.

For example, kernel/trace/Makefile removes $(CC_FLAGS_FTRACE)
from all objects in the directory, then adds it back to
trace_selftest_dynamic.o and CFLAGS_trace_kprobe_selftest.o

The same applies to lib/livepatch/Makefile.

Please note ccflags-remove-y has no effect to the sub-directories.
In contrast, the previous notation got rid of compiler flags also from
all the sub-directories.

The following are not affected because they have no sub-directories:

  arch/arm/boot/compressed/
  arch/powerpc/xmon/
  arch/sh/
  kernel/trace/

However, lib/ has several sub-directories.

To keep the behavior, I added ccflags-remove-y to all Makefiles
in subdirectories of lib/, except the following:

  lib/vdso/Makefile        - Kbuild does not descend into this Makefile
  lib/raid/test/Makefile   - This is not used for the kernel build

I think commit 2464a609de ("ftrace: do not trace library functions")
excluded too much. In the next commit, I will remove ccflags-remove-y
from the sub-directories of lib/.

Suggested-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Acked-by: Brendan Higgins <brendanhiggins@google.com> (KUnit)
Tested-by: Anders Roxell <anders.roxell@linaro.org>
2020-08-10 01:32:59 +09:00
..
boot kbuild: introduce ccflags-remove-y and asflags-remove-y 2020-08-10 01:32:59 +09:00
common
configs ARM: defconfig updates fopr 5.8 2020-06-04 19:54:15 -07:00
crypto Merge branch 'rwonce/rework' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux 2020-06-10 14:46:54 -07:00
include efi/libstub: arm: Print CPU boot mode and MMU state at boot 2020-06-17 15:29:11 +02:00
kernel maccess: make get_kernel_nofault() check for minimal type compatibility 2020-06-18 12:10:37 -07:00
lib mmap locking API: use coccinelle to convert mmap_sem rwsem call sites 2020-06-09 09:39:14 -07:00
mach-actions ARM: actions: Drop unneeded select of COMMON_CLK 2020-05-15 23:27:37 +02:00
mach-alpine ARM: alpine: Drop unneeded select of HAVE_SMP 2020-05-15 23:27:37 +02:00
mach-artpec
mach-asm9260 ARM: asm9260: Drop unneeded select of GENERIC_CLOCKEVENTS 2020-05-15 23:27:37 +02:00
mach-aspeed ARM: aspeed: Drop unneeded select of HAVE_SMP 2020-05-15 23:27:37 +02:00
mach-at91
mach-axxia
mach-bcm ARM: bcm: Select ARM_TIMER_SP804 for ARCH_BCM_NSP 2020-06-14 15:09:49 -07:00
mach-berlin ARM: berlin: Drop unneeded select of HAVE_SMP 2020-05-15 23:27:37 +02:00
mach-clps711x ARM: clps711x: Drop unneeded select of multi-platform selected options 2020-05-15 23:27:37 +02:00
mach-cns3xxx
mach-davinci ARM: davinci: fix build failure without I2C 2020-05-28 12:35:00 +02:00
mach-digicolor
mach-dove
mach-ebsa110 mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
mach-efm32
mach-ep93xx
mach-exynos
mach-footbridge treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
mach-gemini
mach-highbank
mach-hisi
mach-imx ARM: imx6: add missing put_device() call in imx6q_suspend_init() 2020-06-24 09:25:39 +08:00
mach-integrator mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
mach-iop32x mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
mach-ixp4xx mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
mach-keystone mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson
mach-milbeaut
mach-mmp This time around we have 4 lines of diff in the core framework, removing a 2020-06-10 11:42:19 -07:00
mach-moxart
mach-mv78xx0
mach-mvebu ARM: mvebu: Drop unneeded select of HAVE_SMP 2020-05-15 23:27:38 +02:00
mach-mxs
mach-nomadik
mach-npcm
mach-nspire
mach-omap1
mach-omap2 Fixes for omaps for v5.8 2020-06-28 14:41:55 +02:00
mach-orion5x
mach-oxnas
mach-picoxcell
mach-prima2 ARM: prima2: Drop unneeded select of HAVE_SMP 2020-05-15 23:27:38 +02:00
mach-pxa ARM: pxa: remove Compulab pxa2xx boards 2020-05-26 00:10:57 +02:00
mach-qcom
mach-rda
mach-realtek
mach-realview VExpress modularization 2020-05-15 23:04:40 +02:00
mach-rockchip
mach-rpc
mach-s3c24xx
mach-s3c64xx
mach-s5pv210
mach-sa1100 mm: pgtable: add shortcuts for accessing kernel PMD and PTE 2020-06-09 09:39:13 -07:00
mach-shmobile
mach-socfpga ARM: socfpga: Drop unneeded select of PCI_DOMAINS_GENERIC 2020-05-15 23:27:38 +02:00
mach-spear
mach-sti Revert "ARM: sti: Implement dummy L2 cache's write_sec" 2020-06-28 14:46:54 +02:00
mach-stm32
mach-sunxi
mach-tango
mach-tegra mm: introduce include/linux/pgtable.h 2020-06-09 09:39:13 -07:00
mach-u300
mach-uniphier
mach-ux500
mach-versatile VExpress modularization 2020-05-15 23:04:40 +02:00
mach-vexpress Revert "ARM: vexpress: Don't select VEXPRESS_CONFIG" 2020-05-28 12:30:33 +02:00
mach-vt8500
mach-zx
mach-zynq mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
mm maccess: rename probe_kernel_address to get_kernel_nofault 2020-06-18 11:14:40 -07:00
net
nwfpe
oprofile
plat-omap
plat-orion
plat-pxa
plat-samsung
plat-versatile
probes
tools
vdso
vfp
xen arm/xen: remove the unused macro GRANT_TABLE_PHYSADDR 2020-06-29 16:16:06 -07:00
Kconfig Kbuild updates for v5.8 (2nd) 2020-06-13 13:29:16 -07:00
Kconfig-nommu
Kconfig.debug treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile Kbuild updates for v5.8 2020-06-06 12:00:25 -07:00