linux-stable/arch/m68k
Finn Thain fcbf12e23d m68k: Add -ffreestanding to CFLAGS
commit 28713169d8 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-23 20:10:00 +01:00
..
68000 m68k: Fix off-by-one calendar month 2018-05-22 10:31:50 +02:00
amiga treewide: Switch DEFINE_TIMER callbacks to struct timer_list * 2017-11-21 15:57:05 -08:00
apollo m68k: Remove unused set_clock_mmss() helpers 2018-07-29 10:48:18 +02:00
atari m68k: Remove unused set_clock_mmss() helpers 2018-07-29 10:48:18 +02:00
bvme6000 m68k: Remove unused set_clock_mmss() helpers 2018-07-29 10:48:18 +02:00
coldfire m68k: coldfire: Normalize clk API 2018-07-30 09:15:01 +10:00
configs crypto: speck - remove Speck 2018-11-13 11:08:46 -08:00
emu net: Remove usage of net_device last_rx member 2017-01-18 17:22:49 -05:00
fpsp040 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hp300 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ifpsp060 scripts/spelling.txt: add regsiter -> register spelling mistake 2017-05-08 17:15:13 -07:00
include mm: make the __PAGETABLE_PxD_FOLDED defines non-empty 2018-12-29 13:37:57 +01:00
kernel m68k: Fix memblock-related crashes 2019-01-13 09:51:02 +01:00
lib License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mac m68k/mac: Use correct PMU response format 2018-08-31 09:33:45 +02:00
math-emu
mm m68k: Fix memblock-related crashes 2019-01-13 09:51:02 +01: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 m68k: switch to MEMBLOCK + NO_BOOTMEM 2018-07-29 10:48:18 +02:00
sun3x m68k: Fix off-by-one calendar month 2018-05-22 10:31:50 +02:00
tools/amiga License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
install.sh
Kconfig Consolidation of Kconfig files by Christoph Hellwig. 2018-08-15 13:05:12 -07:00
Kconfig.bus m68k: allow ColdFire PCI bus on MMU and non-MMU configuration 2018-05-28 09:45:27 +10:00
Kconfig.cpu m68k: allow ColdFire m5441x parts to run with MMU enabled 2017-11-06 08:25:20 +10:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Kconfig.devices License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig.machine m68k: add Sysam stmark2 open board support 2017-11-07 13:27:38 +10:00
Makefile m68k: Add -ffreestanding to CFLAGS 2019-03-23 20:10:00 +01:00