From owner-freebsd-toolchain@freebsd.org Fri Aug 21 12:49:42 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 D47F33BCECE for ; Fri, 21 Aug 2020 12:49:42 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4BY1Yy5BS9z3d4j for ; Fri, 21 Aug 2020 12:49:42 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id B224A3BCDA2; Fri, 21 Aug 2020 12:49:42 +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 B1EBE3BCAD8 for ; Fri, 21 Aug 2020 12:49:42 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay102.isp.belgacom.be (mailrelay102.isp.belgacom.be [195.238.20.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign RSA OV SSL CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BY1Yy05KLz3cns; Fri, 21 Aug 2020 12:49:41 +0000 (UTC) (envelope-from tijl@freebsd.org) IronPort-SDR: RzBdT4dDEYoGRHSpjajKt9RsqDcYrxI8+F5CfXVhJbmRLW5SkSCXts6uryLlaHi7SH54Tm47Ry qpQGH5ZA6Nj4kFDzsQGhqlIqCk5vYlGyHB5L8pOQ3ZfB6jx0DFO5cEIsr0r84TOOybHqVil9n+ Wh0u3sey/GXCnjRFlg77N6sH8MKQfSK00Yy2/F6YS8MCP+zLlOaqVBOJ33WuVjm2sA6LMtL/51 2ct+bYIRfVU1pUGqMwUFaIhSwlZzMOIqVoLJA29HbxZzFCfx1rLb54r63nFQh7v0UkW3GQD22s iHM= X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AGvH5cxXLGAI77m1hI7e3QCgLPsXV8LGtZVwlr6?= =?us-ascii?q?E/grcLSJyIuqrYbRaHt8tkgFKBZ4jH8fUM07OQ7/m+HzVZu93d7jgrS99lb1?= =?us-ascii?q?c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUh?= =?us-ascii?q?rwOhBoKevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrrAjdrNQajZZ8Jqo+xR?= =?us-ascii?q?bEo2ZDdvhLy29vOV+dhQv36N2q/J5k/SRQuvYh+NBFXK7nYak2TqFWASo/PW?= =?us-ascii?q?wt68LlqRfMTQ2U5nsBSWoWiQZHAxLE7B7hQJj8tDbxu/dn1ymbOc32Sq00WS?= =?us-ascii?q?in4qx2RhLklDsLOjgk+2zRl8d+jr9UoAi5qhJxw4DafpybOvl8caPTctwVWW?= =?us-ascii?q?VPU91NVyFDGI6wc5cDA/YfMetesoLzp0EOrRy7BQS0Gu3tzztIjWLo0K091O?= =?us-ascii?q?QhCh/J3Ak6ENIIq3TfsdL4NLsTUeC3yKnF1jXNb+lI1jjj9YXGbx4vreuLXb?= =?us-ascii?q?Jqfsrc0E8iHB7KgVuMs4LqJS+V1vgTvGiB6eptTfyihnA6pw1vvDWiyMchh4?= =?us-ascii?q?nJiI8VxV3J+yt3zYUrKNC8SUN2Y96pHYdNui+aN4Z7Qd0vTn9mtSs1zrALuI?= =?us-ascii?q?C3ciYMxZ86xBDfc+SKfouV7h75SuqcLit0iGhqdb+9nRq+7Eytx+n6W8Kpyl?= =?us-ascii?q?hFtDBFncPJtn0V0hzT7dWIReVl80e63DaPyxjT6uZZIUAojabbK4Auwro3lp?= =?us-ascii?q?cLskTMBCv2mETzjKCIbEUk/fKk6/jmYrXkop+QLZN7igb5MqQ1hMO/BP43Mg?= =?us-ascii?q?4VX2SB/uS8zrLj8VX4QLVMkPI2jrHUvZPHKcgBuKK0DBNZ3pws5hu9FTuqzd?= =?us-ascii?q?AVkH0fIFJAYh2HjozpO1/UIPD/CPeym0iskDZpx/DCJbDhDI/NIWbdn7j6Zr?= =?us-ascii?q?Zy9lRQyA0pzdBQ/55UEK0OIOrvWk/ts9zVFgM5Mwuzw+bjFNp91pkRWWOJAq?= =?us-ascii?q?KCPqPSq0GH6fw0LOmXeYAZojH9K+Iq5/T2l382hUcdfbW13ZsQcH23A/VmI0?= =?us-ascii?q?CCbHrimNcOD3kFsRElTOP3klGCViRTZ3mqVaIm+j47EJ6mDZvERo21mrOBxj?= =?us-ascii?q?27HppYZ29bEV2MH23oeJuaVPgXcyKdP9VtkjseVbiuGMcd0kSBsALwg4JgNu?= =?us-ascii?q?3KsnkRr4jky9Rd6ffemBsp+XpzFcvLgE+XSGQhooQMDxQx27typEV70R/Xza?= =?us-ascii?q?l6h9R2D9FezchlFAAgOsiPnKRBF9nuV1eZLZ+yQ1G8T4D+DA=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2CIAACswT9f/8cv8FFfGwEBAQEBAQE?= =?us-ascii?q?BBQEBARIBAQEDAwEBAUAHgTIDAQEBCwEBgwNpAUkVjTiGIIISiGWCJZEQCwE?= =?us-ascii?q?BAQEBAQEBATcEAQGETAKCRSU3Bg4CAwEBAQMCBQEBBgEBAQEBAQUEAYYPRUM?= =?us-ascii?q?BDAGBZiKDGgEFOhwjEAsOCi5XBhOGJ7AbgTSFUoQXgQWBOAGNPIIAg2w1Poo?= =?us-ascii?q?0BJsnmxaCbZoVMKAyLbNugXtNMAiDJFAZDZxoPwMwNwIGCgEBAwmJeocZAQE?= X-IPAS-Result: =?us-ascii?q?A2CIAACswT9f/8cv8FFfGwEBAQEBAQEBBQEBARIBAQEDA?= =?us-ascii?q?wEBAUAHgTIDAQEBCwEBgwNpAUkVjTiGIIISiGWCJZEQCwEBAQEBAQEBATcEA?= =?us-ascii?q?QGETAKCRSU3Bg4CAwEBAQMCBQEBBgEBAQEBAQUEAYYPRUMBDAGBZiKDGgEFO?= =?us-ascii?q?hwjEAsOCi5XBhOGJ7AbgTSFUoQXgQWBOAGNPIIAg2w1Poo0BJsnmxaCbZoVM?= =?us-ascii?q?KAyLbNugXtNMAiDJFAZDZxoPwMwNwIGCgEBAwmJeocZAQE?= Received: from 199.47-240-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.240.47.199]) by relay.skynet.be with ESMTP; 21 Aug 2020 14:49:39 +0200 Received: from localhost (localhost [127.0.0.1]) by kalimero.tijl.coosemans.org (8.16.1/8.16.1) with ESMTP id 07LCnbKH025289; Fri, 21 Aug 2020 14:49:38 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Fri, 21 Aug 2020 14:49:36 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Gleb Popov Cc: Dimitry Andric , toolchain@freebsd.org Subject: Re: Undefined reference to __bswapsi2/__bswapdi2 Message-ID: <20200821144936.4d5201e2@FreeBSD.org> In-Reply-To: References: <4616D1DE-55B4-43AA-B8D9-A3C0513C9BC1@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BY1Yy05KLz3cns X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:5432, ipnet:195.238.0.0/19, country:BE] 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: Fri, 21 Aug 2020 12:49:42 -0000 On Fri, 21 Aug 2020 14:54:35 +0400 Gleb Popov wrote: > On Thu, Aug 20, 2020 at 11:53 PM Dimitry Andric wrote: >> On 20 Aug 2020, at 19:52, Gleb Popov wrote: >>> On Wed, Aug 19, 2020 at 10:15 PM Gleb Popov wrote: >>>> 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 >>>> >>>> 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 >>>> >>>> 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 >>>> >>>> What's wrong with that? These functions seem to be present in our >>>> compiler-rt. >>>> >>> >>> 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. > > I see thanks. I worked my problem around by adding implementations of these > functions right into GHC code. The bswap instruction was added in the i486 so something very weird is going on that should be investigated instead of simply worked around.