From owner-freebsd-toolchain@freebsd.org Fri Aug 21 10:55:04 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 8B3813BA599 for ; Fri, 21 Aug 2020 10:55:04 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4BXz1h2RzLz3WxQ for ; Fri, 21 Aug 2020 10:55:04 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id 540613BA607; Fri, 21 Aug 2020 10:55:04 +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 53CBD3BA598 for ; Fri, 21 Aug 2020 10:55:04 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BXz1g3pFCz3WxP; Fri, 21 Aug 2020 10:55:03 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: by mail-lj1-f180.google.com with SMTP id 185so1349068ljj.7; Fri, 21 Aug 2020 03:55:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W+EV3za4B0fKSGFDijvI4UGrLbRaOu15xK2eoMywPcQ=; b=GvDNoNwp6B77NUwKmHhciB40jlPyTziBr26KGqqyfAdtbyG48VPC29eLBF78SLp/wM Lm8/7tfQh4IacD5qT9ykvVgHujbPp4sgjUpGVXtv/2bertzyiZOtoMc/RWVotPd3cbZf z8DdnQOCXG3HTCM+YmjfRi5HmmERIfplsevDGcAuxdkWKRpIr9uZJE7rEHR2zGA+rZCl 9UNgHaMEs2kB/0+tHA9Lf5f2sV2s4zjTx9QspLgW2SvJVrwViQhXwugw2Ow7sKIfOhkY qj0GeTQamLNtytvPQE0lTm08E4jqrapfyWXnhEpnR/nb45eJymbGTSDM/RWJEqYCo3Wm iaiQ== X-Gm-Message-State: AOAM530ojyEBFC7JFJlp5erkwiNuIX4URl7393tdUnqCVA4ZmHnVhJXG QyU1VvyocgMoALMPguYMg6VTwl9HUNj7pw== X-Google-Smtp-Source: ABdhPJxQYiUe/8nYZJxWOnCqWhJlAvY8qmYoJa87DDen9FaLgY4t4OLCTmiaoUsKUZY6gxuyPze5qQ== X-Received: by 2002:a2e:87c1:: with SMTP id v1mr1281756ljj.384.1598007301665; Fri, 21 Aug 2020 03:55:01 -0700 (PDT) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by smtp.gmail.com with ESMTPSA id h26sm313250lfj.20.2020.08.21.03.55.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Aug 2020 03:55:01 -0700 (PDT) Received: by mail-lf1-f42.google.com with SMTP id i19so700553lfj.8; Fri, 21 Aug 2020 03:55:01 -0700 (PDT) X-Received: by 2002:a19:431c:: with SMTP id q28mr1161999lfa.211.1598007301022; Fri, 21 Aug 2020 03:55:01 -0700 (PDT) MIME-Version: 1.0 References: <4616D1DE-55B4-43AA-B8D9-A3C0513C9BC1@FreeBSD.org> In-Reply-To: <4616D1DE-55B4-43AA-B8D9-A3C0513C9BC1@FreeBSD.org> From: Gleb Popov Date: Fri, 21 Aug 2020 14:54:35 +0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Undefined reference to __bswapsi2/__bswapdi2 To: Dimitry Andric Cc: toolchain@freebsd.org X-Rspamd-Queue-Id: 4BXz1g3pFCz3WxP X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 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 10:55:04 -0000 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: > > > >> Hi toolchain@ > >> > >> 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. > > -Dimitry > > I see thanks. I worked my problem around by adding implementations of these functions right into GHC code.