From owner-freebsd-arch@freebsd.org Wed May 16 14:43:30 2018 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77A8DEE6925 for ; Wed, 16 May 2018 14:43:30 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (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 EF8DC6BF20 for ; Wed, 16 May 2018 14:43:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x244.google.com with SMTP id p3-v6so2519971itc.0 for ; Wed, 16 May 2018 07:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PqCi5wUTVLr1V4Jq5MrGxK+891zSeqOJjxHuOLV2y4U=; b=SDvx6lA1Xry1i+irhc6hastjn2glME50Y+ANOOyGR7Nuw58lEj37GKIdKIJU3Uhoo2 eI1FF6IWhlrFw8yf8/OVYY/wybIRF6c4qH1flyvrq395vgNrx5oxg0wZA2H7w4fbKB/x 7NoSsqEeW8Pfg6kN3X+qTUEjtVJ04HKoLN74hkehGxddq450WwdSx3zQwVnyx8VGj0Z6 fv3cLqEfZG5U7vwWxj4M/Z2Umq1vHF9dcW7eKo9hj8qkHEE0KdhwTWRG83f3Oc4hxY3c dmwOvlzLdYf890G9NL/3Yy2SeKvQLKFlQeWLyUdO6d9Z21KhmfgrctcR+OZ+EFQrtvKU d6GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PqCi5wUTVLr1V4Jq5MrGxK+891zSeqOJjxHuOLV2y4U=; b=GteM0z9zyG7AhcG7dLj0yyVxHXcLLmbSGtsa4SyhKf5P0Eo09+p/nngpOh2pOBoQuV U2Fxu+T2sjQlI68tbUak/V0EaNQuReWiJKgBs0typQjOu0P2ti4xBYDUaMRnqBqo6PZy bFVWx0dA/Yha8L/9/H/x/fNqBYhuUNvMAYqrhqJwav76chkjaGlnMer312viaDRjhd6V jcqMpaKxO6u7YcuW37G5plqTLP0mmnesUwQiFpEHYHi6MILETbTMTwpxUdWuS3WbQhto +lQQBdUyUTT++s7ZqFIrwve3F5hVN5MoyyqPGO8RxL2CewL2m84TF4FO3UFHFT5FrBfO y5gQ== X-Gm-Message-State: ALKqPwf1IpsbmLjKh4UhkeSysbjSZFXI4E9eaacRMAc/Jx5gKNiZlvcM lv1/op/ZB63dV6MItYfkB77cDIRNqRIAcflibDQ= X-Google-Smtp-Source: AB8JxZqMLxStxHeyl8U21ovk0BCPoOBX2qmnXu766P1o3NUzu4fVRhJdZ/nbo+8hws0zGpk9fdvrMtjs4Puf6B1OxtQ= X-Received: by 2002:a24:2fce:: with SMTP id j197-v6mr1210108itj.52.1526481809296; Wed, 16 May 2018 07:43:29 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.167 with HTTP; Wed, 16 May 2018 07:43:08 -0700 (PDT) In-Reply-To: <201805161335.w4GDZvSM000645@pdx.rh.CN85.dnsmgr.net> References: <201805161335.w4GDZvSM000645@pdx.rh.CN85.dnsmgr.net> From: Ed Maste Date: Wed, 16 May 2018 10:43:08 -0400 X-Google-Sender-Auth: CYjEZzu1E9zDtAh9OTwxzQKSyCM Message-ID: Subject: Re: Can't build kernel anymore: amd64 kernel requires linker ifunc support To: "Rodney W. Grimes" Cc: Warner Losh , Hans Petter Selasky , Emeric POUPON , Oliver Pinter , freebsd-arch Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 14:43:30 -0000 On 16 May 2018 at 09:35, Rodney W. Grimes wrote: >> >> LD=ld.lld make >> >> is the magic here. The kernel needs a new linker to properly link in the >> ifunc, and that's not our ancient ld. lld does it, as does the latter-day >> binutils. > > Since this now seems to be a mandatory thing to get a kernel built > can it please be set in the Makefile that is needing it? It's already handled by the Makefile that needs it when using the normal build process - i.e., "make buildworld buildkernel" (or toolchain or kernel-toolchain followed by buildkernel). The failure arises when building a kernel the "old" way, using config and then and make in the kernel directory. This inherently uses the host's linker (/usr/bin/ld), which is too old to link the kernel. We can't just add LD=ld.lld to the kernel's Makefile(s), because it would break external toolchain and other cases where users use a specific linker. I hope to introduce a KERNEL_LD Make variable that controls the linker used for the kernel link, but it's more involved than a one or two line change for the same reason that we can't just set LD=ld.lld. ld.lld will start being installed as /usr/bin/ld once these two issues are resolved: pr227968 [exp-run] Update lang/ghc to 8.4.2, devel/stack to 1.7.1, and all the */hs-* ports pr214864 [exp-run] test build with lld as /usr/bin/ld The exp-run for the first is complete and I believe we are now just waiting on the change to be committed. As soon as that happens I will ask for another exp-run for the second PR, and will commit the change to install lld by default as soon as it completes (assuming successfully).