linux-brain/arch/m68k
Finn Thain 9cfc01bb17 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 13:19:47 +01:00
..
68000 m68k: Use vsprintf %pM extension 2015-06-16 16:45:38 +10:00
amiga m68k: Use IS_ENABLED() instead of checking for built-in or module 2016-09-19 11:29:45 +02:00
apollo char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
atari m68k: Use IS_ENABLED() instead of checking for built-in or module 2016-09-19 11:29:45 +02:00
bvme6000 char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
coldfire m68k: set dma and coherent masks for platform FEC ethernets 2018-05-30 07:50:43 +02:00
configs m68k/defconfig: Update defconfigs for v4.9-rc1 2016-10-30 10:13:19 +01:00
emu block: change ->make_request_fn() and users to return a queue cookie 2015-11-07 10:40:46 -07:00
fpsp040 Fix common misspellings 2011-03-31 11:26:23 -03:00
hp300 char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
ifpsp060 m68k: Assorted spelling fixes 2016-07-03 14:05:28 +02:00
include m68k: fix "bad page state" oops on ColdFire boot 2018-08-24 13:12:34 +02:00
kernel m68k: add missing SOFTIRQENTRY_TEXT linker section 2018-02-25 11:05:47 +01:00
lib m68k: move exports to definitions 2016-08-07 23:47:19 -04:00
mac m68k: Use IS_ENABLED() instead of checking for built-in or module 2016-09-19 11:29:45 +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:23:05 +02:00
mvme16x char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
mvme147 char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
q40 m68k: Use IS_ENABLED() instead of checking for built-in or module 2016-09-19 11:29:45 +02:00
sun3 char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
sun3x char/genrtc: remove m68k support 2016-06-04 00:23:28 +02:00
tools/amiga Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
Kconfig m68k: move CONFIG_FPU set to per-CPU configuration 2016-09-26 12:02:58 +10:00
Kconfig.bus m68k/atari: ROM port ISA adapter support 2013-04-16 21:08:11 +02:00
Kconfig.cpu m68k: move CONFIG_FPU set to per-CPU configuration 2016-09-26 12:02:58 +10:00
Kconfig.debug m68knommu: remove obsolete 68360 support 2016-03-07 10:07:17 +10:00
Kconfig.devices Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k 2014-10-08 05:40:17 -04:00
Kconfig.machine m68knommu: remove obsolete 68360 support 2016-03-07 10:07:17 +10:00
Makefile m68k: Add -ffreestanding to CFLAGS 2019-03-23 13:19:47 +01:00
install.sh kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00