From owner-svn-src-all@freebsd.org Wed Jul 29 18:45:41 2015 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 A11229AE578; Wed, 29 Jul 2015 18:45:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 813F46C5; Wed, 29 Jul 2015 18:45:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6TIjfcL081844; Wed, 29 Jul 2015 18:45:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6TIjd4G081835; Wed, 29 Jul 2015 18:45:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201507291845.t6TIjd4G081835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 29 Jul 2015 18:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286030 - in head: gnu/usr.bin/binutils share/mk tools/build/mk tools/build/options usr.bin/elfcopy 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.20 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: Wed, 29 Jul 2015 18:45:41 -0000 Author: emaste Date: Wed Jul 29 18:45:38 2015 New Revision: 286030 URL: https://svnweb.freebsd.org/changeset/base/286030 Log: Allow ELF Tool Chain elfcopy to be installed as objcopy ELF Tool Chain elfcopy is nearly a drop-in replacement for GNU objcopy, but does not currently support PE output which is needed for building x86 UEFI bits. Add a src.conf knob to allow installing it as objcopy and set it by default for aarch64 only, where we don't have a native binutils. Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2887 Added: head/tools/build/options/WITHOUT_ELFCOPY_AS_OBJCOPY (contents, props changed) head/tools/build/options/WITH_ELFCOPY_AS_OBJCOPY (contents, props changed) Modified: head/gnu/usr.bin/binutils/Makefile head/share/mk/src.opts.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/elfcopy/Makefile Modified: head/gnu/usr.bin/binutils/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/Makefile Wed Jul 29 18:33:11 2015 (r286029) +++ head/gnu/usr.bin/binutils/Makefile Wed Jul 29 18:45:38 2015 (r286030) @@ -11,7 +11,7 @@ SUBDIR= doc\ as \ ld \ ${_nm} \ - objcopy \ + ${_objcopy} \ objdump \ ${_readelf} \ ${_size} \ @@ -26,5 +26,8 @@ _size= size _strings= strings _strip= strip .endif +.if ${MK_ELFTOOLCHAIN_TOOLS} == "no" || ${MK_ELFCOPY_AS_OBJCOPY} == "no" +_objcopy= objcopy +.endif .include Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Jul 29 18:33:11 2015 (r286029) +++ head/share/mk/src.opts.mk Wed Jul 29 18:45:38 2015 (r286030) @@ -234,6 +234,9 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTST .endif .if ${__T} == "aarch64" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB +__DEFAULT_YES_OPTIONS+=ELFCOPY_AS_OBJCOPY +.else +__DEFAULT_NO_OPTIONS+=ELFCOPY_AS_OBJCOPY .endif # LLVM lacks support for FreeBSD 64-bit atomic operations for ARMv4/ARMv5 .if ${__T} == "arm" || ${__T} == "armeb" Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 29 18:33:11 2015 (r286029) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 29 18:45:38 2015 (r286030) @@ -184,7 +184,9 @@ OLD_DIRS+=usr/share/examples/bhyve .if ${MK_BINUTILS} == no OLD_FILES+=usr/bin/as OLD_FILES+=usr/bin/ld +.if ${MK_ELFTOOLCHAIN_TOOLS} != no && ${MK_ELFCOPY_AS_OBJCOPY} == no OLD_FILES+=usr/bin/objcopy +.endif OLD_FILES+=usr/bin/objdump OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.x OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xbn @@ -201,7 +203,9 @@ OLD_FILES+=usr/libdata/ldscripts/elf_x86 OLD_FILES+=usr/libdata/ldscripts/elf_x86_64_fbsd.xw OLD_FILES+=usr/share/man/man1/as.1.gz OLD_FILES+=usr/share/man/man1/ld.1.gz +.if ${MK_ELFTOOLCHAIN_TOOLS} != no && ${MK_ELFCOPY_AS_OBJCOPY} == no OLD_FILES+=usr/share/man/man1/objcopy.1.gz +.endif OLD_FILES+=usr/share/man/man1/objdump.1.gz OLD_FILES+=usr/share/man/man7/as.7.gz OLD_FILES+=usr/share/man/man7/ld.7.gz @@ -1646,7 +1650,8 @@ OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/ee OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/ee.cat .endif -.if ${MK_ELFTOOLCHAIN_TOOLS} == no +.if ${MK_ELFTOOLCHAIN_TOOLS} == no || \ + (${MK_ELFTOOLCHAIN_TOOLS} != no && MK_ELFCOPY_AS_OBJCOPY != no) OLD_FILES+=usr/bin/elfcopy OLD_FILES+=usr/share/man/man1/elfcopy.1.gz .endif Added: head/tools/build/options/WITHOUT_ELFCOPY_AS_OBJCOPY ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_ELFCOPY_AS_OBJCOPY Wed Jul 29 18:45:38 2015 (r286030) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to build and install +.Xr objcopy 1 +from GNU Binutils, instead of the one from ELF Tool Chain. Added: head/tools/build/options/WITH_ELFCOPY_AS_OBJCOPY ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_ELFCOPY_AS_OBJCOPY Wed Jul 29 18:45:38 2015 (r286030) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to build and install ELF Tool Chain's elfcopy as +.Xr objcopy 1 , +instead of the one from GNU Binutils. Modified: head/usr.bin/elfcopy/Makefile ============================================================================== --- head/usr.bin/elfcopy/Makefile Wed Jul 29 18:33:11 2015 (r286029) +++ head/usr.bin/elfcopy/Makefile Wed Jul 29 18:45:38 2015 (r286030) @@ -7,7 +7,15 @@ ELFCOPYDIR= ${ELFTCDIR}/elfcopy .PATH: ${ELFCOPYDIR} +.if ${MK_ELFCOPY_AS_OBJCOPY} != "no" +PROG= objcopy +objcopy.1: elfcopy.1 + sed -e 's/\.Dt ELFCOPY 1/.Dt OBJCOPY 1/' \ + -e 's/\.Nm elfcopy/.Nm objcopy/' < ${.ALLSRC} > ${.TARGET} +CLEANFILES+= objcopy.1 +.else PROG= elfcopy +.endif SRCS= archive.c ascii.c binary.c main.c sections.c segments.c symbols.c @@ -17,8 +25,8 @@ LIBADD= archive elftc elf CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common -MAN= elfcopy.1 strip.1 +MAN= ${PROG}.1 strip.1 -LINKS= ${BINDIR}/elfcopy ${BINDIR}/strip +LINKS= ${BINDIR}/${PROG} ${BINDIR}/strip .include