Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/mk Turn off -mpltseq for kernel modules on powerpc for...



details:   https://anonhg.NetBSD.org/src/rev/05d2dfe2f487
branches:  trunk
changeset: 954744:05d2dfe2f487
user:      rin <rin%NetBSD.org@localhost>
date:      Thu Sep 10 02:34:13 2020 +0000

description:
Turn off -mpltseq for kernel modules on powerpc for GCC >= 9.

Otherwise, object files compiled with -mlongcall contain relocation types
referring PLT, which our in-kernel linker cannot handle.

This ends up with failure in kernel module load with
``kobj_reloc: unexpected relocation type 31'' (31 == R_PPC_PLT16_HA here).

See descriptions for -mlongcall in gcc(1) of GCC9 for more details.

diffstat:

 share/mk/bsd.kmodule.mk |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r cacc7d6315bf -r 05d2dfe2f487 share/mk/bsd.kmodule.mk
--- a/share/mk/bsd.kmodule.mk   Thu Sep 10 02:12:57 2020 +0000
+++ b/share/mk/bsd.kmodule.mk   Thu Sep 10 02:34:13 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.kmodule.mk,v 1.70 2020/09/06 07:20:28 mrg Exp $
+#      $NetBSD: bsd.kmodule.mk,v 1.71 2020/09/10 02:34:13 rin Exp $
 
 # We are not building this with PIE
 MKPIE=no
@@ -51,6 +51,7 @@
 CFLAGS+=       -mlong-calls -mno-space-regs -mfast-indirect-calls
 .elif ${MACHINE_CPU} == "powerpc"
 CFLAGS+=       ${${ACTIVE_CC} == "gcc":? -mlongcall :}
+CFLAGS+=       ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -mno-pltseq :}
 .elif ${MACHINE_CPU} == "vax"
 CFLAGS+=       -fno-pic
 .elif ${MACHINE_CPU} == "riscv"



Home | Main Index | Thread Index | Old Index