From owner-freebsd-toolchain@freebsd.org Wed Feb 24 12:54:50 2016 Return-Path: Delivered-To: freebsd-toolchain@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 E6C1EAB3263 for ; Wed, 24 Feb 2016 12:54:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF575867; Wed, 24 Feb 2016 12:54:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2a03:fc02:2:1:c43e:b23e:8d62:2c5] (unknown [IPv6:2a03:fc02:2:1:c43e:b23e:8d62:2c5]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 2836C3849B; Wed, 24 Feb 2016 13:54:46 +0100 (CET) Subject: Re: clang -pg, libm and the _end symbol Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_1D12CB61-D311-488D-8BD3-8B58193317CC"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: <86povmbb7c.fsf@FreeBSD.org> Date: Wed, 24 Feb 2016 13:54:25 +0100 Cc: freebsd-toolchain@freebsd.org Message-Id: <1CEB597F-1446-4E73-B5E2-5E5A4B3E9313@FreeBSD.org> References: <86povmbb7c.fsf@FreeBSD.org> To: Raphael Kubo da Costa X-Mailer: Apple Mail (2.3112) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 12:54:51 -0000 --Apple-Mail=_1D12CB61-D311-488D-8BD3-8B58193317CC Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 24 Feb 2016, at 12:27, Raphael Kubo da Costa 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 --Apple-Mail=_1D12CB61-D311-488D-8BD3-8B58193317CC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.29 iEYEARECAAYFAlbNqBYACgkQsF6jCi4glqOhrgCeOBBciOqLUtG1+0Ycv36tDPGN txYAn0AZ8f6/jOvm/b9o+j12txoZCsDx =xoBd -----END PGP SIGNATURE----- --Apple-Mail=_1D12CB61-D311-488D-8BD3-8B58193317CC--