diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2026-02-02 18:13:48 +0100 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2026-02-02 18:13:48 +0100 |
| commit | afbbb829eac29e90ba693730641b586194cbef74 (patch) | |
| tree | 7a4203c38768915fb951f2ecf5fe8f09289a86d0 /src/linker.cpp | |
| parent | 3666c1d3aadc2dca24d6af375f6f367812e30bf2 (diff) | |
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.
Diffstat (limited to 'src/linker.cpp')
| -rw-r--r-- | src/linker.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/linker.cpp b/src/linker.cpp index f369a5a38..4ad3cf6d2 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -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); |