From owner-freebsd-toolchain@freebsd.org Sun Mar 4 23:11:22 2018 Return-Path: Delivered-To: freebsd-toolchain@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 256F7F3CF74 for ; Sun, 4 Mar 2018 23:11:22 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wr0-x231.google.com (mail-wr0-x231.google.com [IPv6:2a00:1450:400c:c0c::231]) (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 9AF4575662 for ; Sun, 4 Mar 2018 23:11:21 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wr0-x231.google.com with SMTP id u49so15399331wrc.10 for ; Sun, 04 Mar 2018 15:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=hBnKPAToSKhqib/Z2HRibF+yPuE38fe+2KT84k/VAxs=; b=yiHZASQW1aQwOjeu7BBwVIzfTqZhTjFzXBp/jcO38WvB9f8NUYjYUGUr0d3mP34NxN VKWoGUdpZ7qNcF1ZfH8whrAFdMdMhjNeVspqxes6mxzGrxutS4PRgYiwz4sN01d5j+fW TF6j32Azu1EufSdUc3Bpo/9SruiQ2mCauCceK1vOX0V0s4xKmC653dXlhBcwfFIi739R wI1XIWV6m3U2Pq1CrOwTto7MMHjUiZEjyvMT8Mt9O3a6kBdWZLk0JF5BiJ2888tMGm4g E5bA2vZhDq0KAkbJ451Db3bT0vGjOXdHEiYimjz1oypDkBi10GB6Eq7uhQgE0zjbPSGw 5lqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=hBnKPAToSKhqib/Z2HRibF+yPuE38fe+2KT84k/VAxs=; b=ql7nRhiSFeVefQ65Ovo7hvHk4hwyuoXc0CjjzhaaUTCtaS7pR1IRBJYnam849eLJwH MklO0DT3g8NzGUTLhAFLui9ATs04owBEhSLXMiALCHfRH7el9K9BOqshkdSjSUKqJvHS LQ4fGbkA7Fm/DkWs+vignYYqAA1OsxZOqmdxNZPZ3372sXFvmAZQuuNE8TqG6L4fq8SS cVjkqBPfgV+vSPEQRvcy5jL35rV1crsYcpZFWI96CFW0Uf9Vloo8OcLBqTc+NKOAx9DR QwN6Wk+mXSAJ9UGYXuZLv0QxFR6JgLabCRcKchpjATQTDqF0rXOALjbPnhBXG75ywqG2 lkdg== X-Gm-Message-State: APf1xPDO55mnoR5DK9nglHficqmzCz/9n+o7QTOsnhJ+rj6RrCtBHuho N9v5QzVEakAEQc0O35O9fQ+VlsmijAD2eqFYSEhDnwgQGn8gfx6OYIRZ1YCJyQv+SHBYbhk+x5u bVJ2+bR16EOOKfQAzJyZQT79EobHK69zMglsJFd+7KFjuOCZytKVQHOUyJCtncuP1SVZt9Nm/rh JDcF6PqgPRog== X-Google-Smtp-Source: AG47ELvNRZr0UUXqdMk8LjH+yMCZBLksVHKVlWmczsHLCIAtzfxSJMOffBMGd45eObhsKIj+6S+xaA== X-Received: by 10.223.160.42 with SMTP id k39mr11831894wrk.138.1520205080052; Sun, 04 Mar 2018 15:11:20 -0800 (PST) Received: from mutt-hbsd (91.ip-164-132-51.eu. [164.132.51.91]) by smtp.gmail.com with ESMTPSA id 43sm12738708wru.40.2018.03.04.15.11.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 04 Mar 2018 15:11:19 -0800 (PST) Date: Sun, 4 Mar 2018 18:11:06 -0500 From: Shawn Webb To: freebsd-toolchain@freebsd.org Subject: Compiling libc with LTO Message-ID: <20180304231106.57dvw6psfpwnedbd@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7wfzl5ahyypmchox" Content-Disposition: inline X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171215 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2018 23:11:22 -0000 --7wfzl5ahyypmchox Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey All, I'm working on Cross-DSO CFI support in HardenedBSD. I've noticed certain libraries do not like to be compiled with -flto, libc being one of them. I'm scratching my head a bit, but unsure where to go from here, so a little direction would be helpful. In the hardened/current/cross-dso-cfi feature branch of the hardenedBSD-playground repo[1], ld.lld, llvm-ar, llvm-nm, and llvm-objdump are the default ld, ar/ranlib, nm, and objdump respectively. The first step for Cross-DSO CFI support is compiling all shared and static libraries with LTO. I'm curious if this is a shortcoming of ld.lld and I should file a bug with the llvm project (if one's not already filed). I've heard that someone got FreeBSD compiled with LTO already, so I'm hoping to borrow some of their expertise. Here's a log of the build (warning: large file): https://gist.githubusercontent.com/anonymous/f8617d629fd054479142cc4b6de358= 1e/raw/b94579fac987556c01ae0aab7e2943d25d27bcc4/libc.log Essentially, the erroring lines are: /usr/obj/scratch/src/cross-dso-cfi/amd64.amd64/tmp/usr/bin/ld: error: swapc= ontext.pico: symbol swapcontext@@@FBSD_1.2 has undefined version @FBSD_1.2 /usr/obj/scratch/src/cross-dso-cfi/amd64.amd64/tmp/usr/bin/ld: error: opena= t.pico: symbol openat@@@FBSD_1.2 has undefined version @FBSD_1.2 /usr/obj/scratch/src/cross-dso-cfi/amd64.amd64/tmp/usr/bin/ld: error: setco= ntext.pico: symbol setcontext@@@FBSD_1.2 has undefined version @FBSD_1.2 [1]: https://github.com/HardenedBSD/hardenedBSD-playground/tree/hardened/cu= rrent/cross-dso-cfi Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --7wfzl5ahyypmchox Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlqcfQUACgkQaoRlj1JF bu7gWA/8C+SpEA+Z8msBj3HKbUgeJNnQQokAHMqSnFJuU7lZshIT8oWJi1eRmdL9 7scq9PN3jmN/hziV5wObe4Kml+Rzl6+zMZJ/f6b6mX+7AOrSI403qtkAq7Qf/Uju 2G+gAh6mVh9iXgqBG4KzD7iUeFrwxaXAWEg8+MKgVMNUGvsqCmW94uzuD1T2xULO 3JtPTro20TjiPKSEIG1AHSptKFwIuPIntIIjKgjUpo2o1BTbgCWyxXc7HZv5RBC/ NxUdVMQLnd154AO0NIKcppkzxRPaEnwidBH6kjgkxbo1gH01iUrGrTiyqzThFqtC DMrhzj3zHCdPsbV/K73AdJnkSk8YrDVHtGBAaaVPOMASc8Cf4Jux1kPIJBsSUIzr NdcSHcS4zZbFTKjqbGqHMT+NH2UQ/53gohK4D38fFLujK5VxH6gAzoFiYvM5Pof5 +eHPEXh/DegLqGJGQj0vSgtMGj6HGOwsgKXO2AjF2gcbxrFNhC2RWhXKsuP7Gira Ak4NHuBBKS7xnhj2JCTtQtD766AXq0CifnibbPR/aZPYSROkXwvNiE8XbEhp+ABg Ri+X8s1zsaKWILbsGAdMWst6dLO9b/ahudStUF2vvrMxbTlGH+muCdEAA+gMKPNB skPWpqEEjJst4ft344uX14lbugliaqtoA2o3Ev4q6/XZkeQ+zQo= =TBui -----END PGP SIGNATURE----- --7wfzl5ahyypmchox--