Index: lib/csu/mips/Makefile =================================================================== --- lib/csu/mips/Makefile +++ lib/csu/mips/Makefile @@ -2,6 +2,29 @@ .PATH: ${.CURDIR:H}/common +.include + CFLAGS+= -DCRT_IRELOC_SUPPRESS +.if ${MACHINE_ARCH:Mmips64} +ELFCLASS= 64 +.else +ELFCLASS= 32 +.endif +.if ${MACHINE_ARCH:Mmips*el} +ENDIAN= l +.else +ENDIAN= b +.endif +.if ${MACHINE_ARCH:Mmipsn32*} +SUFFIX= n32 +.else +SUFFIX= +.endif + +.if ${LINKER_TYPE} == "bfd" +# binutils requires an explicit emulation for ld -r +LDFLAGS+= -m elf${ELFCLASS}${ENDIAN}tsmip${SUFFIX}_fbsd +.endif + .include