* Re: [PATCH v3] CodeSamples: Work around removal of liburcu-signal
2024-12-28 7:12 [PATCH v3] CodeSamples: Work around removal of liburcu-signal Akira Yokosawa
@ 2024-12-28 18:04 ` Paul E. McKenney
2024-12-28 18:40 ` Leonardo Brás
2024-12-28 18:23 ` Leonardo Brás
2024-12-28 18:30 ` Leonardo Brás
2 siblings, 1 reply; 10+ messages in thread
From: Paul E. McKenney @ 2024-12-28 18:04 UTC (permalink / raw)
To: Akira Yokosawa; +Cc: Leonardo Bras, perfbook
On Sat, Dec 28, 2024 at 04:12:40PM +0900, Akira Yokosawa wrote:
> From: Leonardo Bras <leobras.c@gmail.com>
>
> 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@gmail.com>
> Co-developed-by: Akira Yokosawa <akiyks@gmail.com>
> [akiyks: rewrite changelog, restore compatibility with liburcu <0.15.0]
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> ---
> 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?
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
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3] CodeSamples: Work around removal of liburcu-signal
2024-12-28 18:04 ` Paul E. McKenney
@ 2024-12-28 18:40 ` Leonardo Brás
2024-12-28 18:49 ` Leonardo Brás
0 siblings, 1 reply; 10+ messages in thread
From: Leonardo Brás @ 2024-12-28 18:40 UTC (permalink / raw)
To: paulmck, Akira Yokosawa; +Cc: perfbook
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@gmail.com>
> >
> > 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@gmail.com>
> > Co-developed-by: Akira Yokosawa <akiyks@gmail.com>
> > [akiyks: rewrite changelog, restore compatibility with liburcu <0.15.0]
> > Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> > ---
> > 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,
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
> >
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3] CodeSamples: Work around removal of liburcu-signal
2024-12-28 18:40 ` Leonardo Brás
@ 2024-12-28 18:49 ` Leonardo Brás
0 siblings, 0 replies; 10+ messages in thread
From: Leonardo Brás @ 2024-12-28 18:49 UTC (permalink / raw)
To: paulmck, Akira Yokosawa; +Cc: perfbook
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@gmail.com>
> > >
> > > 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@gmail.com>
> > > Co-developed-by: Akira Yokosawa <akiyks@gmail.com>
> > > [akiyks: rewrite changelog, restore compatibility with liburcu <0.15.0]
> > > Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> > > ---
> > > 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
> > >
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3] CodeSamples: Work around removal of liburcu-signal
2024-12-28 7:12 [PATCH v3] CodeSamples: Work around removal of liburcu-signal Akira Yokosawa
2024-12-28 18:04 ` Paul E. McKenney
@ 2024-12-28 18:23 ` Leonardo Brás
2024-12-28 18:26 ` Leonardo Brás
2024-12-28 18:30 ` Leonardo Brás
2 siblings, 1 reply; 10+ messages in thread
From: Leonardo Brás @ 2024-12-28 18:23 UTC (permalink / raw)
To: Akira Yokosawa, Paul E. McKenney; +Cc: perfbook
On Sat, 2024-12-28 at 16:12 +0900, Akira Yokosawa wrote:
> From: Leonardo Bras <leobras.c@gmail.com>
>
> 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@gmail.com>
> Co-developed-by: Akira Yokosawa <akiyks@gmail.com>
> [akiyks: rewrite changelog, restore compatibility with liburcu <0.15.0]
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> ---
> 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?
>
> 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).
>
> 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
Hi Akira,
That's a creative way of dealing with this issue, but if we want to add that
complexity, I would rather use $(pkg-config --libs liburcu).
Wouldn't this fix the issue as well?
Thanks!
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3] CodeSamples: Work around removal of liburcu-signal
2024-12-28 18:23 ` Leonardo Brás
@ 2024-12-28 18:26 ` Leonardo Brás
2024-12-29 0:17 ` Akira Yokosawa
0 siblings, 1 reply; 10+ messages in thread
From: Leonardo Brás @ 2024-12-28 18:26 UTC (permalink / raw)
To: Akira Yokosawa, Paul E. McKenney; +Cc: perfbook
On Sat, 2024-12-28 at 15:23 -0300, Leonardo Brás wrote:
> On Sat, 2024-12-28 at 16:12 +0900, Akira Yokosawa wrote:
> > From: Leonardo Bras <leobras.c@gmail.com>
> >
> > 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@gmail.com>
> > Co-developed-by: Akira Yokosawa <akiyks@gmail.com>
> > [akiyks: rewrite changelog, restore compatibility with liburcu <0.15.0]
> > Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> > ---
> > 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?
> >
> > 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).
> >
> > 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
>
> Hi Akira,
>
> That's a creative way of dealing with this issue, but if we want to add that
> complexity, I would rather use $(pkg-config --libs liburcu).
>
> Wouldn't this fix the issue as well?
>
> Thanks!
Also, according to Paul's comment on v2 patch it shouldn't be needed:
> > On the other hand, sys_membarrier() was introduced in 2015 (5b25b13ab08f6),
> > and no supported kernel (>v4.2) should still miss this syscall. Is it worth
> > the added complexity? Is so, let's do it.
> If the -lurcu-signal is left off for old versions of the userspace RCU
> library, doesn't it simply fall back to using explicit memory barriers?
> Or am I yet again misremembering?
> Thanx, Paul
Isn't the above correct?
Thanks!
Leo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3] CodeSamples: Work around removal of liburcu-signal
2024-12-28 18:26 ` Leonardo Brás
@ 2024-12-29 0:17 ` Akira Yokosawa
2024-12-29 0:33 ` Akira Yokosawa
2024-12-29 2:25 ` Leonardo Brás
0 siblings, 2 replies; 10+ messages in thread
From: Akira Yokosawa @ 2024-12-29 0:17 UTC (permalink / raw)
To: Leonardo Brás, Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
Hi,
Leonardo Brás wrote:
[...]
>> Hi Akira,
>>
>> That's a creative way of dealing with this issue, but if we want to add that
>> complexity, I would rather use $(pkg-config --libs liburcu).
>>
>> Wouldn't this fix the issue as well?
>>
>> Thanks!
>
> Also, according to Paul's comment on v2 patch it shouldn't be needed:
>
>>> On the other hand, sys_membarrier() was introduced in 2015 (5b25b13ab08f6),
>>> and no supported kernel (>v4.2) should still miss this syscall. Is it worth
>>> the added complexity? Is so, let's do it.
>
>> If the -lurcu-signal is left off for old versions of the userspace RCU
>> library, doesn't it simply fall back to using explicit memory barriers?
>> Or am I yet again misremembering?
>
>> Thanx, Paul
>
> Isn't the above correct?
>
I have no idea ..., but your v2 patch causes this build error with
liburcu <15.0:
------------------------------------------------------------------------
cc -g -O3 -Wall -fcommon -o route_rcu route_rcu.c ../lib/random.c -lpthread -lurcu
/usr/bin/ld: /tmp/ccjHTQfN.o: warning: relocation against `urcu_signal_gp' in read-only section `.text'
/usr/bin/ld: /tmp/ccjHTQfN.o: in function `_urcu_signal_read_lock':
/usr/include/x86_64-linux-gnu/urcu/static/urcu-signal.h:97: undefined reference to `urcu_signal_reader'
/usr/bin/ld: /tmp/ccjHTQfN.o: in function `_urcu_signal_read_lock_update':
/usr/include/x86_64-linux-gnu/urcu/static/urcu-signal.h:75: undefined reference to `urcu_signal_gp'
/usr/bin/ld: /tmp/ccjHTQfN.o: in function `urcu_common_wake_up_gp':
/usr/include/x86_64-linux-gnu/urcu/static/urcu-common.h:96: undefined reference to `urcu_signal_gp'
/usr/bin/ld: /usr/include/x86_64-linux-gnu/urcu/static/urcu-common.h:96: undefined reference to `urcu_signal_gp'
/usr/bin/ld: /usr/include/x86_64-linux-gnu/urcu/static/urcu-common.h:97: undefined reference to `urcu_signal_gp'
/usr/bin/ld: /tmp/ccjHTQfN.o: in function `futex':
/usr/include/x86_64-linux-gnu/urcu/futex.h:72: undefined reference to `urcu_signal_gp'
/usr/bin/ld: /tmp/ccjHTQfN.o:/usr/include/x86_64-linux-gnu/urcu/static/urcu-common.h:97: more undefined references to `urcu_signal_gp' follow
/usr/bin/ld: /tmp/ccjHTQfN.o: in function `perftest_reader':
git/perfbook/CodeSamples/defer/routetorture.h:103: undefined reference to `urcu_signal_register_thread'
/usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:126: undefined reference to `urcu_signal_synchronize_rcu'
/usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:128: undefined reference to `urcu_signal_synchronize_rcu'
/usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:130: undefined reference to `urcu_signal_unregister_thread'
/usr/bin/ld: /tmp/ccjHTQfN.o: in function `route_del':
git/perfbook/CodeSamples/defer/route_rcu.c:124: undefined reference to `urcu_signal_call_rcu'
/usr/bin/ld: /tmp/ccjHTQfN.o: in function `stresstest_updater':
git/perfbook/CodeSamples/defer/routetorture.h:216: undefined reference to `urcu_signal_register_thread'
/usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:260: undefined reference to `urcu_signal_synchronize_rcu'
/usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:262: undefined reference to `urcu_signal_synchronize_rcu'
/usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:264: undefined reference to `urcu_signal_unregister_thread'
/usr/bin/ld: /tmp/ccjHTQfN.o: in function `route_clear':
git/perfbook/CodeSamples/defer/route_rcu.c:149: undefined reference to `urcu_signal_synchronize_rcu'
/usr/bin/ld: /tmp/ccjHTQfN.o: in function `smoketest':
git/perfbook/CodeSamples/defer/routetorture.h:47: undefined reference to `urcu_signal_register_thread'
/usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:62: undefined reference to `urcu_signal_unregister_thread'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:134: route_rcu] Error 1
make[1]: Leaving directory 'git/perfbook/CodeSamples/defer'
----------------------------------------------------------------
This is under Ubuntu 22.04 LTS.
This looks to me as an unacceptable build regression.
The use of $(pkg-config --libs liburcu) didn't occur to me.
I'll give it a try.
Thanks, Akira
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3] CodeSamples: Work around removal of liburcu-signal
2024-12-29 0:17 ` Akira Yokosawa
@ 2024-12-29 0:33 ` Akira Yokosawa
2024-12-29 2:25 ` Leonardo Brás
1 sibling, 0 replies; 10+ messages in thread
From: Akira Yokosawa @ 2024-12-29 0:33 UTC (permalink / raw)
To: Leonardo Brás, Paul E. McKenney; +Cc: perfbook, Akira Yokosawa
On 2024/12/29 9:17, Akira Yokosawa wrote:
> The use of $(pkg-config --libs liburcu) didn't occur to me.
>
> I'll give it a try.
On Ubuntu 22.04 LTS, "pkg-config --libs liburcu" returns:
-lurcu-common -lurcu
I don't know much about pkg-config, but is it possible to make
the command return -lurcu-signal as well for liburcu <15.0 ?
Thanks, Akira
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3] CodeSamples: Work around removal of liburcu-signal
2024-12-29 0:17 ` Akira Yokosawa
2024-12-29 0:33 ` Akira Yokosawa
@ 2024-12-29 2:25 ` Leonardo Brás
1 sibling, 0 replies; 10+ messages in thread
From: Leonardo Brás @ 2024-12-29 2:25 UTC (permalink / raw)
To: Akira Yokosawa, Paul E. McKenney; +Cc: perfbook
On Sun, 2024-12-29 at 09:17 +0900, Akira Yokosawa wrote:
> Hi,
>
> Leonardo Brás wrote:
> [...]
> > > Hi Akira,
> > >
> > > That's a creative way of dealing with this issue, but if we want to add that
> > > complexity, I would rather use $(pkg-config --libs liburcu).
> > >
> > > Wouldn't this fix the issue as well?
> > >
> > > Thanks!
> >
> > Also, according to Paul's comment on v2 patch it shouldn't be needed:
> >
> > > > On the other hand, sys_membarrier() was introduced in 2015 (5b25b13ab08f6),
> > > > and no supported kernel (>v4.2) should still miss this syscall. Is it worth
> > > > the added complexity? Is so, let's do it.
> >
> > > If the -lurcu-signal is left off for old versions of the userspace RCU
> > > library, doesn't it simply fall back to using explicit memory barriers?
> > > Or am I yet again misremembering?
> >
> > > Thanx, Paul
> >
> > Isn't the above correct?
> >
>
> I have no idea ..., but your v2 patch causes this build error with
> liburcu <15.0:
>
> ------------------------------------------------------------------------
> cc -g -O3 -Wall -fcommon -o route_rcu route_rcu.c ../lib/random.c -lpthread -lurcu
> /usr/bin/ld: /tmp/ccjHTQfN.o: warning: relocation against `urcu_signal_gp' in read-only section `.text'
> /usr/bin/ld: /tmp/ccjHTQfN.o: in function `_urcu_signal_read_lock':
> /usr/include/x86_64-linux-gnu/urcu/static/urcu-signal.h:97: undefined reference to `urcu_signal_reader'
> /usr/bin/ld: /tmp/ccjHTQfN.o: in function `_urcu_signal_read_lock_update':
> /usr/include/x86_64-linux-gnu/urcu/static/urcu-signal.h:75: undefined reference to `urcu_signal_gp'
> /usr/bin/ld: /tmp/ccjHTQfN.o: in function `urcu_common_wake_up_gp':
> /usr/include/x86_64-linux-gnu/urcu/static/urcu-common.h:96: undefined reference to `urcu_signal_gp'
> /usr/bin/ld: /usr/include/x86_64-linux-gnu/urcu/static/urcu-common.h:96: undefined reference to `urcu_signal_gp'
> /usr/bin/ld: /usr/include/x86_64-linux-gnu/urcu/static/urcu-common.h:97: undefined reference to `urcu_signal_gp'
> /usr/bin/ld: /tmp/ccjHTQfN.o: in function `futex':
> /usr/include/x86_64-linux-gnu/urcu/futex.h:72: undefined reference to `urcu_signal_gp'
> /usr/bin/ld: /tmp/ccjHTQfN.o:/usr/include/x86_64-linux-gnu/urcu/static/urcu-common.h:97: more undefined references to `urcu_signal_gp' follow
> /usr/bin/ld: /tmp/ccjHTQfN.o: in function `perftest_reader':
> git/perfbook/CodeSamples/defer/routetorture.h:103: undefined reference to `urcu_signal_register_thread'
> /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:126: undefined reference to `urcu_signal_synchronize_rcu'
> /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:128: undefined reference to `urcu_signal_synchronize_rcu'
> /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:130: undefined reference to `urcu_signal_unregister_thread'
> /usr/bin/ld: /tmp/ccjHTQfN.o: in function `route_del':
> git/perfbook/CodeSamples/defer/route_rcu.c:124: undefined reference to `urcu_signal_call_rcu'
> /usr/bin/ld: /tmp/ccjHTQfN.o: in function `stresstest_updater':
> git/perfbook/CodeSamples/defer/routetorture.h:216: undefined reference to `urcu_signal_register_thread'
> /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:260: undefined reference to `urcu_signal_synchronize_rcu'
> /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:262: undefined reference to `urcu_signal_synchronize_rcu'
> /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:264: undefined reference to `urcu_signal_unregister_thread'
> /usr/bin/ld: /tmp/ccjHTQfN.o: in function `route_clear':
> git/perfbook/CodeSamples/defer/route_rcu.c:149: undefined reference to `urcu_signal_synchronize_rcu'
> /usr/bin/ld: /tmp/ccjHTQfN.o: in function `smoketest':
> git/perfbook/CodeSamples/defer/routetorture.h:47: undefined reference to `urcu_signal_register_thread'
> /usr/bin/ld: git/perfbook/CodeSamples/defer/routetorture.h:62: undefined reference to `urcu_signal_unregister_thread'
> /usr/bin/ld: warning: creating DT_TEXTREL in a PIE
> collect2: error: ld returned 1 exit status
> make[1]: *** [Makefile:134: route_rcu] Error 1
> make[1]: Leaving directory 'git/perfbook/CodeSamples/defer'
> ----------------------------------------------------------------
>
> This is under Ubuntu 22.04 LTS.
>
> This looks to me as an unacceptable build regression.
Oh, thanks for helping me understand. I thought previously that this would only
hit kernels without sys_membarrier() support, but now I get this triggers a
build error, which makes sense.
Out of curiosity, I did a new version that should take care of this. I will send
it as a v4, so please give it a test.
>
> The use of $(pkg-config --libs liburcu) didn't occur to me.
>
> I'll give it a try.
>
> Thanks, Akira
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3] CodeSamples: Work around removal of liburcu-signal
2024-12-28 7:12 [PATCH v3] CodeSamples: Work around removal of liburcu-signal Akira Yokosawa
2024-12-28 18:04 ` Paul E. McKenney
2024-12-28 18:23 ` Leonardo Brás
@ 2024-12-28 18:30 ` Leonardo Brás
2 siblings, 0 replies; 10+ messages in thread
From: Leonardo Brás @ 2024-12-28 18:30 UTC (permalink / raw)
To: Akira Yokosawa, Paul E. McKenney; +Cc: perfbook
On Sat, 2024-12-28 at 16:12 +0900, Akira Yokosawa wrote:
> From: Leonardo Bras <leobras.c@gmail.com>
>
> 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@gmail.com>
> Co-developed-by: Akira Yokosawa <akiyks@gmail.com>
> [akiyks: rewrite changelog, restore compatibility with liburcu <0.15.0]
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> ---
> 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?
>
> 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).
Also, all above systems already include sys_membarrier(), as they include kernel
versions above v4.2.
>
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread