mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-31 20:00:09 +00:00
darwin: actually honor no-crt by not linking with -lSystem -lm
This commit is contained in:
+12
-1
@@ -37,7 +37,18 @@ when ODIN_NO_CRT && ODIN_OS == .Windows {
|
|||||||
}
|
}
|
||||||
return ptr
|
return ptr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@(link_name="bzero", linkage="strong", require)
|
||||||
|
bzero :: proc "c" (ptr: rawptr, len: int) -> rawptr {
|
||||||
|
if ptr != nil && len != 0 {
|
||||||
|
p := ([^]byte)(ptr)
|
||||||
|
for i := 0; i < len; i += 1 {
|
||||||
|
p[i] = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ptr
|
||||||
|
}
|
||||||
|
|
||||||
@(link_name="memmove", linkage="strong", require)
|
@(link_name="memmove", linkage="strong", require)
|
||||||
memmove :: proc "c" (dst, src: rawptr, len: int) -> rawptr {
|
memmove :: proc "c" (dst, src: rawptr, len: int) -> rawptr {
|
||||||
d, s := ([^]byte)(dst), ([^]byte)(src)
|
d, s := ([^]byte)(dst), ([^]byte)(src)
|
||||||
|
|||||||
+6
-3
@@ -483,10 +483,13 @@ gb_internal i32 linker_stage(LinkerData *gen) {
|
|||||||
gbString platform_lib_str = gb_string_make(heap_allocator(), "");
|
gbString platform_lib_str = gb_string_make(heap_allocator(), "");
|
||||||
defer (gb_string_free(platform_lib_str));
|
defer (gb_string_free(platform_lib_str));
|
||||||
if (build_context.metrics.os == TargetOs_darwin) {
|
if (build_context.metrics.os == TargetOs_darwin) {
|
||||||
platform_lib_str = gb_string_appendc(platform_lib_str, "-lm -Wl,-syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -L/usr/local/lib");
|
platform_lib_str = gb_string_appendc(platform_lib_str, "-Wl,-syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -L/usr/local/lib");
|
||||||
#if defined(GB_SYSTEM_OSX)
|
#if defined(GB_SYSTEM_OSX)
|
||||||
if(gen->needs_system_library_linked == 1) {
|
if(!build_context.no_crt) {
|
||||||
platform_lib_str = gb_string_appendc(platform_lib_str, " -lSystem ");
|
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
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user