From owner-svn-src-head@freebsd.org Fri Jun 23 16:43:13 2017 Return-Path: Delivered-To: svn-src-head@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 0D14ADA8018; Fri, 23 Jun 2017 16:43:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9293672E4; Fri, 23 Jun 2017 16:43:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id EB96B8393; Fri, 23 Jun 2017 16:43:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id B3DF22F26; Fri, 23 Jun 2017 16:43:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id bdcJhoGeGhVI; Fri, 23 Jun 2017 16:42:59 +0000 (UTC) Subject: Re: svn commit: r320272 - head/sys/conf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 68B0E2F1E To: Konstantin Belousov , Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706231557.v5NFvw8g098666@repo.freebsd.org> <20170623162859.GL3437@kib.kiev.ua> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Fri, 23 Jun 2017 09:43:00 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170623162859.GL3437@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="iAqIDL4FAWgTdH0PFtGjl3UQ1VotPpvH6" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jun 2017 16:43:13 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iAqIDL4FAWgTdH0PFtGjl3UQ1VotPpvH6 Content-Type: multipart/mixed; boundary="lFdDxvMkNesgbR8fgnHquGnmOInPtQxTr"; protected-headers="v1" From: Bryan Drewery To: Konstantin Belousov , Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r320272 - head/sys/conf References: <201706231557.v5NFvw8g098666@repo.freebsd.org> <20170623162859.GL3437@kib.kiev.ua> In-Reply-To: <20170623162859.GL3437@kib.kiev.ua> --lFdDxvMkNesgbR8fgnHquGnmOInPtQxTr Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/23/2017 9:28 AM, Konstantin Belousov wrote: > On Fri, Jun 23, 2017 at 03:57:58PM +0000, Ed Maste wrote: >> Author: emaste >> Date: Fri Jun 23 15:57:58 2017 >> New Revision: 320272 >> URL: https://svnweb.freebsd.org/changeset/base/320272 >> >> Log: >> enable --build-id for the kernel link >> =20 >> A Build-ID is an identifier generated at link time to uniquely ident= ify >> ELF binaries. It allows efficient confirmation that an executable o= r >> shared library and a corresponding standalone debuginfo file match. >> (Otherwise, a checksum of the debuginfo file must be calculated when= >> opening it in a debugger.) >> =20 >> The FreeBSD base system includes GNU bfd ld 2.17.50 as the linker fo= r >> architectures other than arm64. Build-ID support was added to bfd l= d >> shortly after that version, so was not previously available to us. >> =20 >> We can now start making use of Build-ID as we migrate to using lld o= r >> bfd ld from ports, conditionally enabled based on the LINKER_TYPE an= d >> LINKER_VERSION make variables added in r320244 and subsequent commit= s. >> =20 >> Reviewed by: dim >> MFC after: 3 weeks >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D11314 >> >> Modified: >> head/sys/conf/kern.pre.mk >> head/sys/conf/kmod.mk >> >> Modified: head/sys/conf/kern.pre.mk >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/conf/kern.pre.mk Fri Jun 23 15:27:23 2017 (r320271) >> +++ head/sys/conf/kern.pre.mk Fri Jun 23 15:57:58 2017 (r320272) >> @@ -114,6 +114,10 @@ DEFINED_PROF=3D ${PROF} >> # can override the others. >> CFLAGS+=3D ${CONF_CFLAGS} >> =20 >> +.if ${LINKER_TYPE} !=3D "bfd" || ${LINKER_VERSION} > 21750 > I believe such tests is the road to misery. I suggest that an ld featu= re > presence must define some variable for make, and the places using the > ld feature would test for the variable. >=20 > In other words, checking the features must be centralized. There is to= o > many linkers already: bfd, gold, lld. Since two new linkers appeared i= n > five years, I would be not surprised if more will. Agreed. We can have a LINKER_FEATURES like we do for the compiler. In this case I suggest just moving the same condition you have added into bsd.linker.mk with something like https://people.freebsd.org/~bdrewery/patches/linker-features-build-id.dif= f Then in these sys/conf places you just: =2Eif ${LINKER_FEATURES:Mbuild-id} LDFLAGS+=3D >=20 > Having to deal with combinations at places of use is not scalable. We = do > it close to right with C compilers and sys/cdefs.h. >=20 >> +LDFLAGS+=3D -Wl,--build-id=3Dsha1 >> +.endif >> + >> # Optional linting. This can be overridden in /etc/make.conf. >> LINTFLAGS=3D ${LINTOBJKERNFLAGS} >> =20 >> >> Modified: head/sys/conf/kmod.mk >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/conf/kmod.mk Fri Jun 23 15:27:23 2017 (r320271) >> +++ head/sys/conf/kmod.mk Fri Jun 23 15:57:58 2017 (r320272) >> @@ -125,6 +125,10 @@ CFLAGS.gcc+=3D --param large-function-growth=3D10= 00 >> CFLAGS+=3D -fno-common >> LDFLAGS+=3D -d -warn-common >> =20 >> +.if ${LINKER_TYPE} !=3D "bfd" || ${LINKER_VERSION} > 21750 >> +LDFLAGS+=3D -Wl,--build-id=3Dsha1 >> +.endif >> + >> CFLAGS+=3D ${DEBUG_FLAGS} >> .if ${MACHINE_CPUARCH} =3D=3D amd64 >> CFLAGS+=3D -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer >=20 --=20 Regards, Bryan Drewery --lFdDxvMkNesgbR8fgnHquGnmOInPtQxTr-- --iAqIDL4FAWgTdH0PFtGjl3UQ1VotPpvH6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZTUUUAAoJEDXXcbtuRpfPJqgH/R+fz6S85B5e/vBHI4NEPTHh 6UPiDweZRShpA/vb45FaEuLUyapZ3yp2/690aT0o6ryFQFn88Q9hnItwUaG+emhw xlZUDNt1vfkOpukvZQ4pjtEdXpDV9Kx+davwwDHmmmaBMKAD/kF303vVMlqgVqQI kTulpSrFZHR8C61YDTvgfmkRBQ8ESG1DAgomXS/8NJvlRePOzFVo+3qM6nQCf9nC p+QIVVRoCJmQykk0oiwu2EbKcL0i4oraU+wnZzcvVapcpdvvyjB2HN9a5dsaFpZH oEkvHG1CSvA0LovWxUb9gizSNFk9Lizz/4PfmbmeLRKjGfh18eDxCUvN5GSAQxE= =UJsD -----END PGP SIGNATURE----- --iAqIDL4FAWgTdH0PFtGjl3UQ1VotPpvH6--