/tests/compile/api1/test-app-ctx/hello-compatapi1
/tests/compile/api1/ust-fields/ust-fields
/tests/compile/api1/ust-fields/ust-fields-compatapi1
+/tests/regression/abi0-conflict/app_noust
+/tests/regression/abi0-conflict/app_noust_dlopen
+/tests/regression/abi0-conflict/app_noust_indirect_abi0
+/tests/regression/abi0-conflict/app_noust_indirect_abi0_abi1
+/tests/regression/abi0-conflict/app_noust_indirect_abi1
+/tests/regression/abi0-conflict/app_ust
+/tests/regression/abi0-conflict/app_ust_dlopen
+/tests/regression/abi0-conflict/app_ust_indirect_abi0
+/tests/regression/abi0-conflict/app_ust_indirect_abi0_abi1
+/tests/regression/abi0-conflict/app_ust_indirect_abi1
/tests/unit/gcc-weak-hidden/test_gcc_weak_hidden
/tests/unit/libmsgpack/test_msgpack
/tests/unit/libringbuffer/test_shm
/tests/compile/api1/hello/Makefile
/tests/compile/api1/same_line_tracepoint/Makefile
/tests/compile/api1/test-app-ctx/Makefile
+/tests/regression/abi0-conflict/Makefile
+/tests/regression/Makefile
/tests/unit/Makefile
/tests/unit/gcc-weak-hidden/Makefile
/tests/unit/libmsgpack/Makefile
tests/compile/api1/test-app-ctx/Makefile
tests/compile/Makefile
tests/Makefile
+ tests/regression/abi0-conflict/Makefile
+ tests/regression/Makefile
tests/unit/gcc-weak-hidden/Makefile
tests/unit/libmsgpack/Makefile
tests/unit/libringbuffer/Makefile
# SPDX-License-Identifier: LGPL-2.1-only
-SUBDIRS = utils unit compile benchmark
+SUBDIRS = utils unit compile benchmark regression
LOG_DRIVER_FLAGS = --merge --comments
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' \
UST_TESTS_BUILDDIR='$(abs_top_builddir)/tests' \
$(SHELL) $(srcdir)/utils/tap-driver.sh
+# Unit tests
+
TESTS = \
unit/libringbuffer/test_shm \
unit/gcc-weak-hidden/test_gcc_weak_hidden \
unit/ust-utils/test_ust_utils_cxx
endif
+# Regression tests
+
+TESTS += \
+ regression/abi0-conflict/test_abi0_conflict
+
EXTRA_DIST = README
check-loop:
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-only
+
+SUBDIRS = \
+ abi0-conflict
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-only
+
+AM_CPPFLAGS += -I$(top_srcdir)/tests/utils -I$(srcdir)
+
+noinst_LTLIBRARIES = \
+ libfakeust0.la \
+ libone.la \
+ libzero.la
+
+libfakeust0_la_SOURCES = fake-ust.c fake-ust.h
+libfakeust0_la_LDFLAGS = -module -shared -avoid-version -rpath $(abs_builddir)/.libs/
+
+libzero_la_SOURCES = libzero.c libzero.h
+libzero_la_LDFLAGS = -module -shared -avoid-version -rpath $(abs_builddir)/.libs/
+libzero_la_LIBADD = libfakeust0.la
+
+libone_la_SOURCES = libone.c libone.h
+libone_la_LDFLAGS = -module -shared -avoid-version -rpath $(abs_builddir)/.libs/
+libone_la_LIBADD = $(top_builddir)/src/lib/lttng-ust/liblttng-ust.la
+
+noinst_PROGRAMS = \
+ app_noust \
+ app_noust_dlopen \
+ app_noust_indirect_abi0 \
+ app_noust_indirect_abi0_abi1 \
+ app_noust_indirect_abi1 \
+ app_ust \
+ app_ust_dlopen \
+ app_ust_indirect_abi0 \
+ app_ust_indirect_abi0_abi1 \
+ app_ust_indirect_abi1
+
+app_ust_SOURCES = app_ust.c tp.c ust_tests_hello.h
+app_ust_LDADD = \
+ $(top_builddir)/src/lib/lttng-ust/liblttng-ust.la \
+ $(DL_LIBS)
+
+app_ust_indirect_abi0_SOURCES = app_ust.c tp.c ust_tests_hello.h
+app_ust_indirect_abi0_CFLAGS = -DUSE_LIBZERO $(AM_CFLAGS)
+app_ust_indirect_abi0_LDADD = \
+ $(top_builddir)/src/lib/lttng-ust/liblttng-ust.la \
+ libzero.la \
+ $(DL_LIBS)
+
+app_ust_indirect_abi1_SOURCES = app_ust.c tp.c ust_tests_hello.h
+app_ust_indirect_abi1_CFLAGS = -DUSE_LIBONE $(AM_CFLAGS)
+app_ust_indirect_abi1_LDADD = \
+ $(top_builddir)/src/lib/lttng-ust/liblttng-ust.la \
+ libone.la \
+ $(DL_LIBS)
+
+app_ust_indirect_abi0_abi1_SOURCES = app_ust.c tp.c ust_tests_hello.h
+app_ust_indirect_abi0_abi1_CFLAGS = -DUSE_LIBZERO -DUSE_LIBONE $(AM_CFLAGS)
+app_ust_indirect_abi0_abi1_LDADD = \
+ $(top_builddir)/src/lib/lttng-ust/liblttng-ust.la \
+ libzero.la \
+ libone.la \
+ $(DL_LIBS)
+
+app_ust_dlopen_SOURCES = app_ust_dlopen.c tp.c ust_tests_hello.h
+app_ust_dlopen_LDADD = \
+ $(top_builddir)/src/lib/lttng-ust/liblttng-ust.la \
+ $(DL_LIBS)
+
+app_noust_SOURCES = app_noust.c
+
+app_noust_indirect_abi0_SOURCES = app_noust.c
+app_noust_indirect_abi0_CFLAGS = -DUSE_LIBZERO $(AM_CFLAGS)
+app_noust_indirect_abi0_LDADD = libzero.la
+
+app_noust_indirect_abi1_SOURCES = app_noust.c
+app_noust_indirect_abi1_CFLAGS = -DUSE_LIBONE $(AM_CFLAGS)
+app_noust_indirect_abi1_LDADD = libone.la
+
+app_noust_indirect_abi0_abi1_SOURCES = app_noust.c
+app_noust_indirect_abi0_abi1_CFLAGS = -DUSE_LIBZERO -DUSE_LIBONE $(AM_CFLAGS)
+app_noust_indirect_abi0_abi1_LDADD = libzero.la libone.la
+
+app_noust_dlopen_SOURCES = app_noust_dlopen.c
+app_noust_dlopen_LDADD = \
+ $(DL_LIBS)
+
+dist_noinst_SCRIPTS = test_abi0_conflict
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#include <stdio.h>
+
+#include "./libzero.h"
+#include "./libone.h"
+
+int main(void)
+{
+ printf("This application is NOT linked on liblttng-ust.\n");
+
+#ifdef USE_LIBZERO
+ libzero();
+#endif
+#ifdef USE_LIBONE
+ libone();
+#endif
+
+ return 0;
+}
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#include <dlfcn.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+
+#define LTTNG_UST_LIB_ABI0_SO_NAME "libfakeust0.so"
+#define LTTNG_UST_LIB_ABI1_SO_NAME "liblttng-ust.so.1"
+
+static
+int dlopen_ust(const char *lib_soname)
+{
+ int ret = EXIT_SUCCESS;
+ void *handle;
+
+ handle = dlopen(lib_soname, RTLD_NOW | RTLD_GLOBAL);
+ if (!handle) {
+ printf("Error: dlopen of liblttng-ust shared library (%s).\n", lib_soname);
+ ret = EXIT_FAILURE;
+ } else {
+ printf("Success: dlopen of liblttng-ust shared library (%s).\n", lib_soname);
+ }
+
+ return ret;
+}
+
+static
+int dlopen_abi0(void)
+{
+ return dlopen_ust(LTTNG_UST_LIB_ABI0_SO_NAME);
+}
+
+static
+int dlopen_abi1(void)
+{
+ return dlopen_ust(LTTNG_UST_LIB_ABI1_SO_NAME);
+}
+
+static
+int dlopen_abi0_abi1(void)
+{
+ int ret = EXIT_SUCCESS;
+
+ ret = dlopen_ust(LTTNG_UST_LIB_ABI0_SO_NAME);
+ if (ret != EXIT_SUCCESS)
+ return ret;
+
+ ret = dlopen_ust(LTTNG_UST_LIB_ABI1_SO_NAME);
+
+ return ret;
+}
+
+static
+int dlopen_abi1_abi0(void)
+{
+ int ret = EXIT_SUCCESS;
+
+ ret = dlopen_ust(LTTNG_UST_LIB_ABI1_SO_NAME);
+ if (ret != EXIT_SUCCESS)
+ return ret;
+
+ ret = dlopen_ust(LTTNG_UST_LIB_ABI0_SO_NAME);
+
+ return ret;
+}
+
+static
+int dlopen_abi1_abi1(void)
+{
+ int ret = EXIT_SUCCESS;
+
+ ret = dlopen_ust(LTTNG_UST_LIB_ABI1_SO_NAME);
+ if (ret != EXIT_SUCCESS)
+ return ret;
+
+ ret = dlopen_ust(LTTNG_UST_LIB_ABI1_SO_NAME);
+
+ return ret;
+}
+
+static
+void usage(char **argv)
+{
+ printf("Usage: %s <test_type>\n", argv[0]);
+ printf(" test_type: abi0, abi1, abi0_abi1, abi1_abi0, abi1_abi1\n");
+}
+
+int main(int argc, char **argv)
+{
+ int ret = EXIT_SUCCESS;
+ const char *test_type;
+
+ if (argc != 2) {
+ usage(argv);
+ return EXIT_FAILURE;
+ } else {
+ test_type = argv[1];
+ }
+
+ printf("This application is NOT linked on liblttng-ust.\n");
+
+ if (strcmp(test_type, "abi0") == 0)
+ ret = dlopen_abi0();
+ else if (strcmp(test_type, "abi1") == 0)
+ ret = dlopen_abi1();
+ else if (strcmp(test_type, "abi0_abi1") == 0)
+ ret = dlopen_abi0_abi1();
+ else if (strcmp(test_type, "abi1_abi0") == 0)
+ ret = dlopen_abi1_abi0();
+ else if (strcmp(test_type, "abi1_abi1") == 0)
+ ret = dlopen_abi1_abi1();
+ else {
+ usage(argv);
+ ret = EXIT_FAILURE;
+ }
+
+ return ret;
+}
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <arpa/inet.h>
+
+#include "./libzero.h"
+#include "./libone.h"
+
+#define LTTNG_UST_TRACEPOINT_DEFINE
+#include "ust_tests_hello.h"
+
+int main(void)
+{
+ int i, netint;
+ long values[] = { 1, 2, 3 };
+ char text[10] = "test";
+ double dbl = 2.0;
+ float flt = 2222.0;
+ bool mybool = 123; /* should print "1" */
+
+ printf("This application is linked on liblttng-ust.\n");
+
+#ifdef USE_LIBZERO
+ libzero();
+#endif
+#ifdef USE_LIBONE
+ libone();
+#endif
+
+ for (i = 0; i < 10; i++) {
+ netint = htonl(i);
+ lttng_ust_tracepoint(ust_tests_hello, tptest, i, netint, values,
+ text, strlen(text), dbl, flt, mybool);
+ }
+
+ return 0;
+}
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#include <dlfcn.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <arpa/inet.h>
+
+#define LTTNG_UST_TRACEPOINT_DEFINE
+#include "ust_tests_hello.h"
+
+#define LTTNG_UST_LIB_ABI0_SO_NAME "libfakeust0.so"
+#define LTTNG_UST_LIB_ABI1_SO_NAME "liblttng-ust.so.1"
+
+static
+int dlopen_ust(const char *lib_soname)
+{
+ int ret = EXIT_SUCCESS;
+ void *handle;
+
+ handle = dlopen(lib_soname, RTLD_NOW | RTLD_GLOBAL);
+ if (!handle) {
+ printf("Error: dlopen of liblttng-ust shared library (%s).\n", lib_soname);
+ ret = EXIT_FAILURE;
+ } else {
+ printf("Success: dlopen of liblttng-ust shared library (%s).\n", lib_soname);
+ }
+
+ return ret;
+}
+
+static
+int dlopen_abi0(void)
+{
+ return dlopen_ust(LTTNG_UST_LIB_ABI0_SO_NAME);
+}
+
+static
+int dlopen_abi1(void)
+{
+ return dlopen_ust(LTTNG_UST_LIB_ABI1_SO_NAME);
+}
+
+static
+int dlopen_abi0_abi1(void)
+{
+ int ret = EXIT_SUCCESS;
+
+ ret = dlopen_ust(LTTNG_UST_LIB_ABI0_SO_NAME);
+ if (ret != EXIT_SUCCESS)
+ return ret;
+
+ ret = dlopen_ust(LTTNG_UST_LIB_ABI1_SO_NAME);
+
+ return ret;
+}
+
+static
+int dlopen_abi1_abi0(void)
+{
+ int ret = EXIT_SUCCESS;
+
+ ret = dlopen_ust(LTTNG_UST_LIB_ABI1_SO_NAME);
+ if (ret != EXIT_SUCCESS)
+ return ret;
+
+ ret = dlopen_ust(LTTNG_UST_LIB_ABI0_SO_NAME);
+
+ return ret;
+}
+
+static
+int dlopen_abi1_abi1(void)
+{
+ int ret = EXIT_SUCCESS;
+
+ ret = dlopen_ust(LTTNG_UST_LIB_ABI1_SO_NAME);
+ if (ret != EXIT_SUCCESS)
+ return ret;
+
+ ret = dlopen_ust(LTTNG_UST_LIB_ABI1_SO_NAME);
+
+ return ret;
+}
+
+static
+void usage(char **argv)
+{
+ printf("Usage: %s <test_type>\n", argv[0]);
+ printf(" test_type: abi0, abi1, abi0_abi1, abi1_abi0, abi1_abi1\n");
+}
+
+int main(int argc, char **argv)
+{
+ int ret = EXIT_SUCCESS;
+ const char *test_type;
+
+ int i, netint;
+ long values[] = { 1, 2, 3 };
+ char text[10] = "test";
+ double dbl = 2.0;
+ float flt = 2222.0;
+ bool mybool = 123; /* should print "1" */
+
+
+ if (argc != 2) {
+ usage(argv);
+ return EXIT_FAILURE;
+ } else {
+ test_type = argv[1];
+ }
+
+ printf("This application is linked on liblttng-ust.\n");
+
+ if (strcmp(test_type, "abi0") == 0)
+ ret = dlopen_abi0();
+ else if (strcmp(test_type, "abi1") == 0)
+ ret = dlopen_abi1();
+ else if (strcmp(test_type, "abi0_abi1") == 0)
+ ret = dlopen_abi0_abi1();
+ else if (strcmp(test_type, "abi1_abi0") == 0)
+ ret = dlopen_abi1_abi0();
+ else if (strcmp(test_type, "abi1_abi1") == 0)
+ ret = dlopen_abi1_abi1();
+ else {
+ usage(argv);
+ ret = EXIT_FAILURE;
+ }
+
+ for (i = 0; i < 10; i++) {
+ netint = htonl(i);
+ lttng_ust_tracepoint(ust_tests_hello, tptest, i, netint, values,
+ text, strlen(text), dbl, flt, mybool);
+ }
+
+ return ret;
+}
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+
+#include "./fake-ust.h"
+
+void init_usterr(void)
+{
+ fprintf(stderr, "libfakeust0: init_usterr() called.\n");
+}
+
+/*
+ * The symbol used by liblttng-ust.so.1 to detect liblttng-ust.so.0 in a
+ * process.
+ */
+int ltt_probe_register(struct lttng_probe_desc *desc __attribute__((unused)))
+{
+ fprintf(stderr, "libfakeust0: ltt_probe_register() called.\n");
+ return 0;
+}
+
+/*
+ * This constructor calls the 'init_usterr' canary function which is provided
+ * by liblttng-ust.so.1.
+ */
+static
+void fake_ust_ctor(void)
+ __attribute__((constructor));
+static void fake_ust_ctor(void)
+{
+ init_usterr();
+}
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#define LTTNG_UST_PROBE_DESC_PADDING 12
+struct lttng_probe_desc {
+ char padding[LTTNG_UST_PROBE_DESC_PADDING];
+};
+
+void init_usterr(void);
+
+/*
+ * The symbol used by liblttng-ust.so.1 to detect liblttng-ust.so.0 in a
+ * process.
+ */
+int ltt_probe_register(struct lttng_probe_desc *desc);
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#include <stdio.h>
+#include <lttng/ust-fork.h>
+
+#include "./libone.h"
+
+/*
+ * Dummy function to ensure we are properly linked on liblttng-ust.so.1.
+ */
+void libone_dummy(void)
+{
+ lttng_ust_after_setns();
+}
+
+void libone(void)
+{
+ printf("libone: this is libone()\n");
+}
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+void libone_dummy(void);
+void libone(void);
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#include <stdio.h>
+
+#include "./libzero.h"
+#include "./fake-ust.h"
+
+/*
+ * Dummy function to ensure we are properly linked on libfakeust0.
+ */
+int libzero_dummy(void)
+{
+ struct lttng_probe_desc probe_desc;
+
+ return ltt_probe_register(&probe_desc);
+}
+
+void libzero(void)
+{
+ printf("libzero: this is libzero()\n");
+}
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+int libzero_dummy(void);
+void libzero(void);
--- /dev/null
+#!/bin/bash
+# SPDX-License-Identifier: LGPL-2.1-only
+
+if [ "x${UST_TESTS_SRCDIR:-}" != "x" ]; then
+ UTILSSH="$UST_TESTS_SRCDIR/utils/utils.sh"
+else
+ UTILSSH="$(dirname "$0")/../../utils/utils.sh"
+fi
+
+# shellcheck source=../../utils/utils.sh
+source "$UTILSSH"
+
+# shellcheck source=../../utils/tap.sh
+source "$UST_TESTS_SRCDIR/utils/tap.sh"
+
+CURDIR="${UST_TESTS_BUILDDIR}/regression/abi0-conflict"
+
+LIBFAKEUST0_PATH="${CURDIR}/.libs"
+LIBFAKEUST0="${LIBFAKEUST0_PATH}/libfakeust0.so"
+
+LIBUST1_PATH="${UST_TESTS_BUILDDIR}/../src/lib/lttng-ust/.libs/"
+LIBUST1="${LIBUST1_PATH}/liblttng-ust.so.1"
+
+STD_OUTPUT="/dev/null"
+STD_ERROR="/dev/null"
+
+# Force abort on CRIT() to detect ABI conflicts
+export LTTNG_UST_ABORT_ON_CRITICAL=1
+
+plan_tests 22
+
+###
+## LD_PRELOAD tests
+###
+
+diag "LD_PRELOAD"
+
+## App NOT linked on liblttn-ust
+
+"${CURDIR}/app_noust" >"$STD_OUTPUT" 2>"$STD_ERROR"
+ok $? "LD_PRELOAD: no-ust app works"
+
+LD_PRELOAD="${LIBFAKEUST0}" "${CURDIR}/app_noust" >"$STD_OUTPUT" 2>"$STD_ERROR"
+ok $? "LD_PRELOAD: no-ust app with abi0 preload succeeds"
+
+LD_PRELOAD="${LIBFAKEUST0}:${LIBUST1}" "${CURDIR}/app_noust" >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "LD_PRELOAD: no-ust app with abi0 and abi1 preload fails"
+
+LD_PRELOAD="${LIBUST1}:${LIBFAKEUST0}" "${CURDIR}/app_noust" >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "LD_PRELOAD: no-ust app with abi1 and abi0 preload fails"
+
+
+## App linked on liblttn-ust.so.1
+
+"${CURDIR}/app_ust" >"$STD_OUTPUT" 2>"$STD_ERROR"
+ok $? "LD_PRELOAD: ust app works"
+
+LD_PRELOAD="${LIBFAKEUST0}" "${CURDIR}/app_ust" >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "LD_PRELOAD: ust app with abi0 preload fails"
+
+LD_PRELOAD="${LIBFAKEUST0}:${LIBUST1}" "${CURDIR}/app_ust" >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "LD_PRELOAD: ust app with abi0 and abi1 preload fails"
+
+LD_PRELOAD="${LIBUST1}:${LIBFAKEUST0}" "${CURDIR}/app_ust" >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "LD_PRELOAD: ust app with abi1 and abi0 preload fails"
+
+
+###
+## dlopen tests
+###
+
+diag "dlopen"
+
+## App NOT linked on liblttn-ust
+
+LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_noust_dlopen" abi0 >"$STD_OUTPUT" 2>"$STD_ERROR"
+ok $? "dlopen: no-ust app works"
+
+LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_noust_dlopen" abi1_abi1 >"$STD_OUTPUT" 2>"$STD_ERROR"
+ok $? "dlopen: no-ust app with abi1 and abi1 succeeds"
+
+LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_noust_dlopen" abi0_abi1 >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "dlopen: no-ust app with abi0 and abi1 fails"
+
+LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_noust_dlopen" abi1_abi0 >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "dlopen: no-ust app with abi1 and abi0 fails"
+
+## App linked on liblttn-ust.so.1
+
+LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_ust_dlopen" abi1 >"$STD_OUTPUT" 2>"$STD_ERROR"
+ok $? "dlopen: ust app works"
+
+LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_ust_dlopen" abi0 >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "dlopen: ust app with abi0 fails"
+
+LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_ust_dlopen" abi0_abi1 >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "dlopen: ust app with abi0 and abi1 fails"
+
+LD_LIBRARY_PATH="$LIBFAKEUST0_PATH:$LIBUST1_PATH" "${CURDIR}/app_ust_dlopen" abi1_abi0 >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "dlopen: ust app with abi1 and abi0 fails"
+
+
+###
+## Indirect linking
+###
+
+diag "Indirect linking"
+
+## App NOT linked on liblttn-ust
+
+"${CURDIR}/app_noust_indirect_abi0" >"$STD_OUTPUT" 2>"$STD_ERROR"
+ok $? "indirect: no-ust app with abi0 succeeds"
+
+"${CURDIR}/app_noust_indirect_abi1" >"$STD_OUTPUT" 2>"$STD_ERROR"
+ok $? "indirect: no-ust app with abi1 succeeds"
+
+"${CURDIR}/app_noust_indirect_abi0_abi1" >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "indirect: no-ust app with abi0 and abi1 fails"
+
+## App linked on liblttn-ust
+
+"${CURDIR}/app_ust_indirect_abi0" >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "indirect: ust app with abi0 fails"
+
+"${CURDIR}/app_ust_indirect_abi1" >"$STD_OUTPUT" 2>"$STD_ERROR"
+ok $? "indirect: ust app with abi1 succeeds"
+
+"${CURDIR}/app_ust_indirect_abi0_abi1" >"$STD_OUTPUT" 2>"$STD_ERROR"
+isnt $? 0 "indirect: ust app with abi0 and abi1 fails"
--- /dev/null
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#define LTTNG_UST_TRACEPOINT_CREATE_PROBES
+#include "ust_tests_hello.h"
--- /dev/null
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#undef LTTNG_UST_TRACEPOINT_PROVIDER
+#define LTTNG_UST_TRACEPOINT_PROVIDER ust_tests_hello
+
+#if !defined(_TRACEPOINT_UST_TESTS_HELLO_H) || defined(LTTNG_UST_TRACEPOINT_HEADER_MULTI_READ)
+#define _TRACEPOINT_UST_TESTS_HELLO_H
+
+#include <lttng/tracepoint.h>
+#include <stdbool.h>
+#include <stddef.h>
+
+LTTNG_UST_TRACEPOINT_EVENT(ust_tests_hello, tptest,
+ LTTNG_UST_TP_ARGS(int, anint, int, netint, long *, values,
+ char *, text, size_t, textlen,
+ double, doublearg, float, floatarg,
+ bool, boolarg),
+ LTTNG_UST_TP_FIELDS(
+ lttng_ust_field_integer(int, intfield, anint)
+ lttng_ust_field_integer_hex(int, intfield2, anint)
+ lttng_ust_field_integer(long, longfield, anint)
+ lttng_ust_field_integer_network(int, netintfield, netint)
+ lttng_ust_field_integer_network_hex(int, netintfieldhex, netint)
+ lttng_ust_field_array_nowrite(long, arrfield1z, values, 3)
+ lttng_ust_field_array(long, blah, values, 3)
+ lttng_ust_field_array(long, arrfield1, values, 3)
+ lttng_ust_field_array_hex(long, arrfield1_hex, values, 3)
+ lttng_ust_field_array_network(long, arrfield1_network, values, 3)
+ lttng_ust_field_array_network_hex(long, arrfield1_network_hex, values, 3)
+ lttng_ust_field_array_text(char, arrfield2, text, 10)
+ lttng_ust_field_sequence(char, seqfield1, text,
+ size_t, textlen)
+ lttng_ust_field_sequence_nowrite(char, seqfield1z, text,
+ size_t, textlen)
+ lttng_ust_field_sequence_hex(char, seqfield1_hex, text,
+ size_t, textlen)
+ lttng_ust_field_sequence_text(char, seqfield2, text,
+ size_t, textlen)
+ lttng_ust_field_sequence_network(long, seqfield_network_3, values,
+ size_t, 3)
+ lttng_ust_field_string(stringfield, text)
+ lttng_ust_field_float(float, floatfield, floatarg)
+ lttng_ust_field_float(double, doublefield, doublearg)
+ lttng_ust_field_integer(bool, boolfield, boolarg)
+ lttng_ust_field_integer_nowrite(int, filterfield, anint)
+ )
+)
+
+LTTNG_UST_TRACEPOINT_EVENT(ust_tests_hello, tptest_sighandler,
+ LTTNG_UST_TP_ARGS(),
+ LTTNG_UST_TP_FIELDS()
+)
+
+#endif /* _TRACEPOINT_UST_TESTS_HELLO_H */
+
+#undef LTTNG_UST_TRACEPOINT_INCLUDE
+#define LTTNG_UST_TRACEPOINT_INCLUDE "./ust_tests_hello.h"
+
+/* This part must be outside ifdef protection */
+#include <lttng/tracepoint-event.h>