From owner-freebsd-toolchain@freebsd.org Thu Aug 20 19:53:15 2020 Return-Path: Delivered-To: freebsd-toolchain@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1132D3C753A for ; Thu, 20 Aug 2020 19:53:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4BXb166lrHz3fyt for ; Thu, 20 Aug 2020 19:53:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id E7AD03C7423; Thu, 20 Aug 2020 19:53:14 +0000 (UTC) Delivered-To: toolchain@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E76D13C7538 for ; Thu, 20 Aug 2020 19:53:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BXb165rGpz3fng; Thu, 20 Aug 2020 19:53:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 897BF22ED3; Thu, 20 Aug 2020 19:53:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::459d:4fb7:46d4:19b1] (unknown [IPv6:2001:470:7a58:0:459d:4fb7:46d4:19b1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id D90CB6398C; Thu, 20 Aug 2020 21:53:11 +0200 (CEST) From: Dimitry Andric Message-Id: <4616D1DE-55B4-43AA-B8D9-A3C0513C9BC1@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_63982B89-1BCA-4B48-9617-A82EB06C6569"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Subject: Re: Undefined reference to __bswapsi2/__bswapdi2 Date: Thu, 20 Aug 2020 21:53:02 +0200 In-Reply-To: Cc: toolchain@freebsd.org To: Gleb Popov References: X-Mailer: Apple Mail (2.3445.104.15) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2020 19:53:15 -0000 --Apple-Mail=_63982B89-1BCA-4B48-9617-A82EB06C6569 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 20 Aug 2020, at 19:52, Gleb Popov wrote: >=20 > On Wed, Aug 19, 2020 at 10:15 PM Gleb Popov = wrote: >=20 >> Hi toolchain@ >>=20 >> I'm building the latest GHC on 12.1-RELEASE i386 and having almost = the >> same problem as with atomic functions. This time the error is >>=20 >> d: error: undefined symbol: __bswapsi2 >>>>> referenced by TTY.c >>>>> RTS.thr_p_o:(rtsSyms) in archive >> = /wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.2/rts/dist/build/libHSrts_thr_p.= a >>=20 >> ld: error: undefined symbol: __bswapdi2 >>>>> referenced by TTY.c >>>>> RTS.thr_p_o:(rtsSyms) in archive >> = /wrkdirs/usr/ports/lang/ghc/work/ghc-8.10.2/rts/dist/build/libHSrts_thr_p.= a >>=20 >> What's wrong with that? These functions seem to be present in our >> compiler-rt. >>=20 >=20 > Reading /usr/src/lib/libcompiler_rt/Makefile.inc, it seems that we = don't > compile these functions. What's the reason for this? I'm not aware of any particular reason, except that nobody seems to have run into this omission before. It looks like on x86, compilers usually just emit bswap instructions instead of libcalls for these situations. Apparently we have historically only added bswapdi and bswapsi for arm, mips and riscv. -Dimitry --Apple-Mail=_63982B89-1BCA-4B48-9617-A82EB06C6569 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXz7UngAKCRCwXqMKLiCW owIqAKDUepZKmj4GIXLSb0uvGlEbUqL+EQCgulf0I6BmTbcrAWydumj/23oS56o= =qlMy -----END PGP SIGNATURE----- --Apple-Mail=_63982B89-1BCA-4B48-9617-A82EB06C6569--