From owner-svn-src-all@freebsd.org Tue Sep 20 17:07:15 2016 Return-Path: Delivered-To: svn-src-all@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 CB4DDBE23B7; Tue, 20 Sep 2016 17:07:15 +0000 (UTC) (envelope-from emaste@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 95DC819A5; Tue, 20 Sep 2016 17:07:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8KH7Ecr003573; Tue, 20 Sep 2016 17:07:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8KH7E8Z003569; Tue, 20 Sep 2016 17:07:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609201707.u8KH7E8Z003569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Sep 2016 17:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306041 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2016 17:07:15 -0000 Author: emaste Date: Tue Sep 20 17:07:14 2016 New Revision: 306041 URL: https://svnweb.freebsd.org/changeset/base/306041 Log: Always pass -m to ld for converting binary files to kernel ELF objects This is in preparation for linking with LLVM's lld, which does not have a compiled-in default output emulation. lld requires that it is specified via the -m option, or obtained from the object file(s) being linked. This will also allow all build targets to share a common linker binary. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7837 Modified: head/sys/conf/kern.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue Sep 20 16:55:59 2016 (r306040) +++ head/sys/conf/kern.mk Tue Sep 20 17:07:14 2016 (r306041) @@ -244,3 +244,23 @@ CFLAGS+= -std=iso9899:1999 .else # CSTD CFLAGS+= -std=${CSTD} .endif # CSTD + +# Set target-specific linker emulation name. Used by ld -b binary to convert +# binary files into ELF objects. +LD_EMULATION_aarch64=aarch64elf +LD_EMULATION_amd64=elf_x86_64_fbsd +LD_EMULATION_arm=armelf_fbsd +LD_EMULATION_armeb=armelf_fbsd +LD_EMULATION_armv6=armelf_fbsd +LD_EMULATION_i386=elf_i386_fbsd +LD_EMULATION_mips= elf32btsmip_fbsd +LD_EMULATION_mips64= elf64btsmip_fbsd +LD_EMULATION_mipsel= elf32ltsmip_fbsd +LD_EMULATION_mips64el= elf64ltsmip_fbsd +LD_EMULATION_mipsn32= elf32btsmipn32_fbsd +LD_EMULATION_mipsn32el= elf32btsmipn32_fbsd # I don't think this is a thing that works +LD_EMULATION_powerpc= elf32ppc_fbsd +LD_EMULATION_powerpc64= elf64ppc_fbsd +LD_EMULATION_riscv= elf64riscv +LD_EMULATION_sparc64= elf64_sparc_fbsd +LD_EMULATION=${LD_EMULATION_${MACHINE_ARCH}} Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Sep 20 16:55:59 2016 (r306040) +++ head/sys/conf/kern.pre.mk Tue Sep 20 17:07:14 2016 (r306041) @@ -119,7 +119,7 @@ NORMAL_M= ${AWK} -f $S/tools/makeobjops. NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \ - -o ${.TARGET} ${.ALLSRC:M*.fw} + -m ${LD_EMULATION} -o ${.TARGET} ${.ALLSRC:M*.fw} # Common for dtrace / zfs CDDL_CFLAGS= -DFREEBSD_NAMECACHE -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue Sep 20 16:55:59 2016 (r306040) +++ head/sys/conf/kmod.mk Tue Sep 20 17:07:14 2016 (r306041) @@ -171,11 +171,13 @@ ${_firmw:C/\:.*$/.fwo/:T}: ${_firmw:C/\: @${ECHO} ${_firmw:C/\:.*$//} ${.ALLSRC:M*${_firmw:C/\:.*$//}} @if [ -e ${_firmw:C/\:.*$//} ]; then \ ${LD} -b binary --no-warn-mismatch ${_LDFLAGS} \ - -r -d -o ${.TARGET} ${_firmw:C/\:.*$//}; \ + -m ${LD_EMULATION} -r -d \ + -o ${.TARGET} ${_firmw:C/\:.*$//}; \ else \ ln -s ${.ALLSRC:M*${_firmw:C/\:.*$//}} ${_firmw:C/\:.*$//}; \ ${LD} -b binary --no-warn-mismatch ${_LDFLAGS} \ - -r -d -o ${.TARGET} ${_firmw:C/\:.*$//}; \ + -m ${LD_EMULATION} -r -d \ + -o ${.TARGET} ${_firmw:C/\:.*$//}; \ rm ${_firmw:C/\:.*$//}; \ fi