mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 13:00:28 +00:00
Enable all sanitizers on FreeBSD
This commit is contained in:
@@ -802,6 +802,18 @@ try_cross_linking:;
|
||||
link_settings = gb_string_appendc(link_settings, "-e _main ");
|
||||
}
|
||||
} else if (build_context.metrics.os == TargetOs_freebsd) {
|
||||
if (build_context.sanitizer_flags & (SanitizerFlag_Address | SanitizerFlag_Memory)) {
|
||||
// It's imperative that `pthread` is linked before `libc`,
|
||||
// otherwise ASan/MSan will be unable to call `pthread_key_create`
|
||||
// because FreeBSD's `libthr` implementation of `pthread`
|
||||
// needs to replace the relevant stubs first.
|
||||
//
|
||||
// (Presumably TSan implements its own `pthread` interface,
|
||||
// which is why it isn't required.)
|
||||
//
|
||||
// See: https://reviews.llvm.org/D39254
|
||||
platform_lib_str = gb_string_appendc(platform_lib_str, "-lpthread ");
|
||||
}
|
||||
// FreeBSD pkg installs third-party shared libraries in /usr/local/lib.
|
||||
platform_lib_str = gb_string_appendc(platform_lib_str, "-Wl,-L/usr/local/lib ");
|
||||
} else if (build_context.metrics.os == TargetOs_openbsd) {
|
||||
|
||||
Reference in New Issue
Block a user