Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Aug 2020 14:37:42 +0200
From:      =?UTF-8?B?VMSzbA==?= Coosemans <tijl@FreeBSD.org>
To:        Gleb Popov <arrowd@freebsd.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, toolchain@freebsd.org
Subject:   Re: Undefined reference to __atomic_store_8
Message-ID:  <20200809143742.430764e7@FreeBSD.org>
In-Reply-To: <CALH631nqdHq02xYM4cnOaPhmB5L3O5TJyZiKVNrUJu7kHg0uFQ@mail.gmail.com>
References:  <CALH631msD2jEwaH2ejzdE5RCYd=CA2GYV-o-%2BfC6sPSskXdkTg@mail.gmail.com> <20200807212855.GB2551@kib.kiev.ua> <CALH631=FxoEdp_akV-szxTuLVrZ4oFgHWKcWJNOGEuLwqJ3Hyw@mail.gmail.com> <20200808133000.GC2551@kib.kiev.ua> <CALH631nqdHq02xYM4cnOaPhmB5L3O5TJyZiKVNrUJu7kHg0uFQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 9 Aug 2020 15:36:51 +0400 Gleb Popov <arrowd@freebsd.org> wrote:
> On Sat, Aug 8, 2020 at 5:30 PM Konstantin Belousov <kostikbel@gmail.com>
> wrote:
>> For code generated by gcc or clang, yes.
>> If the reference to the symbol was generated by ghc, then I do not know.
> 
> This doesn't seem to work.
> 
> The code referencing __atomic_load_n() is C and GHC buildsystem already
> passes -march=i686. Still, the problem persists.
> Interestingly, 12.1-RELEASE-p2 doesn't have this problem, but
> 12.1-RELEASE-p7 does.
> 
> What library provides these symbols when clang is used? And I'm a bit
> obscured how -march flag can affect these symbols' visibility at all?

There is no such library.  i586 supports 64 bit atomic operations so
the compiler should emit instructions for that instead of a function
call.  Check that *.o files that match "__atomic_load" are in fact built
with -march.

12.1-RELEASE-p7 probably has a newer clang that fixed an issue where the
compiler would always emit instructions, even for i386 and i486.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200809143742.430764e7>