From 1f94ee05250ebb2d02b29bc7a402a4f0ff17e3a3 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 6 Sep 2024 15:55:41 +0000 Subject: [PATCH] Tests: Fix abi conflict test when building with clang When building lttng-ust with clang, the following tests in `tests/regression/abi0-conflict/test_abi0_conflict` fail: ``` not ok 12 - dlopen: no-ust app with abi1 and abi0 fails not ok 14 - dlopen: ust app with abi0 fails not ok 15 - dlopen: ust app with abi0 and abi1 fails not ok 16 - dlopen: ust app with abi1 and abi0 fails ``` Cause ===== With the default optimizations that are applied, clang seems to inline the `init_uster` function. Compiling with `-O0` lets the test pass. Solution ======== Add the noinline attribute to the `init_uster` function in libfakeust0. Change-Id: I4a3b16da2c8aad1840cb5e878231b63ca4d47618 Signed-off-by: Kienan Stewart Signed-off-by: Mathieu Desnoyers --- tests/regression/abi0-conflict/fake-ust.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/regression/abi0-conflict/fake-ust.c b/tests/regression/abi0-conflict/fake-ust.c index f47cdc25..d8d6cd51 100644 --- a/tests/regression/abi0-conflict/fake-ust.c +++ b/tests/regression/abi0-conflict/fake-ust.c @@ -9,7 +9,7 @@ #include "./fake-ust.h" -void init_usterr(void) + __attribute__((noinline)) void init_usterr(void) { fprintf(stderr, "libfakeust0: init_usterr() called.\n"); } -- 2.34.1