Mon Mar 29 05:22:50 2021 UTC ()
On MIPS if we compile C files as N64, compile assembly with the same ABI.


(simonb)
diff -r1.75 -r1.76 src/share/mk/bsd.kmodule.mk

cvs diff -r1.75 -r1.76 src/share/mk/bsd.kmodule.mk (expand / switch to unified diff)

--- src/share/mk/bsd.kmodule.mk 2021/03/23 13:22:40 1.75
+++ src/share/mk/bsd.kmodule.mk 2021/03/29 05:22:49 1.76
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: bsd.kmodule.mk,v 1.75 2021/03/23 13:22:40 simonb Exp $ 1# $NetBSD: bsd.kmodule.mk,v 1.76 2021/03/29 05:22:49 simonb Exp $
2 2
3# We are not building this with PIE 3# We are not building this with PIE
4MKPIE=no 4MKPIE=no
5 5
6.include <bsd.init.mk> 6.include <bsd.init.mk>
7.include <bsd.klinks.mk> 7.include <bsd.klinks.mk>
8 8
9.if ${MKCTF:Uno} == "yes" 9.if ${MKCTF:Uno} == "yes"
10CFLAGS+= -g 10CFLAGS+= -g
11# Only need symbols for ctf, strip them after converting to CTF 11# Only need symbols for ctf, strip them after converting to CTF
12CTFFLAGS= -L VERSION 12CTFFLAGS= -L VERSION
13CTFMFLAGS= -t -L VERSION 13CTFMFLAGS= -t -L VERSION
14# Keep symbols if built with "-g" 14# Keep symbols if built with "-g"
@@ -47,29 +47,31 @@ CFLAGS+= -march=armv8-a+nofp+nosimd @@ -47,29 +47,31 @@ CFLAGS+= -march=armv8-a+nofp+nosimd
47.elif ${MACHINE_CPU} == "arm" 47.elif ${MACHINE_CPU} == "arm"
48CFLAGS+= -fno-common -fno-unwind-tables 48CFLAGS+= -fno-common -fno-unwind-tables
49.elif ${MACHINE_CPU} == "hppa" 49.elif ${MACHINE_CPU} == "hppa"
50CFLAGS+= -mlong-calls -mno-space-regs -mfast-indirect-calls 50CFLAGS+= -mlong-calls -mno-space-regs -mfast-indirect-calls
51.elif ${MACHINE_CPU} == "powerpc" 51.elif ${MACHINE_CPU} == "powerpc"
52CFLAGS+= ${${ACTIVE_CC} == "gcc":? -mlongcall :} 52CFLAGS+= ${${ACTIVE_CC} == "gcc":? -mlongcall :}
53CFLAGS+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -mno-pltseq :} 53CFLAGS+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -mno-pltseq :}
54.elif ${MACHINE_CPU} == "vax" 54.elif ${MACHINE_CPU} == "vax"
55CFLAGS+= -fno-pic 55CFLAGS+= -fno-pic
56.elif ${MACHINE_CPU} == "riscv" 56.elif ${MACHINE_CPU} == "riscv"
57CFLAGS+= -fPIC -Wa,-fno-pic 57CFLAGS+= -fPIC -Wa,-fno-pic
58.elif ${MACHINE_ARCH} == "mips64eb" && !defined(BSD_MK_COMPAT_FILE) 58.elif ${MACHINE_ARCH} == "mips64eb" && !defined(BSD_MK_COMPAT_FILE)
59CFLAGS+= -mabi=64 59CFLAGS+= -mabi=64
 60AFLAGS+= -mabi=64
60LDFLAGS+= -Wl,-m,elf64btsmip 61LDFLAGS+= -Wl,-m,elf64btsmip
61.elif ${MACHINE_ARCH} == "mips64el" && !defined(BSD_MK_COMPAT_FILE) 62.elif ${MACHINE_ARCH} == "mips64el" && !defined(BSD_MK_COMPAT_FILE)
62CFLAGS+= -mabi=64 63CFLAGS+= -mabi=64
 64AFLAGS+= -mabi=64
63LDFLAGS+= -Wl,-m,elf64ltsmip 65LDFLAGS+= -Wl,-m,elf64ltsmip
64.endif 66.endif
65 67
66.if ${MACHINE_CPU} == "mips" 68.if ${MACHINE_CPU} == "mips"
67# We can't use -msym32 with -mlong-calls as -msym32 forces all addresses 69# We can't use -msym32 with -mlong-calls as -msym32 forces all addresses
68# to be 32-bit which defeats the whole purpose of long calls. 70# to be 32-bit which defeats the whole purpose of long calls.
69CFLAGS+= -mlong-calls 71CFLAGS+= -mlong-calls
70.endif 72.endif
71 73
72.if ${MACHINE_CPU} == "sparc64" 74.if ${MACHINE_CPU} == "sparc64"
73# force same memory model as rest of the kernel 75# force same memory model as rest of the kernel
74CFLAGS+= ${${ACTIVE_CC} == "gcc":? -mcmodel=medlow :} 76CFLAGS+= ${${ACTIVE_CC} == "gcc":? -mcmodel=medlow :}
75CFLAGS+= ${${ACTIVE_CC} == "clang":? -mcmodel=small :} 77CFLAGS+= ${${ACTIVE_CC} == "clang":? -mcmodel=small :}