[lttng-dev] userspace-rcu 0.12.2: build fails

Tomasz Kłoczko kloczko.tomasz at gmail.com
Fri Feb 19 17:45:43 EST 2021


On Fri, 19 Feb 2021 at 19:20, Mathieu Desnoyers <
mathieu.desnoyers at efficios.com> wrote:
[..]

> Good to know. This does not provide any clarification on your build
> environment
> though (see my request above). Therefore we cannot attempt to reproduce on
> our side yet.
>

I'm building on top of my own distribution which is quite close to fedora
rawhide (with tons of fixes) however before starting actual build I'm
regenerating all ac/am/lt files using "autoreconf -fiv" because I'm
patching configiure.ac and some Makefile.am files.
I need that because 1.2.2 has underlinkig issues.
Here is the patch which fixes underlinking:
```
--- a/src/Makefile.am~  2021-02-17 19:52:04.000000000 +0000
+++ b/src/Makefile.am   2021-02-18 01:19:04.366349148 +0000
@@ -34,7 +34,7 @@

 liburcu_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT)
 liburcu_la_CFLAGS = -DRCU_MEMBARRIER $(AM_CFLAGS)
-liburcu_la_LIBADD = liburcu-common.la
+liburcu_la_LIBADD = liburcu-common.la $(PTHREAD_LIBS)

 liburcu_memb_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT)
 liburcu_memb_la_CFLAGS = -DRCU_MEMBARRIER $(AM_CFLAGS)
@@ -42,22 +42,22 @@

 liburcu_qsbr_la_SOURCES = urcu-qsbr.c urcu-pointer.c $(COMPAT)
 liburcu_qsbr_la_CFLAGS = -DRCU_QSBR $(AM_CFLAGS)
-liburcu_qsbr_la_LIBADD = liburcu-common.la
+liburcu_qsbr_la_LIBADD = liburcu-common.la $(PTHREAD_LIBS)

 liburcu_mb_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT)
 liburcu_mb_la_CFLAGS = -DRCU_MB $(AM_CFLAGS)
-liburcu_mb_la_LIBADD = liburcu-common.la
+liburcu_mb_la_LIBADD = liburcu-common.la $(PTHREAD_LIBS)

 liburcu_signal_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT)
 liburcu_signal_la_CFLAGS = -DRCU_SIGNAL $(AM_CFLAGS)
-liburcu_signal_la_LIBADD = liburcu-common.la
+liburcu_signal_la_LIBADD = liburcu-common.la $(PTHREAD_LIBS)

 liburcu_bp_la_SOURCES = urcu-bp.c urcu-pointer.c $(COMPAT)
-liburcu_bp_la_LIBADD = liburcu-common.la
+liburcu_bp_la_LIBADD = liburcu-common.la $(PTHREAD_LIBS)

 liburcu_cds_la_SOURCES = rculfqueue.c rculfstack.c lfstack.c \
        workqueue.c workqueue.h $(RCULFHASH) $(COMPAT)
-liburcu_cds_la_LIBADD = liburcu-common.la
+liburcu_cds_la_LIBADD = liburcu-common.la $(PTHREAD_LIBS)

 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = liburcu-cds.pc liburcu.pc liburcu-bp.pc liburcu-qsbr.pc \
```
Without that patch build fails on:
```
make[5]: Entering directory
'/home/tkloczko/rpmbuild/BUILD/userspace-rcu-0.12.2/doc/examples/hlist'
+ /usr/bin/gcc -g -O2 -Wall -O2 -g -grecord-gcc-switches -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-fdata-sections -ffunction-sections -flto=auto -flto-partition=none
-L../../../src/.libs/ -Wl,-rpath
/home/tkloczko/rpmbuild/BUILD/userspace-rcu-0.12.2/doc/examples/../../src/.libs/
-Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto
-flto-partition=none -fuse-linker-plugin -o cds_hlist_add_head_rcu
cds_hlist_add_head_rcu.o -lurcu
/usr/bin/ld: ../../../src/.libs//liburcu.so: undefined reference to
`pthread_join'
/usr/bin/ld: ../../../src/.libs//liburcu.so: undefined reference to
`pthread_create'
collect2: error: ld returned 1 exit status
```

I must apologise. I made small mistake in my other patch which removes from
configiure.ac amd all Makefile.am files hadcoding all -W<foo> and -g flags
(I want to control such things completely from outside the build framework
over CFLAGS and other env variables).

After fixing that patch looks like 1.2.2 builds correctly however that
underlinking issue is real.

One more time sorry .. kind of my fault :/

kloczek
-- 
Tomasz Kłoczko | LinkedIn: http://lnkd.in/FXPWxH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20210219/54e889e5/attachment.htm>


More information about the lttng-dev mailing list