Re: [PATCH v3] CodeSamples: Work around removal of liburcu-signal

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

 



On Sat, 2024-12-28 at 15:40 -0300, Leonardo Brás wrote:
> On Sat, 2024-12-28 at 10:04 -0800, Paul E. McKenney wrote:
> > On Sat, Dec 28, 2024 at 04:12:40PM +0900, Akira Yokosawa wrote:
> > > From: Leonardo Bras <leobras.c@xxxxxxxxx>
> > > 
> > > liburcu 0.15.0 deprecated urcu-signal as a library.
> > > This causes build errors in gitlab-CI [1]:
> > > 
> > >     /usr/sbin/ld: cannot find -lurcu-signal: No such file or directory
> > >     collect2: error: ld returned 1 exit status
> > > 
> > > Work around them by adding command lines w/o "-lurcu-signal" as
> > > fallbacks in relevant Makefile recipes.
> > > 
> > > Link: https://gitlab.com/linux-kernel/perfbook/-/jobs/8732944799 [1]
> > > Signed-off-by: Leonardo Bras <leobras.c@xxxxxxxxx>
> > > Co-developed-by: Akira Yokosawa <akiyks@xxxxxxxxx>
> > > [akiyks: rewrite changelog, restore compatibility with liburcu <0.15.0]
> > > Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
> > > ---
> > > Hi,
> > > 
> > > Admittedly, this is one of the least elegant workaround for ArchLinux
> > > and soon-to-be upgraded other rolling distros, but still looks straight
> > > forward to me.
> > > 
> > > Can you live with this?
> > 
> > Thank you both for digging into this!!!
> > 
> > I believe that we can, and I am inclined to take this.  But first,
> > a couple of questions:
> > 
> > 1.	Can this be some sort of macro or script so that we don't have
> > 	to keep the arguments of the commands in each pair in sync?
> > 
> > 2.	Is it possible to try the new version first, so that only old
> > 	systems pay the double-compilation price?
> 
> While (2) is cleaner and quite possible by:
> a) keeping a $VAR_COMPAT_SIGNAL variable that can get
> 	"-lurcu-signal" if a test compilation fails, and
> 	""              otherwise,

or simply 
VAR_COMPAT_SIGNAL=$(pkg-config --libs liburcu-signal)

(which results on an empty string if liburcu-signal is not available and 
"-lurcu-signal" otherwise)

