linux-brain/arch/m68k
Finn Thain 1255e28103 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 14:35:21 +01:00
..
68000 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
amiga License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
apollo License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atari m68k/atari: Modernize printing of kernel messages 2017-02-12 10:36:49 +01:00
bvme6000 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
coldfire m68k: set dma and coherent masks for platform FEC ethernets 2018-05-30 07:52:27 +02:00
configs m68k/defconfig: Update defconfigs for v4.13-rc1 2017-08-21 11:52:20 +02: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 m68k: fix "bad page state" oops on ColdFire boot 2018-08-24 13:09:11 +02:00
kernel m68k: add missing SOFTIRQENTRY_TEXT linker section 2018-02-25 11:07:58 +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: Fix SWIM memory resource end address 2018-07-03 11:24:46 +02:00
math-emu m68k: Assorted spelling fixes 2016-07-03 14:05:28 +02:00
mm m68k/mm: Adjust VM area to be unmapped by gap size for __iounmap() 2018-07-03 11:24:46 +02:00
mvme16x License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mvme147 m68k/mvme147: Modernize printing of kernel messages 2017-02-12 10:36:50 +01:00
q40 m68k/q40: Modernize printing of kernel messages 2017-02-12 10:36:51 +01:00
sun3 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sun3x License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01: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
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig.bus License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig.cpu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig.debug License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01: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 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile m68k: Add -ffreestanding to CFLAGS 2019-03-23 14:35:21 +01:00
install.sh kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00