From 64a3ba61a5eaf78f7fd0921d1d03c26868c7b1a8 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 3 Jan 2020 23:31:38 +0000 Subject: [PATCH] Set correct lib32 MACHINE_ARCH for mips64el*. Use "mipsel" instead of "mips" as the 32-bit MACHINE_ARCH when building lib32 for little-endian 64-bit MIPS targets. This fixes an error where some objects were compiled as LE and others compiled as BE causing a link error for rtld32. Reviewed by: emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23028 --- share/mk/bsd.compat.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/mk/bsd.compat.mk b/share/mk/bsd.compat.mk index 2209829e8e1f..0f3a2421b040 100644 --- a/share/mk/bsd.compat.mk +++ b/share/mk/bsd.compat.mk @@ -79,10 +79,11 @@ LIB32CPUFLAGS= -target mips-unknown-freebsd13.0 .endif LIB32CPUFLAGS+= -mabi=32 LIB32_MACHINE= mips -LIB32_MACHINE_ARCH= mips .if ${COMPAT_ARCH:Mmips64el*} != "" +LIB32_MACHINE_ARCH= mipsel _EMULATION= elf32ltsmip_fbsd .else +LIB32_MACHINE_ARCH= mips _EMULATION= elf32btsmip_fbsd .endif LIB32WMAKEFLAGS= LD="${XLD} -m ${_EMULATION}"