From owner-freebsd-current@freebsd.org Mon May 14 17:50:55 2018 Return-Path: Delivered-To: freebsd-current@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 549B4DFD237; Mon, 14 May 2018 17:50:55 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (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 EB7EA7B8BA; Mon, 14 May 2018 17:50:54 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x229.google.com with SMTP id p3-v6so12422774itc.0; Mon, 14 May 2018 10:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=KeD+v2ksyTZGBeMeecyIVeHVm7HyBB7lVqL1sBunHGo=; b=koolnF0h/jaA+D3fXDF6fBf1VeNYkO2dkqq8x1ydfPlBmgIMJQjEQSNkAWmFxM2wWL 5A1QV9gsDGK1R6Rt7kwP8GguwBVkA/gGDVhBgRfcqGO1q1Ueoyi0UNFRGevVLL0qoFUh SGnnSN4t5mYP265TrXbyg5zR0vT42eFOsjFI+jxzRF/UqMawRRsywDRQnCFAD/yw7uOL cDiyeHq3JxkqL5oTL3RMHYnPUbZhWKwnQC5lSmw+bAylThHrIgMxbgxbYzbZvBWRKp4R Epk4/DbvxxztE1tqR027GVKvhal1opXyjygi3Q+pq080yace5A+/Dn5tj0L+/jsdrSBp VV2w== 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:from:date:message-id:subject :to; bh=KeD+v2ksyTZGBeMeecyIVeHVm7HyBB7lVqL1sBunHGo=; b=OwiDVhErubHdd9Ckr5lJAJeeGWNZzydUia8Miu9jhh7ixPq2F6w2jC2YmkAmx+6oUY itjveK22auKl2mGBFrSdtUlfqx3wQAXgVz36KB8Bi8of7xwEOQXcDrFmtB3u1xaeC+HO 5V56gpq1KBBVC/FsCZiy24O0u/I0S3hjrXqY+2PcHTgEvHdvVsCla7yQwhwUrTvJmyaZ n1X0FpGoVlmK9lMOiDhyISxHPhGDYPZrmZcFtH/jkfpGaj2ZjbeNUZWMKcFjhDxL6RaJ r9exYmpAhN0QDHjnXt4cZNU/XV5OV3TVDZrSqknVAqpmFRNTLaG73/8f1wW7lAT2C7nw +Ajg== X-Gm-Message-State: ALKqPwcoak00czj7LD8/TlxQJhoEeuROi6+WqfbYzp3N8W+zCsjMIWyQ +t6xugyyyVa1bKhK05NgMf4W+FwMoLm9Hro27fwwjQ== X-Google-Smtp-Source: AB8JxZrByTOhuptaKq3MXIiy8kak23eSj22GvnoNMPJ6QD1a3oKefgNbiI33JJXzH7q2mmkgqZsO3/0VcP1RDF9uMrA= X-Received: by 2002:a24:3555:: with SMTP id k82-v6mr10373058ita.49.1526320254222; Mon, 14 May 2018 10:50:54 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.167 with HTTP; Mon, 14 May 2018 10:50:33 -0700 (PDT) From: Ed Maste Date: Mon, 14 May 2018 13:50:33 -0400 X-Google-Sender-Auth: 1o2Dlmi1Wq8lJ9WbLbn_85l46ZQ Message-ID: Subject: HEADS-UP: Linker issues building amd64 kernels with config & make To: FreeBSD Current , "freebsd-toolchain@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2018 17:50:55 -0000 As of r333461 the amd64 kernel makes use of ifuncs, and requires support in the linker. A safety belt added in r333470 enforces this, and will produce an explicit error if the linker does not support ifuncs. lld is the default bootstrap linker for amd64 and has ifunc support. The typical 'make buildworld' (or kernel-toolchain) followed by 'make buildkernel' process will use lld and successfully link a working kernel. The old-style kernel build (using 'config' followed by a 'make' in the kernel directory) uses the host linker (/usr/bin/ld). This still defaults to GNU ld 2.17.50, which does not support ifuncs. This can be worked around in one of two ways: 1. Install lld as the system linker (/usr/bin/ld), by adding WITH_LLD_IS_LD to /etc/src.conf and building and install world. WITH_LLD_IS_LD will become the default on amd64 in the near future - I'm just waiting on updates to the lang/ghc port and another exp-run. 2. Override LD when you build the kernel: $ LD=ld.lld make These tool chain components will undergo additional changes for the next while.