From 3b3873c8cbcad1728230e5e12183e7705681193a Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 18 Nov 2019 16:45:46 -0500 Subject: [PATCH] lib: mark bt_common_assert_failed as hidden I noticed that the bt_common_assert_failed symbol was exported. This is not desirable, as it's not part of the API, so mark it with BT_HIDDEN. As a consequence, a bunch of small tests that use BT_ASSERT miss this symbol, as they were getting it from libbabeltrace2. Make them depend on libbabeltrace2-common (and libbabeltrace2-logging) directly to fix that. Change-Id: I25ab69e7df08f508389f5c9c3db5571ee7b06d7b Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/2402 Tested-by: jenkins Reviewed-by: Philippe Proulx --- src/common/assert.h | 1 + tests/ctf-writer/Makefile.am | 5 ++++- tests/lib/Makefile.am | 20 ++++++++++++++----- tests/lib/test-plugin-plugins/Makefile.am | 8 ++++++-- tests/plugins/sink.ctf.fs/succeed/Makefile.am | 5 ++++- tests/plugins/src.ctf.fs/succeed/Makefile.am | 5 ++++- 6 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/common/assert.h b/src/common/assert.h index f6a2ed60..f8666256 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -29,6 +29,7 @@ #include "common/macros.h" +BT_HIDDEN extern void bt_common_assert_failed(const char *file, int line, const char *func, const char *assertion) __attribute__((noreturn)); diff --git a/tests/ctf-writer/Makefile.am b/tests/ctf-writer/Makefile.am index a4f1f741..e453ec76 100644 --- a/tests/ctf-writer/Makefile.am +++ b/tests/ctf-writer/Makefile.am @@ -6,6 +6,9 @@ ctf_writer_SOURCES = ctf_writer.c ctf_writer_LDADD = \ $(top_builddir)/tests/utils/tap/libtap.la \ $(top_builddir)/tests/utils/libtestcommon.la \ - $(top_builddir)/src/ctf-writer/libbabeltrace2-ctf-writer.la + $(top_builddir)/src/ctf-writer/libbabeltrace2-ctf-writer.la \ + $(top_builddir)/src/common/libbabeltrace2-common.la \ + $(top_builddir)/src/logging/libbabeltrace2-logging.la + dist_check_SCRIPTS = test_ctf_writer diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index 67650cd5..510bc51d 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -7,7 +7,9 @@ COMMON_TEST_LDADD = \ $(top_builddir)/tests/utils/libtestcommon.la test_bt_values_LDADD = $(COMMON_TEST_LDADD) \ - $(top_builddir)/src/lib/libbabeltrace2.la + $(top_builddir)/src/lib/libbabeltrace2.la \ + $(top_builddir)/src/common/libbabeltrace2-common.la \ + $(top_builddir)/src/logging/libbabeltrace2-logging.la test_bt_uuid_LDADD = $(COMMON_TEST_LDADD) \ $(top_builddir)/src/common/libbabeltrace2-common.la \ @@ -15,13 +17,19 @@ test_bt_uuid_LDADD = $(COMMON_TEST_LDADD) \ test_trace_ir_ref_LDADD = $(COMMON_TEST_LDADD) \ $(top_builddir)/src/lib/libbabeltrace2.la \ - $(top_builddir)/src/ctf-writer/libbabeltrace2-ctf-writer.la + $(top_builddir)/src/ctf-writer/libbabeltrace2-ctf-writer.la \ + $(top_builddir)/src/common/libbabeltrace2-common.la \ + $(top_builddir)/src/logging/libbabeltrace2-logging.la test_graph_topo_LDADD = $(COMMON_TEST_LDADD) \ - $(top_builddir)/src/lib/libbabeltrace2.la + $(top_builddir)/src/lib/libbabeltrace2.la \ + $(top_builddir)/src/common/libbabeltrace2-common.la \ + $(top_builddir)/src/logging/libbabeltrace2-logging.la test_simple_sink_LDADD = $(COMMON_TEST_LDADD) \ - $(top_builddir)/src/lib/libbabeltrace2.la + $(top_builddir)/src/lib/libbabeltrace2.la \ + $(top_builddir)/src/common/libbabeltrace2-common.la \ + $(top_builddir)/src/logging/libbabeltrace2-logging.la noinst_PROGRAMS = \ test_bt_values \ @@ -39,7 +47,9 @@ test_graph_topo_SOURCES = test_graph_topo.c if !ENABLE_BUILT_IN_PLUGINS noinst_PROGRAMS += plugin plugin_LDADD = $(COMMON_TEST_LDADD) \ - $(top_builddir)/src/lib/libbabeltrace2.la + $(top_builddir)/src/lib/libbabeltrace2.la \ + $(top_builddir)/src/common/libbabeltrace2-common.la \ + $(top_builddir)/src/logging/libbabeltrace2-logging.la plugin_SOURCES = plugin.c SUBDIRS += test-plugin-plugins endif diff --git a/tests/lib/test-plugin-plugins/Makefile.am b/tests/lib/test-plugin-plugins/Makefile.am index c852655d..d6c940b2 100644 --- a/tests/lib/test-plugin-plugins/Makefile.am +++ b/tests/lib/test-plugin-plugins/Makefile.am @@ -6,7 +6,9 @@ plugin_minimal_la_LDFLAGS = \ $(LT_NO_UNDEFINED) \ -rpath / -avoid-version -module plugin_minimal_la_LIBADD = \ - $(top_builddir)/src/lib/libbabeltrace2.la + $(top_builddir)/src/lib/libbabeltrace2.la \ + $(top_builddir)/src/common/libbabeltrace2-common.la \ + $(top_builddir)/src/logging/libbabeltrace2-logging.la # source/filter/sink plugin plugin_sfs_la_SOURCES = sfs.c @@ -14,4 +16,6 @@ plugin_sfs_la_LDFLAGS = \ $(LT_NO_UNDEFINED) \ -rpath / -avoid-version -module plugin_sfs_la_LIBADD = \ - $(top_builddir)/src/lib/libbabeltrace2.la + $(top_builddir)/src/lib/libbabeltrace2.la \ + $(top_builddir)/src/common/libbabeltrace2-common.la \ + $(top_builddir)/src/logging/libbabeltrace2-logging.la diff --git a/tests/plugins/sink.ctf.fs/succeed/Makefile.am b/tests/plugins/sink.ctf.fs/succeed/Makefile.am index 4663157a..fd268311 100644 --- a/tests/plugins/sink.ctf.fs/succeed/Makefile.am +++ b/tests/plugins/sink.ctf.fs/succeed/Makefile.am @@ -1,7 +1,10 @@ dist_check_SCRIPTS = test_succeed # CTF trace generators -GEN_TRACE_LDADD = $(top_builddir)/src/ctf-writer/libbabeltrace2-ctf-writer.la +GEN_TRACE_LDADD = \ + $(top_builddir)/src/ctf-writer/libbabeltrace2-ctf-writer.la \ + $(top_builddir)/src/common/libbabeltrace2-common.la \ + $(top_builddir)/src/logging/libbabeltrace2-logging.la gen_trace_float_SOURCES = gen-trace-float.c gen_trace_float_LDADD = $(GEN_TRACE_LDADD) diff --git a/tests/plugins/src.ctf.fs/succeed/Makefile.am b/tests/plugins/src.ctf.fs/succeed/Makefile.am index 88f1bd5e..3f342c2b 100644 --- a/tests/plugins/src.ctf.fs/succeed/Makefile.am +++ b/tests/plugins/src.ctf.fs/succeed/Makefile.am @@ -1,7 +1,10 @@ dist_check_SCRIPTS = test_succeed # CTF trace generators -GEN_TRACE_LDADD = $(top_builddir)/src/ctf-writer/libbabeltrace2-ctf-writer.la +GEN_TRACE_LDADD = \ + $(top_builddir)/src/ctf-writer/libbabeltrace2-ctf-writer.la \ + $(top_builddir)/src/common/libbabeltrace2-common.la \ + $(top_builddir)/src/logging/libbabeltrace2-logging.la gen_trace_simple_SOURCES = gen-trace-simple.c gen_trace_simple_LDADD = $(GEN_TRACE_LDADD) -- 2.34.1