mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 21:10:30 +00:00
fix LTO on MacOS
If no `-minimum-os-version` is given, ignore the `override-module` warnings. The user not using, `-minimum-os-version` opts you into linker warnings about target versions. If a `-minimum-os-version` is provided, normalize it to a full version `11` to `11.0.0` for example. The linker seems to want that when doing LTO.
This commit is contained in:
@@ -978,6 +978,10 @@ try_cross_linking:;
|
||||
if (build_context.lto_kind != LTO_None) {
|
||||
link_command_line = gb_string_appendc(link_command_line, " -flto=thin");
|
||||
link_command_line = gb_string_append_fmt(link_command_line, " -flto-jobs=%d ", build_context.thread_count);
|
||||
|
||||
if (is_osx && !build_context.minimum_os_version_string_given) {
|
||||
link_command_line = gb_string_appendc(link_command_line, " -Wno-override-module ");
|
||||
}
|
||||
}
|
||||
|
||||
link_command_line = gb_string_appendc(link_command_line, object_files);
|
||||
|
||||
Reference in New Issue
Block a user