From owner-freebsd-current@freebsd.org Mon May 14 22:06:13 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 A5939E7B2BD for ; Mon, 14 May 2018 22:06:13 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 41F1B7A264 for ; Mon, 14 May 2018 22:06:13 +0000 (UTC) (envelope-from jhs@berklix.com) Received: by mailman.ysv.freebsd.org (Postfix) id F0163E7B2B9; Mon, 14 May 2018 22:06:12 +0000 (UTC) Delivered-To: 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 DE02AE7B2B8 for ; Mon, 14 May 2018 22:06:12 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from land.berklix.org (land.berklix.org [144.76.10.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "land.berklix.org", Issuer "land.berklix.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BA157A23C; Mon, 14 May 2018 22:06:10 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mart.js.berklix.net (pD9FA824B.dip0.t-ipconnect.de [217.250.130.75]) (authenticated bits=0) by land.berklix.org (8.15.2/8.15.2) with ESMTPSA id w4EM4JMr080335 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 May 2018 22:04:24 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id w4EM5vpw078260; Tue, 15 May 2018 00:05:57 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.7/8.14.7) with ESMTP id w4EM5j5w010919; Tue, 15 May 2018 00:05:57 +0200 (CEST) (envelope-from jhs@berklix.com) Message-Id: <201805142205.w4EM5j5w010919@fire.js.berklix.net> To: current@freebsd.org cc: Ed Maste Subject: Re: HEADS-UP: Linker issues building amd64 kernels with config & make From: "Julian H. Stacey" Organization: http://berklix.eu BSD Unix Linux Consultants, Munich Germany User-agent: EXMH on FreeBSD http://berklix.eu/free/ X-From: http://www.berklix.eu/~jhs/ In-reply-to: Your message "Mon, 14 May 2018 13:50:33 -0400." Date: Tue, 15 May 2018 00:05:45 +0200 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 22:06:14 -0000 Ed Maste wrote: > 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. I guess this explains : Date: Sun, 13 May 2018 20:26:38 +0200 Subject: cd /sys/amd64/compile/GENERIC;make cleandepend; make cleandepend .svn_revision 333575 linking kernel.full iflib.o:(.rodata+0x178): undefined reference to `noop_attach' iflib.o:(.rodata+0x188): undefined reference to `iflib_pseudo_detach' PS Bloat factor > 20: 2M static V 40M dynamic, (normaly dynamics are smaller, not larger). cd /usr/bin; ls -l *ld* -r-xr-xr-x 2 root wheel 1935992 May 13 12:48 ld* -r-xr-xr-x 1 root wheel 40449288 May 13 12:54 ld.lld* file ld ld.lld ld: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, for FreeBSD 12.0 (1200063), FreeBSD-style, stripped ld.lld: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 12.0 (1200063), FreeBSD-style, stripped Cheers, Julian -- Julian Stacey, Computer Consultant, Systems Engineer, BSD Linux Unix, Munich Brexit Referendum stole 3,700,000 votes, inc. 700,000 from British in EU. UK Govt. lied it's "democratic" in Article 50 letter to EU paragraph 3. Petition for votes: http://berklix.eu/queen/