Tests: Fix abi conflict test when building with clang master
authorroot <root@ideal-dove>
Fri, 6 Sep 2024 15:55:41 +0000 (15:55 +0000)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 9 Sep 2024 14:21:43 +0000 (10:21 -0400)
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 <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/regression/abi0-conflict/fake-ust.c

index f47cdc255f94f5cadc0fa56e91a24ab07248b9da..d8d6cd51849c88a13c8eddb51788bae84df55d08 100644 (file)
@@ -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");
 }
This page took 0.026796 seconds and 4 git commands to generate.