How can i build DBus with TSAN?

Dennis Luehring dl.soluz at gmx.net
Mon Nov 21 12:26:35 UTC 2022


Am 21.11.2022 um 13:03 schrieb Simon McVittie:
> On Sat, 19 Nov 2022 at 07:27:30 +0100, Dennis Luehring wrote:
> > cmake ../dbus -Db_sanitize=thread
>
> b_sanitize is a Meson option, not a CMake option. CMake and Meson
> do a similar job, but are alternatives to each other and are not
> interchangeable.
>
> The dbus 1.15.x development branch can be compiled using Meson, similar
> to GLib (see Meson documentation for general information).
>
> If you would prefer to use the dbus 1.14.x stable branch, use Autotools
> (recommended for Linux and other Unix systems), something like this:
>
>      ../configure SANITIZE_CFLAGS="-fsanitize=thread -static-libtsan"
>
> or use CMake but use a correct CMake option instead of a Meson option.
> I don't know what is the usual way to enable tsan on CMake, perhaps
> something like this:
>
>      cmake .. -DCMAKE_C_FLAGS_DEBUG="-fsanitize=thread -static-libtsan"
>

im currently bound to 1.14.x AND 1.12.20 but

tried with cmake and

-DCMAKE_CXX_FLAGS="-g -fno-omit-frame-pointer -fsanitize=thread"
-DCMAKE_C_FLAGS="-g -fno-omit-frame-pointer -fsanitize=thread"
-DCMAKE_EXE_LINKER_FLAGS="-fno-omit-frame-pointer -fsanitize=thread"
-DCMAKE_MODULE_LINKER_FLAGS="-fno-omit-frame-pointer -fsanitize=thread"

giving working TSAN results for both versions


i think DCMAKE_CXX_FLAGS and DCMAKE_EXE_LINKER_FLAGS not needed here


thanks


More information about the dbus mailing list