From owner-freebsd-toolchain@FreeBSD.ORG Tue Mar 31 20:54:13 2015 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1D595DC for ; Tue, 31 Mar 2015 20:54:13 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) (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 60FCE61E for ; Tue, 31 Mar 2015 20:54:13 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [127.0.1.5]) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9) with ESMTP id t2VKsCW9014931 for ; Tue, 31 Mar 2015 20:54:12 GMT (envelope-from root@phabric-backend.isc.freebsd.org) Received: (from root@localhost) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9/Submit) id t2VKsCm3014930; Tue, 31 Mar 2015 20:54:12 GMT (envelope-from root) Date: Tue, 31 Mar 2015 20:54:12 +0000 To: freebsd-toolchain@freebsd.org From: "dim (Dimitry Andric)" Subject: [Differential] [Request, 37 lines] D2187: Ensure cross assembler, linker and objcopy are used for the build32 stage Message-ID: X-Priority: 3 Thread-Topic: D2187: Ensure cross assembler, linker and objcopy are used for the build32 stage X-Herald-Rules: <28> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: Thread-Index: ZDFjZDBmZDdjODFjNWQ3YTFiYzkzYzkyYjU5 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , , MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2015 20:54:13 -0000 dim created this revision. dim added reviewers: imp, bapt, rodrigc. dim added a subscriber: freebsd-toolchain. Herald added a subscriber: imp. REVISION SUMMARY When I tried replicating Craig Rodrigues's efforts at building head with the amd64-xtoolchain-gcc package, I noticed that during the build32 stage it still uses the base system ld and objcopy: [...] --- lib/csu/i386-elf__L --- ld -m elf_i386_fbsd -Y P,/usr/obj/home/dim/head/lib32/usr/lib32 -o crt1.o -r crt1_s.o crt1_c.o [...] --- lib/csu/i386-elf__L --- objcopy --localize-symbol _start1 crt1.o [...] --- lib/csu/i386-elf__L --- ld -m elf_i386_fbsd -Y P,/usr/obj/home/dim/head/lib32/usr/lib32 -o Scrt1.o -r crt1_s.o Scrt1_c.o [...] --- lib/csu/i386-elf__L --- objcopy --localize-symbol _start1 Scrt1.o And a bunch more of those. I went through the various Makefiles I could find, replacing literal 'objcopy' with ${OBJCOPY}, which fixes the case for objcopy. Also, I changed LD=${LD} and AS=${AS} to use their X variants in the definition of LIB32WMAKEFLAGS in Makefile.inc1, and added OBJCOPY=${XOBJCOPY} to the list. Together, these changes should ensure that the cross tools are always used instead of the base system tools. TEST PLAN A make universe is probably required, at least. BRANCH /head REVISION DETAIL https://reviews.freebsd.org/D2187 AFFECTED FILES Makefile.inc1 lib/csu/i386-elf/Makefile sys/boot/i386/boot2/Makefile sys/boot/i386/gptboot/Makefile sys/boot/i386/gptzfsboot/Makefile sys/boot/i386/zfsboot/Makefile sys/boot/mips/beri/boot2/Makefile sys/boot/pc98/boot0.5/Makefile sys/boot/pc98/boot0/Makefile sys/boot/pc98/boot2/Makefile To: dim, imp, bapt, rodrigc Cc: imp, freebsd-toolchain