> b) adding this variable instead of -lurcu-signal in every command,
> 
> I really doubt we need to add this complexity, as I don't think anyone is using
> a 10 years old kernel to run those tests.
> 
> Also, there is the fallback option mentioned by Paul.
> 
> Honestly, I would go with v2 to avoid adding complexity.
> 
> Thanks!
> Leo
> 
> > 
> > It is quite possible that the answer to the questions is "yes", but that
> > the result is excessively complex, so please do not put too much time
> > into this.  As I said above, I am inclined to take this.
> > 
> > > This is tested against Ubuntu 20.04 LTS (liburcu 0.11.1),
> > > Ubuntu 24.04 LTS (liburcu 0.14.0), Fedora 41 (liburcu 0.14.1),
> > > and ArchLinux (liburcu 0.15.0).
> > 
> > Thank you very much for testing all these possibilities!
> > 
> > 							Thanx, Paul
> > 
> > >         Thanks, Akira
> > > --
> > >  CodeSamples/datastruct/Issaquah/Makefile  |  6 +++--
> > >  CodeSamples/datastruct/existence/Makefile | 30 +++++++++++++++--------
> > >  CodeSamples/datastruct/hash/Makefile      |  9 ++++---
> > >  CodeSamples/datastruct/skiplist/Makefile  |  6 +++--
> > >  CodeSamples/defer/Makefile                |  9 ++++---
> > >  5 files changed, 40 insertions(+), 20 deletions(-)
> > > 
> > > diff --git a/CodeSamples/datastruct/Issaquah/Makefile b/CodeSamples/datastruct/Issaquah/Makefile
> > > index c3b724d7..75fd840b 100644
> > > --- a/CodeSamples/datastruct/Issaquah/Makefile
> > > +++ b/CodeSamples/datastruct/Issaquah/Makefile
> > > @@ -45,10 +45,12 @@ GCC_ARGS += -fcommon
> > >  #	 Verify by using the nm command and searching output for malloc.
> > >  
> > >  existence_test: existence.c existence_test.c
> > > -	cc $(GCC_ARGS) -o existence_test existence.c existence_test.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -o existence_test existence.c existence_test.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -o existence_test existence.c existence_test.c -lpthread -lurcu
> > >  
> > >  treetorture: tree.c existence.c spinlockmult.c $(LIB)/random.c ../../api.h treetorture.h treetorturetrace.h $(LIB)/random.h existence.h tree.h
> > > -	cc $(GCC_ARGS) -o treetorture tree.c existence.c spinlockmult.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -o treetorture tree.c existence.c spinlockmult.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -o treetorture tree.c existence.c spinlockmult.c $(LIB)/random.c -lpthread -lurcu
> > >  
> > >  clean:
> > >  	rm -f $(PROGS)
> > > diff --git a/CodeSamples/datastruct/existence/Makefile b/CodeSamples/datastruct/existence/Makefile
> > > index 19891c0f..568e7c2d 100644
> > > --- a/CodeSamples/datastruct/existence/Makefile
> > > +++ b/CodeSamples/datastruct/existence/Makefile
> > > @@ -44,39 +44,49 @@ all: $(PROGS)
> > >  #	So it is quite a bit easier to just use the default locations.  ;-)
> > >  
> > >  existence_test: existence.h existence_test.c procon.h
> > > -	cc $(GCC_ARGS) -o existence_test existence_test.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -o existence_test existence_test.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -o existence_test existence_test.c -lpthread -lurcu
> > >  
> > >  existence_3hash_test: existence.h hash_exists.h keyvalue.h existence_3hash_test.c procon.h
> > > -	cc $(GCC_ARGS) -o existence_3hash_test existence_3hash_test.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -o existence_3hash_test existence_3hash_test.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -o existence_3hash_test existence_3hash_test.c -lpthread -lurcu
> > >  
> > >  existence_3hash_uperf: existence.h hash_exists.h keyvalue.h existence_3hash_uperf.c procon.h
> > >  	# cc -O0 -Wall -ggdb -fno-inline -o existence_3hash_uperf existence_3hash_uperf.c -ltcmalloc -lpthread -lurcu -lurcu-signal
> > > -	cc $(GCC_ARGS) -o existence_3hash_uperf existence_3hash_uperf.c -ltcmalloc -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -o existence_3hash_uperf existence_3hash_uperf.c -ltcmalloc -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -o existence_3hash_uperf existence_3hash_uperf.c -ltcmalloc -lpthread -lurcu
> > >  
> > >  existence_3skiplist_test: existence.h skiplist_exists.h keyvalue.h existence_3skiplist_test.c procon.h
> > > -	cc -g -O0 -o existence_3skiplist_test existence_3skiplist_test.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > > +	cc -g -O0 -o existence_3skiplist_test existence_3skiplist_test.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc -g -O0 -o existence_3skiplist_test existence_3skiplist_test.c $(LIB)/random.c -lpthread -lurcu
> > >  	# cc $(GCC_ARGS) -o existence_3skiplist_test existence_3skiplist_test.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > >  
> > >  existence_3skiplist_uperf: existence.h hash_exists.h keyvalue.h existence_3skiplist_uperf.c procon.h
> > >  	# cc -O0 -Wall -ggdb -fno-inline -o existence_3skiplist_uperf existence_3skiplist_uperf.c -ltcmalloc $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > > -	cc $(GCC_ARGS) -o existence_3skiplist_uperf existence_3skiplist_uperf.c -ltcmalloc $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -o existence_3skiplist_uperf existence_3skiplist_uperf.c -ltcmalloc $(LIB)/random.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -o existence_3skiplist_uperf existence_3skiplist_uperf.c -ltcmalloc $(LIB)/random.c -lpthread -lurcu
> > >  
> > >  kaleidoscope_test: kaleidoscope.h kaleidoscope_test.c procon.h
> > > -	cc $(GCC_ARGS) -o kaleidoscope_test kaleidoscope_test.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -o kaleidoscope_test kaleidoscope_test.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -o kaleidoscope_test kaleidoscope_test.c -lpthread -lurcu
> > >  
> > >  kaleidoscope_3hash_test: kaleidoscope.h hash_exists.h keyvalue.h kaleidoscope_3hash_test.c procon.h
> > > -	cc $(GCC_ARGS) -o kaleidoscope_3hash_test kaleidoscope_3hash_test.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -o kaleidoscope_3hash_test kaleidoscope_3hash_test.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -o kaleidoscope_3hash_test kaleidoscope_3hash_test.c -lpthread -lurcu
> > >  
> > >  kaleidoscope_3skiplist_test: kaleidoscope.h skiplist_exists.h keyvalue.h kaleidoscope_3skiplist_test.c procon.h
> > > -	cc -g -O0 -o kaleidoscope_3skiplist_test kaleidoscope_3skiplist_test.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > > +	cc -g -O0 -o kaleidoscope_3skiplist_test kaleidoscope_3skiplist_test.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc -g -O0 -o kaleidoscope_3skiplist_test kaleidoscope_3skiplist_test.c $(LIB)/random.c -lpthread -lurcu
> > >  	# cc $(GCC_ARGS) -o kaleidoscope_3skiplist_test kaleidoscope_3skiplist_test.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > >  
> > >  kaleidoscope_skiphash_test: kaleidoscope.h skiplist_exists.h keyvalue.h kaleidoscope_skiphash_test.c procon.h
> > > -	cc -g -O0 -o kaleidoscope_skiphash_test kaleidoscope_skiphash_test.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > > +	cc -g -O0 -o kaleidoscope_skiphash_test kaleidoscope_skiphash_test.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc -g -O0 -o kaleidoscope_skiphash_test kaleidoscope_skiphash_test.c $(LIB)/random.c -lpthread -lurcu
> > >  	# cc $(GCC_ARGS) -o kaleidoscope_skiphash_test kaleidoscope_skiphash_test.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > >  
> > >  procon_test: procon.h procon_test.c
> > > -	cc -O0 -g -o procon_test procon_test.c -lpthread -lurcu -lurcu-signal
> > > +	cc -O0 -g -o procon_test procon_test.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc -O0 -g -o procon_test procon_test.c -lpthread -lurcu
> > >  	# cc $(GCC_ARGS) -o procon_test procon_test.c -lpthread -lurcu -lurcu-signal
> > >  
> > >  clean:
> > > diff --git a/CodeSamples/datastruct/hash/Makefile b/CodeSamples/datastruct/hash/Makefile
> > > index a56255a2..a558dfee 100644
> > > --- a/CodeSamples/datastruct/hash/Makefile
> > > +++ b/CodeSamples/datastruct/hash/Makefile
> > > @@ -44,7 +44,8 @@ hash_bkt_qsbr: hash_bkt_rcu.c ../../api.h hashtorture.h
> > >  	cc $(GCC_ARGS) -DTEST_HASH -DPERFBOOK_RCU_QSBR -o hash_bkt_qsbr hash_bkt_rcu.c $(LIB)/random.c -lpthread -lurcu -lurcu-qsbr
> > >  
> > >  hash_bkt_rcu: hash_bkt_rcu.c ../../api.h hashtorture.h
> > > -	cc $(GCC_ARGS) -DTEST_HASH -o hash_bkt_rcu hash_bkt_rcu.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -DTEST_HASH -o hash_bkt_rcu hash_bkt_rcu.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -DTEST_HASH -o hash_bkt_rcu hash_bkt_rcu.c $(LIB)/random.c -lpthread -lurcu
> > >  
> > >  hash_bkt_hazptr: hash_bkt_hazptr.c ../../defer/hazptr.c ../../defer/hazptr.h ../../api.h hashtorture.h
> > >  	cc $(GCC_ARGS) -DTEST_HASH -o hash_bkt_hazptr hash_bkt_hazptr.c ../../defer/hazptr.c $(LIB)/random.c -lpthread
> > > @@ -53,10 +54,12 @@ hash_global: hash_global.c ../../api.h hashtorture.h
> > >  	cc $(GCC_ARGS) -DTEST_HASH -o hash_global hash_global.c $(LIB)/random.c -lpthread
> > >  
> > >  hash_resize: hash_resize.c ../../api.h hashtorture.h
> > > -	cc $(GCC_ARGS) -DTEST_HASH -o hash_resize hash_resize.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -DTEST_HASH -o hash_resize hash_resize.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -DTEST_HASH -o hash_resize hash_resize.c $(LIB)/random.c -lpthread -lurcu
> > >  
> > >  hash_resize_s: hash_resize_s.c ../../api.h hashtorture.h
> > > -	cc $(GCC_ARGS) -DTEST_HASH -o hash_resize_s hash_resize_s.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -DTEST_HASH -o hash_resize_s hash_resize_s.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -DTEST_HASH -o hash_resize_s hash_resize_s.c $(LIB)/random.c -lpthread -lurcu
> > >  
> > >  hash_unsync: hash_unsync.c ../../api.h hashtorture.h
> > >  	cc $(GCC_ARGS) -DTEST_HASH -o hash_unsync hash_unsync.c $(LIB)/random.c -lpthread
> > > diff --git a/CodeSamples/datastruct/skiplist/Makefile b/CodeSamples/datastruct/skiplist/Makefile
> > > index 3a555691..8cf9d47a 100644
> > > --- a/CodeSamples/datastruct/skiplist/Makefile
> > > +++ b/CodeSamples/datastruct/skiplist/Makefile
> > > @@ -33,10 +33,12 @@ endif
> > >  include $(top)/recipes.mk
> > >  
> > >  skiplist: skiplist.c ../../api.h skiplisttorture.h skiplist.h
> > > -	cc $(GCC_ARGS) -DTEST_SKIPLIST -I $(LIB) -g -o skiplist skiplist.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -DTEST_SKIPLIST -I $(LIB) -g -o skiplist skiplist.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -DTEST_SKIPLIST -I $(LIB) -g -o skiplist skiplist.c $(LIB)/random.c -lpthread -lurcu
> > >  
> > >  skiplist_glock: skiplist_glock.c ../../api.h skiplisttorture.h skiplist.h
> > > -	cc $(GCC_ARGS) -DTEST_SKIPLIST -I $(LIB) -g -o skiplist_glock skiplist_glock.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -DTEST_SKIPLIST -I $(LIB) -g -o skiplist_glock skiplist_glock.c $(LIB)/random.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -DTEST_SKIPLIST -I $(LIB) -g -o skiplist_glock skiplist_glock.c $(LIB)/random.c -lpthread -lurcu
> > >  
> > >  clean:
> > >  	rm -f $(PROGS)
> > > diff --git a/CodeSamples/defer/Makefile b/CodeSamples/defer/Makefile
> > > index 3cf3e5a5..b4af17db 100644
> > > --- a/CodeSamples/defer/Makefile
> > > +++ b/CodeSamples/defer/Makefile
> > > @@ -80,7 +80,8 @@ hazptr: hazptr.c hazptr.h ../api.h hazptrtorture.h
> > >  	cc $(GCC_ARGS) -o hazptr -DTEST hazptr.c -lpthread
> > >  
> > >  ptxroute: ptxroute.c ../api.h
> > > -	cc $(GCC_ARGS) -o ptxroute ptxroute.c -lpthread -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -o ptxroute ptxroute.c -lpthread -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -o ptxroute ptxroute.c -lpthread -lurcu
> > >  
> > >  rcu: rcu.c rcu.h ../api.h rcutorture.h
> > >  	cc $(GCC_ARGS) -o rcu -DTEST rcu.c -lpthread
> > > @@ -131,7 +132,8 @@ route_hazptr: route_hazptr.c hazptr.c hazptr.h ../api.h ../lib/random.h ../lib/r
> > >  	cc $(GCC_ARGS) -o route_hazptr route_hazptr.c hazptr.c ../lib/random.c -lpthread
> > >  
> > >  route_rcu: route_rcu.c ../api.h ../lib/random.h ../lib/random.c routetorture.h
> > > -	cc $(GCC_ARGS) -o route_rcu route_rcu.c ../lib/random.c -lpthread  -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -o route_rcu route_rcu.c ../lib/random.c -lpthread  -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -o route_rcu route_rcu.c ../lib/random.c -lpthread  -lurcu
> > >  
> > >  route_rcu_qsbr: route_rcu.c ../api.h ../lib/random.h ../lib/random.c routetorture.h
> > >  	cc $(GCC_ARGS) -o route_rcu_qsbr -DDO_QSBR route_rcu.c ../lib/random.c -lpthread  -lurcu-qsbr
> > > @@ -149,7 +151,8 @@ seqlocktorture: seqlocktorture.c seqlock.h ../api.h
> > >  	cc $(GCC_ARGS) -o seqlocktorture seqlocktorture.c -lpthread
> > >  
> > >  singleton: singleton.c ../api.h ../lib/random.h ../lib/random.c
> > > -	cc $(GCC_ARGS) -Wall -g -o singleton singleton.c ../lib/random.c -lpthread  -lurcu -lurcu-signal
> > > +	cc $(GCC_ARGS) -Wall -g -o singleton singleton.c ../lib/random.c -lpthread  -lurcu -lurcu-signal || \
> > > +	cc $(GCC_ARGS) -Wall -g -o singleton singleton.c ../lib/random.c -lpthread  -lurcu
> > >  
> > >  clean:
> > >  	rm -f $(PROGS)
> > > 
> > > base-commit: 4c0afec5a7081227adc768fb8d3fb35aa1981d55
> > > -- 
> > > 2.34.1
> > > 
> 






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux