NetBSD-Bugs archive

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

Re: port-sparc64/60518: sparc64 compat32 is not compatible enough



The following reply was made to PR port-sparc64/60518; it has been noted by GNATS.

From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: Taylor R Campbell <riastradh%NetBSD.org@localhost>
Subject: Re: port-sparc64/60518: sparc64 compat32 is not compatible enough
Date: Thu, 30 Jul 2026 12:28:26 +0300

 On Wed, Jul 29, 2026 at 23:29:53 +0000, Taylor R Campbell wrote:
 
 > https://nxr.NetBSD.org/xref/src/common/lib/libc/arch/sparc/atomic/Makefile.inc?r=1.24#5
 > 
 > Try adding the following files to it (Makefile.inc rev. 1.18 from
 > back in 2014):
 
 Oh, I did...  I have this patch saved in my tree from ~1.5 years ago
 or so.  I never made it compile b/c of name clashes iirc
 (unfortunately I don't seem to have the logs saved), but I'm really
 just turning various knobs blidly here.  As I said, I have no idea
 which names in that set of several dozens are needed for what etc, and
 working off of the nm diff ran into a wall and I need help from
 someone with a clue.
 
 I'll try to get back to this patch later this week and see what fails,
 but I'll need a licensed professional to make sense of the results.
 
 Thanks!
 
 Index: Makefile.inc
 ===================================================================
 RCS file: /cvsroot/src/common/lib/libc/arch/sparc/atomic/Makefile.inc,v
 retrieving revision 1.24
 diff -u -p -p -r1.24 Makefile.inc
 --- Makefile.inc	30 Mar 2023 15:03:36 -0000	1.24
 +++ Makefile.inc	27 Jun 2026 10:30:02 -0000
 @@ -13,13 +13,57 @@ SPARC64DIR=	${.PARSEDIR}/../../sparc64/a
  
  .include "${SPARC64DIR}/Makefile.inc"
  
 -.if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
 -	|| ${LIB} == "rump")
 +. if defined(LIB)
 +
 +.  if (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
 +    || ${LIB} == "rump")
 +# sparc64 -m32
  SRCS+=	atomic_nand_64_cas.c atomic_xor_64_cas.c atomic_sub_64_cas.c \
  	atomic_cas_64_cas.c
 +
 +# SRCS+=	atomic_add_32_nv_cas.c	# __atomic_add_fetch_4
  .endif
  
 -.else
 +
 +.  if ${LIB} == "c"
 +
 +# XXX: also pthread
 +# XXX: multiple inits...
 +# SRCS+=	atomic_init_testset.c
 +
 +# __atomic_compare_exchange_<n>
 +SRCS+=	atomic_c11_compare_exchange_cas_8.c
 +SRCS+=	atomic_c11_compare_exchange_cas_16.c
 +SRCS+=	atomic_c11_compare_exchange_cas_32.c
 +
 +# __atomic_exchange_<n>
 +# __sync_lock_test_and_set_<n>
 +SRCS+=	atomic_swap_8_cas.c atomic_swap_16_cas.c # atomic_swap_32_cas.c
 +
 +# __sync_bool_compare_and_swap_<n>
 +SRCS+=	atomic_cas_8_cas.c  atomic_cas_16_cas.c  atomic_cas_32_cas.c
 +
 +# The 32 versions come from atomic_<op>.c
 +# __atomic_fetch_<op>_<n>
 +# __sync_fetch_and_<op>_<n>
 +# __sync_<op>_and_fetch_<n>
 +SRCS+=	atomic_add_8_cas.c  atomic_add_16_cas.c
 +SRCS+=	atomic_and_8_cas.c  atomic_and_16_cas.c
 +SRCS+=	atomic_nand_8_cas.c atomic_nand_16_cas.c
 +SRCS+=	atomic_or_8_cas.c   atomic_or_16_cas.c
 +SRCS+=	atomic_sub_8_cas.c  atomic_sub_16_cas.c
 +SRCS+=	atomic_xor_8_cas.c  atomic_xor_16_cas.c
 +
 +SRCS+=	atomic_load.c atomic_store.c
 +SRCS+=	atomic_is_lock_free.c
 +
 +.  endif # libc
 +
 +.endif	# LIB
 +
 +
 +
 +.else	# sparc
  
  . if defined(LIB)
  
 
 
 -uwe
 



Home | Main Index | Thread Index | Old Index