Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Aug 2020 21:53:02 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Gleb Popov <arrowd@freebsd.org>
Cc:        toolchain@freebsd.org
Subject:   Re: Undefined reference to __bswapsi2/__bswapdi2
Message-ID:  <4616D1DE-55B4-43AA-B8D9-A3C0513C9BC1@FreeBSD.org>
In-Reply-To: <CALH631==P4bA27wV1V1U8gUPff4RrmFd=ReRV8OeiZHHsppA5w@mail.gmail.com>
References:  <CALH631mXOLvLrrMcB3rfqQT5c%2BEEMRBnGgEBSEooHJYELOE9Fw@mail.gmail.com> <CALH631==P4bA27wV1V1U8gUPff4RrmFd=ReRV8OeiZHHsppA5w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <arrowd@freebsd.org> wrote:
>=20
> On Wed, Aug 19, 2020 at 10:15 PM Gleb Popov <arrowd@freebsd.org> =
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4616D1DE-55B4-43AA-B8D9-A3C0513C9BC1>