diff --git a/compat/archdirs.mk b/compat/archdirs.mk index 68c0cd12dbe0..d1a6548d8380 100644 --- a/compat/archdirs.mk +++ b/compat/archdirs.mk @@ -1,4 +1,4 @@ -# $NetBSD: archdirs.mk,v 1.12 2019/06/13 21:17:54 christos Exp $ +# $NetBSD: archdirs.mk,v 1.13 2021/04/25 15:18:23 christos Exp $ # list of subdirs used per-platform @@ -14,11 +14,16 @@ ARCHDIR_SUBDIR+= amd64/i386 ARCHDIR_SUBDIR+= arm/oabi .endif -.if (${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el") +.if !empty(MACHINE_ARCH:Mmips64*) ARCHDIR_SUBDIR+= mips64/64 ARCHDIR_SUBDIR+= mips64/o32 .endif +.if !empty(MACHINE_ARCH:Mmipsn64*) +ARCHDIR_SUBDIR+= mips64/n32 +ARCHDIR_SUBDIR+= mips64/o32 +.endif + .if ${MACHINE_ARCH} == "powerpc64" ARCHDIR_SUBDIR+= powerpc64/powerpc .endif diff --git a/compat/mips64/64/bsd.64.mk b/compat/mips64/64/bsd.64.mk index 7560c831c294..bda5cda13179 100644 --- a/compat/mips64/64/bsd.64.mk +++ b/compat/mips64/64/bsd.64.mk @@ -1,6 +1,6 @@ -# $NetBSD: bsd.64.mk,v 1.12 2018/02/06 10:00:00 mrg Exp $ +# $NetBSD: bsd.64.mk,v 1.13 2021/04/25 15:18:23 christos Exp $ -.if ${MACHINE_ARCH} == "mips64eb" +.if !empty(MACHINE_ARCH:M*eb) LD+= -m elf64btsmip .else LD+= -m elf64ltsmip diff --git a/compat/mips64/n32/Makefile b/compat/mips64/n32/Makefile new file mode 100644 index 000000000000..eda8a81ad525 --- /dev/null +++ b/compat/mips64/n32/Makefile @@ -0,0 +1,5 @@ +# $NetBSD: Makefile,v 1.1 2021/04/25 15:18:23 christos Exp $ + +BSD_MK_COMPAT_FILE=${.CURDIR}/bsd.n32.mk + +.include "../../compatsubdir.mk" diff --git a/compat/mips64/n32/bsd.n32.mk b/compat/mips64/n32/bsd.n32.mk new file mode 100644 index 000000000000..eb41e27eb16a --- /dev/null +++ b/compat/mips64/n32/bsd.n32.mk @@ -0,0 +1,23 @@ +# $NetBSD: bsd.n32.mk,v 1.1 2021/04/25 15:18:23 christos Exp $ + +.if !empty(MACHINE_ARCH:M*eb) +LD+= -m elf32btsmipn32 +.else +LD+= -m elf32ltsmipn32 +.endif +.ifndef MLIBDIR +MLIBDIR= n32 + +LIBC_MACHINE_ARCH= ${MACHINE_ARCH:S/mipsn/mips/:S/64//} +LIBGCC_MACHINE_ARCH= ${LIBC_MACHINE_ARCH} +GOMP_MACHINE_ARCH= ${LIBC_MACHINE_ARCH} +XORG_MACHINE_ARCH= ${LIBC_MACHINE_ARCH} + +COPTS+= -mabi=n32 +CPUFLAGS+= -mabi=n32 +LDADD+= -mabi=n32 +LDFLAGS+= -mabi=n32 +MKDEPFLAGS+= -mabi=n32 +.endif + +.include "${.PARSEDIR}/../../Makefile.compat" diff --git a/compat/mips64/o32/bsd.o32.mk b/compat/mips64/o32/bsd.o32.mk index 5a24663bb58e..261a1f107508 100644 --- a/compat/mips64/o32/bsd.o32.mk +++ b/compat/mips64/o32/bsd.o32.mk @@ -1,6 +1,6 @@ -# $NetBSD: bsd.o32.mk,v 1.14 2016/10/07 19:10:37 christos Exp $ +# $NetBSD: bsd.o32.mk,v 1.15 2021/04/25 15:18:23 christos Exp $ -.if ${MACHINE_ARCH} == "mips64eb" +.if !empty(MACHINE_ARCH:M*eb) LD+= -m elf32btsmip .else LD+= -m elf32ltsmip @@ -8,10 +8,10 @@ LD+= -m elf32ltsmip .ifndef MLIBDIR MLIBDIR= o32 -LIBC_MACHINE_ARCH= ${MACHINE_ARCH:S/64//} -LIBGCC_MACHINE_ARCH= ${MACHINE_ARCH:S/64//} -GOMP_MACHINE_ARCH= ${MACHINE_ARCH:S/64//} -XORG_MACHINE_ARCH= ${MACHINE_ARCH:S/64//} +LIBC_MACHINE_ARCH= ${MACHINE_ARCH:S/mipsn/mips/:S/64//} +LIBGCC_MACHINE_ARCH= ${LIBC_MACHINE_ARCH} +GOMP_MACHINE_ARCH= ${LIBC_MACHINE_ARCH} +XORG_MACHINE_ARCH= ${LIBC_MACHINE_ARCH} COPTS+= -mabi=32 -march=mips3 CPUFLAGS+= -mabi=32 -march=mips3