From owner-svn-src-head@freebsd.org Fri Jan 6 23:30:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 039C1CA2D10; Fri, 6 Jan 2017 23:30:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0C67181A; Fri, 6 Jan 2017 23:30:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v06NUsnA048530; Fri, 6 Jan 2017 23:30:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v06NUs1p048525; Fri, 6 Jan 2017 23:30:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701062330.v06NUs1p048525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 6 Jan 2017 23:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311567 - in head: . gnu/lib/libgcc gnu/usr.bin/binutils/ld sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2017 23:30:56 -0000 Author: jhb Date: Fri Jan 6 23:30:54 2017 New Revision: 311567 URL: https://svnweb.freebsd.org/changeset/base/311567 Log: Enable /usr/lib32 for o32 binaries on mips64. Build and install an o32 set of libraries on mips64 suitable for running o32 binaries via COMPAT_FREEBSD32. Enable COMPAT_FREEBSD32 in MALTA64. Reviewed by: jmallett, imp Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D9032 Modified: head/Makefile.inc1 head/Makefile.libcompat head/gnu/lib/libgcc/Makefile head/gnu/usr.bin/binutils/ld/Makefile.mips head/sys/mips/conf/MALTA64 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 6 23:20:59 2017 (r311566) +++ head/Makefile.inc1 Fri Jan 6 23:30:54 2017 (r311567) @@ -606,7 +606,7 @@ XCFLAGS+= ${BFLAGS} .endif .if ${MK_LIB32} != "no" && (${TARGET_ARCH} == "amd64" || \ - ${TARGET_ARCH} == "powerpc64") + ${TARGET_ARCH} == "powerpc64") || ${TARGET_ARCH:Mmips64*} != "" LIBCOMPAT= 32 .include "Makefile.libcompat" .elif ${MK_LIBSOFT} != "no" && ${TARGET_ARCH} == "armv6" Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Fri Jan 6 23:20:59 2017 (r311566) +++ head/Makefile.libcompat Fri Jan 6 23:30:54 2017 (r311567) @@ -4,8 +4,7 @@ __<${_this:T}>__: # Makefile for the compatibility libraries. -# - 32-bit compat libraries on PowerPC and AMD64. -# could also be for mips, but that doesn't work today. +# - 32-bit compat libraries on MIPS, PowerPC, and AMD64. # ------------------------------------------------------------------- # 32 bit world @@ -34,6 +33,21 @@ LIB32WMAKEENV= MACHINE=powerpc MACHINE_A LIB32WMAKEFLAGS= \ LD="${XLD} -m elf32ppc_fbsd" \ OBJCOPY="${XOBJCOPY}" + +.elif ${TARGET_ARCH:Mmips64*} != "" +.if empty(TARGET_CPUTYPE) +LIB32CPUFLAGS= -march=mips3 +.else +LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} +.endif +LIB32CPUFLAGS+= -mabi=32 +LIB32WMAKEENV= MACHINE=mips MACHINE_ARCH=mips +.if ${TARGET_ARCH:Mmips64el*} != "" +LIB32WMAKEFLAGS= LD="${XLD} -m elf32ltsmip_fbsd" +.else +LIB32WMAKEFLAGS= LD="${XLD} -m elf32btsmip_fbsd" +.endif +LIB32WMAKEFLAGS+= OBJCOPY="${XOBJCOPY}" .endif Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Fri Jan 6 23:20:59 2017 (r311566) +++ head/gnu/lib/libgcc/Makefile Fri Jan 6 23:30:54 2017 (r311567) @@ -133,7 +133,8 @@ LIBADD+= compiler_rt .if ${TARGET_CPUARCH} == mips LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c # ABIs other than o32 need this -.if ${TARGET_ARCH:Mmips64*} != "" || ${TARGET_ARCH:Mmipsn32*} != "" +.if (${TARGET_ARCH:Mmips64*} != "" || ${TARGET_ARCH:Mmipsn32*} != "") && \ + !defined(COMPAT_32BIT) LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c Modified: head/gnu/usr.bin/binutils/ld/Makefile.mips ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile.mips Fri Jan 6 23:20:59 2017 (r311566) +++ head/gnu/usr.bin/binutils/ld/Makefile.mips Fri Jan 6 23:30:54 2017 (r311567) @@ -8,6 +8,7 @@ _EMULATION_ENDIAN=b .if ${TARGET_ARCH:Mmips64*} != "" NATIVE_EMULATION=elf64${_EMULATION_ENDIAN}tsmip_fbsd +LIBSEARCHPATH.elf32${_EMULATION_ENDIAN}tsmip_fbsd=\"=/usr/lib32\" .elif ${TARGET_ARCH:Mmipsn32*} != "" NATIVE_EMULATION=elf32${_EMULATION_ENDIAN}tsmipn32_fbsd .else Modified: head/sys/mips/conf/MALTA64 ============================================================================== --- head/sys/mips/conf/MALTA64 Fri Jan 6 23:20:59 2017 (r311566) +++ head/sys/mips/conf/MALTA64 Fri Jan 6 23:30:54 2017 (r311567) @@ -11,3 +11,5 @@ machine mips mips64 makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" makeoptions KERNLOADADDR=0xffffffff80100000 + +options COMPAT_FREEBSD32 # Compatible with o32 binaries