From owner-freebsd-toolchain@FreeBSD.ORG Thu Dec 13 12:36:33 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27349356 for ; Thu, 13 Dec 2012 12:36:33 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id D37F48FC12 for ; Thu, 13 Dec 2012 12:36:32 +0000 (UTC) Received: from [192.168.1.18] (unknown [217.157.7.221]) by csmtp3.one.com (Postfix) with ESMTPA id 62F4A2403B87; Thu, 13 Dec 2012 12:36:25 +0000 (UTC) From: Erik Cederstrand Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Using non-standard linker Date: Thu, 13 Dec 2012 13:36:25 +0100 Message-Id: <089FCDB5-C0D2-4675-AB71-FD7089BFA031@cederstrand.dk> To: "toolchain@freebsd.org" Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) X-Mailer: Apple Mail (2.1499) Cc: Pete chou X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 12:36:33 -0000 Hi folks, I'm working with Pete Chou from MCLinker (actually, he's doing almost = all the work) to get mclinker to survive a buildworld. The goal is to = allow mclinker to be a drop-in replacement for GNU ld. My first suggestion was to just add LD=3D/usr/local/bin/mclinker to = src.conf. But this only works when ld is invoked explicitly (and only = when 'ld' is not hard-coded, of course). When ld is invoked internally by the compiler, Pete has tested that = gcc(collect2) and clang do not respect the LD variable, but search for = 'ld' in COMPILER_PATH and then PATH instead. Since mclinker is not part = of the build process, it isn't found in COMPILER_PATH, and GNU ld is = used instead. Instead, he can add an additional compiler search path via = the "-B" flag, which seems to work. I'm worried that 'ld' is so hard-wired everywhere that it's impossible = to specify another name. In that case, my suggestion would be to use = build knobs, e.g. WITH_GNU_LD and WITH_MCLINKER_LD to install either GNU = ld or mclinker as 'ld', but that wouldn't work unless mclinker is = imported into base. What's the FreeBSD way of doing this? What do other toolchains do if = they use a non-GNU ld linker? Thanks, Erik=