Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Mar 2018 18:11:06 -0500
From:      Shawn Webb <shawn.webb@hardenedbsd.org>
To:        freebsd-toolchain@freebsd.org
Subject:   Compiling libc with LTO
Message-ID:  <20180304231106.57dvw6psfpwnedbd@mutt-hbsd>

index | next in thread | raw e-mail

[-- Attachment #1 --]
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/f8617d629fd054479142cc4b6de3581e/raw/b94579fac987556c01ae0aab7e2943d25d27bcc4/libc.log

Essentially, the erroring lines are:

/usr/obj/scratch/src/cross-dso-cfi/amd64.amd64/tmp/usr/bin/ld: error: swapcontext.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: openat.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: setcontext.pico: symbol setcontext@@@FBSD_1.2 has undefined version @FBSD_1.2

[1]: https://github.com/HardenedBSD/hardenedBSD-playground/tree/hardened/current/cross-dso-cfi

Thanks,

-- 
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

[-- Attachment #2 --]
-----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-----
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180304231106.57dvw6psfpwnedbd>