diff options
Diffstat (limited to 'src/linker.cpp')
| -rw-r--r-- | src/linker.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/linker.cpp b/src/linker.cpp index c2a3ee928..c68417994 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -737,7 +737,21 @@ try_cross_linking:; } if (build_context.build_mode == BuildMode_StaticLibrary) { - compiler_error("TODO(bill): -build-mode:static on non-windows targets"); + TIME_SECTION("Static Library Creation"); + + gbString ar_command = gb_string_make(heap_allocator(), ""); + defer (gb_string_free(ar_command)); + + ar_command = gb_string_appendc(ar_command, "ar rcs "); + ar_command = gb_string_append_fmt(ar_command, "\"%.*s\" ", LIT(output_filename)); + ar_command = gb_string_appendc(ar_command, object_files); + + result = system_exec_command_line_app("ar", ar_command); + if (result) { + return result; + } + + return result; } // NOTE(dweiler): We use clang as a frontend for the linker as there are |