android_kernel_oneplus_msm8998/arch/mips/lib
Paul Burton bb190acea8 MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7
commit 690d9163bf4b8563a2682e619f938e6a0443947f upstream.

Some versions of GCC suboptimally generate calls to the __multi3()
intrinsic for MIPS64r6 builds, resulting in link failures due to the
missing function:

    LD      vmlinux.o
    MODPOST vmlinux.o
  kernel/bpf/verifier.o: In function `kmalloc_array':
  include/linux/slab.h:631: undefined reference to `__multi3'
  fs/select.o: In function `kmalloc_array':
  include/linux/slab.h:631: undefined reference to `__multi3'
  ...

We already have a workaround for this in which we provide the
instrinsic, but we do so selectively for GCC 7 only. Unfortunately the
issue occurs with older GCC versions too - it has been observed with
both GCC 5.4.0 & GCC 6.4.0.

MIPSr6 support was introduced in GCC 5, so all major GCC versions prior
to GCC 8 are affected and we extend our workaround accordingly to all
MIPS64r6 builds using GCC versions older than GCC 8.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Reported-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
Fixes: ebabcf17bcd7 ("MIPS: Implement __multi3 for GCC7 MIPS64r6 builds")
Patchwork: https://patchwork.linux-mips.org/patch/20297/
Cc: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: stable@vger.kernel.org # 4.15+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-05 09:18:40 +02:00
..
ashldi3.c MIPS: lib: Mark intrinsics notrace 2016-06-07 18:14:32 -07:00
ashrdi3.c MIPS: lib: Mark intrinsics notrace 2016-06-07 18:14:32 -07:00
bitops.c MIPS: Remove unneeded volatile from arch/mips/lib/bitops.c 2013-05-08 01:19:06 +02:00
bswapdi.c MIPS: lib: Mark intrinsics notrace 2016-06-07 18:14:32 -07:00
bswapsi.c MIPS: lib: Mark intrinsics notrace 2016-06-07 18:14:32 -07:00
cmpdi2.c MIPS: lib: Mark intrinsics notrace 2016-06-07 18:14:32 -07:00
csum_partial.S MIPS: csum_partial: Improve instruction parallelism. 2015-04-01 17:22:11 +02:00
delay.c MIPS: __delay ABI-dependent subtraction simplification 2014-05-30 21:01:08 +02:00
dump_tlb.c MIPS: Rearrange ENTRYLO field definitions 2015-09-03 12:07:48 +02:00
iomap-pci.c mips: use the the PCI controller's io_map_base 2012-01-31 23:20:30 +02:00
iomap.c MIPS: iomap: Use __mem_{read,write}{b,w,l} for MMIO 2014-11-24 07:45:42 +01:00
libgcc.h MIPS: Implement __multi3 for GCC7 MIPS64r6 builds 2018-03-03 10:19:46 +01:00
lshrdi3.c MIPS: lib: Mark intrinsics notrace 2016-06-07 18:14:32 -07:00
Makefile MIPS: Implement __multi3 for GCC7 MIPS64r6 builds 2018-03-03 10:19:46 +01:00
memcpy.S MIPS: lib: memcpy: Add MIPS R6 support 2015-02-17 15:37:29 +00:00
memset.S MIPS: memset.S: Fix clobber of v1 in last_fixup 2018-04-24 09:32:10 +02:00
mips-atomic.c MIPS: asm: irqflags: Add MIPS R6 related definitions 2015-02-17 15:37:20 +00:00
multi3.c MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7 2018-09-05 09:18:40 +02:00
r3k_dump_tlb.c MIPS: Refactor dumping of TLB registers for r3k/r4k 2015-09-03 12:07:45 +02:00
strlen_user.S MIPS: Remove __strlen_user(). 2014-11-24 07:45:00 +01:00
strncpy_user.S MIPS: __strncpy_from_user_asm CPU_DADDI_WORKAROUNDS bug fix 2014-05-13 00:29:38 +02:00
strnlen_user.S MIPS: strnlen_user.S: Fix a CPU_DADDI_WORKAROUNDS regression 2015-05-29 20:23:58 +02:00
ucmpdi2.c MIPS: lib: Mark intrinsics notrace 2016-06-07 18:14:32 -07:00
uncached.c mips: delete non-required instances of include <linux/init.h> 2014-01-24 22:39:56 +01:00