NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-sparc/58352: ld: /usr/lib/libubsan.so: undefined reference to `__sync_val_compare_and_swap_8'



On 2024/06/19 23:55, Martin Husemann wrote:
The following reply was made to PR port-sparc/58352; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: port-sparc/58352: ld: /usr/lib/libubsan.so: undefined reference
  to `__sync_val_compare_and_swap_8'
Date: Wed, 19 Jun 2024 16:51:37 +0200

  On Wed, Jun 19, 2024 at 02:45:02PM +0000, Rin Okuyama wrote:
  >  (3) Earliest CPU model satisfy (2) seems `ultrasparc3`, IIUC:
  >  (I'm not familiar to sparc although...)
All ultrasparc CPUs support VIS and can do 64bit atomic ops. The ultrasparc3 introduced "VIS 2" with additional instructions.

Hmm, I tried `-mcpu=ultrasparc`, but generated library has reference to
__sync_val_compare_and_swap_8. I've not figured out why, at the moment.

  However, for 32bit sparc CPUs we can not assume support (and it is pretty
  lame of ubsan to use it). Can we patch the ubsan code to only require 64bit
  atomics #ifdef _LP64 ?

Yeah, this is just what I tried. It works at least on i386, but
diff is *really* large:

https://gist.github.com/rokuyama/24d0ed7e537fffc07e2975c3880817f1

I wonder whether we can ship atomic64 runtime routines with
lib*san as, e.g., hidden symbols...

Thanks,
rin


Home | Main Index | Thread Index | Old Index