kernel_optimize_test/arch/m68k
Finn Thain 28713169d8 m68k: Add -ffreestanding to CFLAGS
This patch fixes a build failure when using GCC 8.1:

/usr/bin/ld: block/partitions/ldm.o: in function `ldm_parse_tocblock':
block/partitions/ldm.c:153: undefined reference to `strcmp'

This is caused by a new optimization which effectively replaces a
strncmp() call with a strcmp() call. This affects a number of strncmp()
call sites in the kernel.

The entire class of optimizations is avoided with -fno-builtin, which
gets enabled by -ffreestanding. This may avoid possible future build
failures in case new optimizations appear in future compilers.

I haven't done any performance measurements with this patch but I did
count the function calls in a defconfig build. For example, there are now
23 more sprintf() calls and 39 fewer strcpy() calls. The effect on the
other libc functions is smaller.

If this harms performance we can tackle that regression by optimizing
the call sites, ideally using semantic patches. That way, clang and ICC
builds might benfit too.

Cc: stable@vger.kernel.org
Reference: https://marc.info/?l=linux-m68k&m=154514816222244&w=2
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2019-01-21 10:36:53 +01:00
..
68000 m68k: Fix off-by-one calendar month 2018-05-22 10:31:50 +02:00
amiga
apollo m68k/apollo: Fix comment in Makefile 2019-01-21 10:36:53 +01:00
atari m68k/atari: Avoid VLA use in atari_switches_setup() 2019-01-21 10:36:53 +01:00
bvme6000 m68k: Remove unused set_clock_mmss() helpers 2018-07-29 10:48:18 +02:00
coldfire mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
configs m68k/defconfig: Update defconfigs for v5.0-rc1 2019-01-21 10:36:53 +01:00
emu m68k updates for v4.20 2018-10-29 09:02:15 -07:00
fpsp040
hp300
ifpsp060
include m68k/mac: Clean up unused timer definitions 2019-01-21 10:36:53 +01:00
kernel m68k: Avoid VLA use in mangle_kernel_stack() 2019-01-21 10:36:53 +01:00
lib
mac m68k/mac: Use '030 reset method on SE/30 2019-01-21 10:36:53 +01:00
math-emu
mm m68k fixes for 4.20 2018-12-20 07:35:16 -08:00
mvme16x m68k: Remove unused set_clock_mmss() helpers 2018-07-29 10:48:18 +02:00
mvme147 m68k: Remove unused set_clock_mmss() helpers 2018-07-29 10:48:18 +02:00
q40 m68k: Remove unused set_clock_mmss() helpers 2018-07-29 10:48:18 +02:00
sun3 memblock: stop using implicit alignment to SMP_CACHE_BYTES 2018-10-31 08:54:16 -07:00
sun3x mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
tools/amiga
install.sh
Kconfig Kconfig updates for v4.21 2018-12-29 13:03:29 -08:00
Kconfig.bus pcmcia: allow PCMCIA support independent of the architecture 2018-11-23 11:46:00 +09:00
Kconfig.cpu PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Kconfig.devices
Kconfig.machine m68k: Remove redundant 'default n' from Kconfig 2018-12-03 13:05:42 +01:00
Makefile m68k: Add -ffreestanding to CFLAGS 2019-01-21 10:36:53 +01:00