Date: Wed, 24 Feb 2016 15:19:54 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Dimitry Andric <dim@FreeBSD.org> Cc: Raphael Kubo da Costa <rakuco@FreeBSD.org>, freebsd-toolchain@freebsd.org Subject: Re: clang -pg, libm and the _end symbol Message-ID: <20160224131954.GP91220@kib.kiev.ua> In-Reply-To: <1CEB597F-1446-4E73-B5E2-5E5A4B3E9313@FreeBSD.org> References: <86povmbb7c.fsf@FreeBSD.org> <1CEB597F-1446-4E73-B5E2-5E5A4B3E9313@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 24, 2016 at 01:54:25PM +0100, Dimitry Andric wrote: > On 24 Feb 2016, at 12:27, Raphael Kubo da Costa <rakuco@FreeBSD.org> wrote: > > > > I'm reviewing an update to the textproc/miller port in bug 207194, and > > noticed it does some ugly things in post-configure to seemingly > > work around the following problem (on 11-HEAD at least): > > > > % echo 'int main(void) { return 0; }' > foo.c > > % clang -pg foo.c -lm > > /usr/bin/ld: undefined reference to symbol `_end' (try adding -lc) > > //lib/libc.so.7: could not read symbols: Bad value > > cc: error: linker command failed with exit code 1 (use -v to see > > invocation) > > Try using: clang -pg foo.c -lm_p > > That works for me (also with gcc). It probably not quite works, in the sense that it resolves _end to something not correctly provided by libm_p.a. In other words, sbrk(), if used for anything, would be broken.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160224131954.GP91220>