./configure --disable-shared --enable-static
make
make check
The make check fails for test_seek.
Fix this by ensuring that test_seek has a dependency on libbabeltrace
and libbabeltrace-ctf. This is a temporary work-around until we improve
our plugin handling.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
libtestcommon_a_SOURCES = common.c common.h
+# -Wl,--no-as-needed is needed for recent gold linker who seems to think
+# it knows better and considers libraries with constructors having
+# side-effects as dead code.
+test_seek_LDFLAGS = -Wl,--no-as-needed
test_seek_LDADD = $(LIBTAP) libtestcommon.a \
$(top_builddir)/lib/libbabeltrace.la \
$(top_builddir)/formats/ctf/libbabeltrace-ctf.la
#include <babeltrace/iterator.h>
#include <babeltrace/ctf/iterator.h>
#include <babeltrace/ctf/events.h>
+#include <babeltrace/babeltrace-internal.h> /* For symbol side-effects */
#include <stdio.h>
#include <stdlib.h>
uint64_t expected_begin;
uint64_t expected_last;
+ /*
+ * Side-effects ensuring libs are not optimized away by static
+ * linking.
+ */
+ babeltrace_debug = 0; /* libbabeltrace.la */
+ opt_clock_offset = 0; /* libbabeltrace-ctf.la */
+
plan_tests(NR_TESTS);
if (argc < 4) {