diff options
| author | kstrb <(none)> | 2022-03-05 17:28:34 +0100 |
|---|---|---|
| committer | kstrb <(none)> | 2022-03-05 17:28:34 +0100 |
| commit | 1cd89b2da36134fc43e0cc2fe25a1dc9bfb9932a (patch) | |
| tree | 13eb61a4d4646ef13481ace41f9cb36eef6e0861 | |
| parent | 07062324d71787e60c616ffb5d90ea18baa2fda5 (diff) | |
Linux: allow 'foreign import' of object files
| -rw-r--r-- | src/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index f8a3e6f85..8db3a09ec 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -406,8 +406,8 @@ i32 linker_stage(lbGenerator *gen) { // available at runtime wherever the executable is run, so we make require those to be // local to the executable (unless the system collection is used, in which case we search // the system library paths for the library file). - if (string_ends_with(lib, str_lit(".a"))) { - // static libs, absolute full path relative to the file in which the lib was imported from + if (string_ends_with(lib, str_lit(".a")) || string_ends_with(lib, str_lit(".o"))) { + // static libs and object files, absolute full path relative to the file in which the lib was imported from lib_str = gb_string_append_fmt(lib_str, " -l:\"%.*s\" ", LIT(lib)); } else if (string_ends_with(lib, str_lit(".so"))) { // dynamic lib, relative path to executable |