aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2020-09-28 12:48:50 +0100
committerGitHub <noreply@github.com>2020-09-28 12:48:50 +0100
commit1818ceb4f2b474152fed0cb7e5cfaeaa26e00105 (patch)
tree72d1351b496f9fc379779001b5e44e4ffa675756
parente95addb1f4f298a7befa2a45dadbce9fcb7a0e00 (diff)
parent6b83159b062b72727d887663452fa445382373fc (diff)
Merge pull request #747 from Platin21/master
Fixes for MacOS 11 / Big Sur
-rw-r--r--core/os/os_darwin.odin4
-rw-r--r--core/sys/darwin/mach_darwin.odin2
-rw-r--r--core/time/time_unix.odin7
-rw-r--r--src/main.cpp12
4 files changed, 19 insertions, 6 deletions
diff --git a/core/os/os_darwin.odin b/core/os/os_darwin.odin
index 5169572b5..36cd13804 100644
--- a/core/os/os_darwin.odin
+++ b/core/os/os_darwin.odin
@@ -1,8 +1,8 @@
package os
foreign import dl "system:dl"
-foreign import libc "system:c"
-foreign import pthread "system:pthread"
+foreign import libc "System.framework"
+foreign import pthread "System.framework"
import "core:runtime"
import "core:strings"
diff --git a/core/sys/darwin/mach_darwin.odin b/core/sys/darwin/mach_darwin.odin
index 52a145507..25fc63c32 100644
--- a/core/sys/darwin/mach_darwin.odin
+++ b/core/sys/darwin/mach_darwin.odin
@@ -1,6 +1,6 @@
package darwin;
-foreign import "system:pthread"
+foreign import pthread "System.framework"
import "core:c"
diff --git a/core/time/time_unix.odin b/core/time/time_unix.odin
index 3acc636e1..2419a3f8b 100644
--- a/core/time/time_unix.odin
+++ b/core/time/time_unix.odin
@@ -3,7 +3,12 @@ package time
IS_SUPPORTED :: true; // NOTE: Times on Darwin are UTC.
-foreign import libc "system:c"
+when ODIN_OS == "darwin" {
+ foreign import libc "System.framework"
+} else {
+ foreign import libc "system:c"
+}
+
@(default_calling_convention="c")
foreign libc {
diff --git a/src/main.cpp b/src/main.cpp
index e53f1b7d9..b15518d6e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -432,7 +432,11 @@ i32 linker_stage(lbGenerator *gen) {
#endif
, linker, object_files, LIT(output_base), LIT(output_ext),
lib_str,
- "-lc -lm",
+ #if defined(GB_SYSTEM_OSX)
+ "-lSystem -lm -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk",
+ #else
+ "-lc -lm",
+ #endif
LIT(build_context.link_flags),
LIT(build_context.extra_linker_flags),
link_settings);
@@ -2195,7 +2199,11 @@ int main(int arg_count, char const **arg_ptr) {
#endif
, linker, LIT(output_base), LIT(output_base), LIT(output_ext),
lib_str,
- "-lc -lm",
+ #if defined(GB_SYSTEM_OSX)
+ "-lSystem -lm -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk",
+ #else
+ "-lc -lm",
+ #endif
LIT(build_context.link_flags),
LIT(build_context.extra_linker_flags),
link_settings);