mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
fix -no-crt on Linux
This commit is contained in:
+9
-13
@@ -494,19 +494,6 @@ gb_internal i32 linker_stage(LinkerData *gen) {
|
|||||||
platform_lib_str = gb_string_appendc(platform_lib_str, "-L/opt/local/lib ");
|
platform_lib_str = gb_string_appendc(platform_lib_str, "-L/opt/local/lib ");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(GB_SYSTEM_OSX)
|
|
||||||
if(!build_context.no_crt) {
|
|
||||||
platform_lib_str = gb_string_appendc(platform_lib_str, " -lm ");
|
|
||||||
if(gen->needs_system_library_linked == 1) {
|
|
||||||
platform_lib_str = gb_string_appendc(platform_lib_str, " -lSystem ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
} else {
|
|
||||||
platform_lib_str = gb_string_appendc(platform_lib_str, "-lc -lm");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (build_context.metrics.os == TargetOs_darwin) {
|
|
||||||
// This sets a requirement of Mountain Lion and up, but the compiler doesn't work without this limit.
|
// This sets a requirement of Mountain Lion and up, but the compiler doesn't work without this limit.
|
||||||
if (build_context.minimum_os_version_string.len) {
|
if (build_context.minimum_os_version_string.len) {
|
||||||
link_settings = gb_string_append_fmt(link_settings, "-mmacosx-version-min=%.*s ", LIT(build_context.minimum_os_version_string));
|
link_settings = gb_string_append_fmt(link_settings, "-mmacosx-version-min=%.*s ", LIT(build_context.minimum_os_version_string));
|
||||||
@@ -515,6 +502,15 @@ gb_internal i32 linker_stage(LinkerData *gen) {
|
|||||||
link_settings = gb_string_appendc(link_settings, "-e _main ");
|
link_settings = gb_string_appendc(link_settings, "-e _main ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!build_context.no_crt) {
|
||||||
|
platform_lib_str = gb_string_appendc(platform_lib_str, "-lm ");
|
||||||
|
if (build_context.metrics.os == TargetOs_darwin) {
|
||||||
|
platform_lib_str = gb_string_appendc(platform_lib_str, "-lSystem ");
|
||||||
|
} else {
|
||||||
|
platform_lib_str = gb_string_appendc(platform_lib_str, "-lc ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gbString link_command_line = gb_string_make(heap_allocator(), "clang -Wno-unused-command-line-argument ");
|
gbString link_command_line = gb_string_make(heap_allocator(), "clang -Wno-unused-command-line-argument ");
|
||||||
defer (gb_string_free(link_command_line));
|
defer (gb_string_free(link_command_line));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user