clang -pg, libm and the _end symbol
Dimitry Andric
dim at FreeBSD.org
Wed Feb 24 12:54:51 UTC 2016
On 24 Feb 2016, at 12:27, Raphael Kubo da Costa <rakuco at 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).
-Dimitry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-toolchain/attachments/20160224/4e38f8b7/attachment.sig>
More information about the freebsd-toolchain
mailing list