From owner-freebsd-toolchain@freebsd.org Wed Sep 7 13:10:26 2016 Return-Path: Delivered-To: freebsd-toolchain@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 8B643BC68A5 for ; Wed, 7 Sep 2016 13:10:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 565FC120 for ; Wed, 7 Sep 2016 13:10:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x236.google.com with SMTP id i184so195619715itf.1 for ; Wed, 07 Sep 2016 06:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=S3uHMwPUlXERHoWlIWjD/ylcbdZSpUMkoq2hkjXOP3k=; b=zmr0HqKjLUhdq/ype1d8cIN4d9OHMEIQyZ+ARa36iBYdKDOv8WcyYncLtCUbHVrGub P0tcrFAZgDA3tWz2ETrfbrbaPYDhQ0FHWHrCK7m0ltihPZxtjpAQNQrjn+83To8mQIP6 a2A7lh5hnJGz2z5m9WdV63oneSHna1obTBNklweYfkA98jp5jGn4qMKYTUHXWTSOTqfK 7sl7Kzv/zJIcWbt2Bnde7vKRdNmQbmhRRnVy+rZwo3Jgb1Py4mUaKoLtXZ+u6TUdV+Ep Oym1TQwUEvFjkUTLOBGB8glChwml6MhNwhuL/GNghXuWJfvShNylKKOqSHlnWtUlSM6e emWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=S3uHMwPUlXERHoWlIWjD/ylcbdZSpUMkoq2hkjXOP3k=; b=eMa1epC2bIn/pcNxJOfQ3l7jEX7xhnYMhSpvfPE1TthwxZ7cmBMdWuUm577krnzj50 TFPYmT5xVdlPNUT988a7Ygwgqm553sGIOc1OeV7NEK90isRWlTCzUd7N10hv2+rsMT3Z 05v9eJQ795NcRdvaTD0w0+hou5cRIuFC/Dc0kQFeqg6Si/ZBH1WmZekqR+v1B/UhKM/0 eK8W34fzItXp+wP0APFjYh3v6ogLIiXOQGSR/QU9oB5R05jdon5QRuj6xeUNVQq9xnsF rVhk4nP/HLjxCjUCUNUKnOLFgKRVtKbTdAbShUWM97quVzEbP4ijnJ681jcINj9d7kq8 TByA== X-Gm-Message-State: AE9vXwNhQZGPbkffzms1srnUKarg8tn9fypOY3rwlgx48YCfEq+FI05qXhVjGQ15NTpREwu2sX2ET2lam6CFtg== X-Received: by 10.36.53.83 with SMTP id k80mr6059922ita.59.1473253825598; Wed, 07 Sep 2016 06:10:25 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.138.28 with HTTP; Wed, 7 Sep 2016 06:10:05 -0700 (PDT) In-Reply-To: References: From: Ed Maste Date: Wed, 7 Sep 2016 09:10:05 -0400 X-Google-Sender-Auth: oNaq3HpCVfMBH1C3u_mNZDqTRMA Message-ID: Subject: Re: Update on using LLVM's lld linker in the FreeBSD base system To: "freebsd-toolchain@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2016 13:10:26 -0000 On 1 August 2016 at 17:40, Ed Maste wrote: > Over the past year or so I have been investigating the state of LLVM's > lld linker for use in the FreeBSD base system, to see if it could be > used as FreeBSD's system linker. > > ... > There are a few features used by the FreeBSD base system that lld > developers (intentionally) do not expect to implement, unless they're > reasonably widely used in a variety of different software. If they're > not implemented we can modify FreeBSD to avoid using them. I'm aware > of: > > -N/--omagic, used by some boot loader components. We can achieve the > same effect with a linker script. Warner addressed this for x86 boot components in r305353. We still have an issue: lld does not support -Ttext, but does have an -image-base option to set the start address. It would be nice to reconcile this and LLVM PR 30269 is open to track this for lld. > -dc, used by the rescue build. As long as object files are built > specifically for rescue we can probably use -fno-common instead. I briefly tried to get the rescue build working with lld, but was not successful and have just left it disabled in my tests. We can investigate this later. > -b binary to convert binary files into ELF objects, used by some > device drivers in kernel and module builds. We can use > objcopy(elfcopy) instead. There is now an lld change in progress to add support for -b binary: https://reviews.llvm.org/D24060