android_kernel_oneplus_msm8998/arch/m68k
Finn Thain 22058c290c m68k: Add -ffreestanding to CFLAGS
commit 28713169d879b67be2ef2f84dcf54905de238294 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 08:44:36 +01:00
..
68000
68360
amiga genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
apollo
atari
bvme6000
coldfire m68k: set dma and coherent masks for platform FEC ethernets 2018-05-30 07:49:09 +02:00
configs m68k/defconfig: Update defconfigs for v4.3-rc1 2015-09-28 10:01:09 +02:00
emu block: change ->make_request_fn() and users to return a queue cookie 2015-11-07 10:40:46 -07:00
fpsp040
hp300
ifpsp060
include m68k: fix "bad page state" oops on ColdFire boot 2018-08-24 13:26:57 +02:00
kernel m68k: Wire up mlock2 2015-11-22 11:35:26 +01:00
lib
mac m68k/mac: Export Peripheral System Controller (PSC) base address to modules 2015-09-29 21:11:13 -07:00
math-emu
mm m68k/mm: Adjust VM area to be unmapped by gap size for __iounmap() 2018-07-03 11:21:26 +02:00
mvme16x
mvme147
q40
sun3 m68k/mm: sun3 - Add missing initialization of max_pfn and {min,max}_low_pfn 2015-11-22 11:35:25 +01:00
sun3x
tools/amiga
install.sh
Kconfig kexec: split kexec_load syscall from kexec core code 2015-09-10 13:29:01 -07:00
Kconfig.bus
Kconfig.cpu m68knommu: make ColdFire SoC selection a choice 2015-07-13 09:34:39 +10:00
Kconfig.debug
Kconfig.devices
Kconfig.machine
Makefile m68k: Add -ffreestanding to CFLAGS 2019-03-23 08:44:36 +01:00