mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
Minimally support compiling Odin on FreeBSD arm64
This is enough to get Odin itself compiling and the demo running.
This commit is contained in:
@@ -159,7 +159,7 @@ blkcnt_t :: i64
|
|||||||
blksize_t :: i32
|
blksize_t :: i32
|
||||||
fflags_t :: u32
|
fflags_t :: u32
|
||||||
|
|
||||||
when ODIN_ARCH == .amd64 /* LP64 */ {
|
when ODIN_ARCH == .amd64 || ODIN_ARCH == .arm64 /* LP64 */ {
|
||||||
time_t :: i64
|
time_t :: i64
|
||||||
} else {
|
} else {
|
||||||
time_t :: i32
|
time_t :: i32
|
||||||
|
|||||||
+14
-1
@@ -549,6 +549,14 @@ gb_global TargetMetrics target_freebsd_amd64 = {
|
|||||||
str_lit("e-m:w-i64:64-f80:128-n8:16:32:64-S128"),
|
str_lit("e-m:w-i64:64-f80:128-n8:16:32:64-S128"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
gb_global TargetMetrics target_freebsd_arm64 = {
|
||||||
|
TargetOs_freebsd,
|
||||||
|
TargetArch_arm64,
|
||||||
|
8, 8, 16, 16,
|
||||||
|
str_lit("aarch64-unknown-freebsd-elf"),
|
||||||
|
str_lit("e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"),
|
||||||
|
};
|
||||||
|
|
||||||
gb_global TargetMetrics target_openbsd_amd64 = {
|
gb_global TargetMetrics target_openbsd_amd64 = {
|
||||||
TargetOs_openbsd,
|
TargetOs_openbsd,
|
||||||
TargetArch_amd64,
|
TargetArch_amd64,
|
||||||
@@ -670,6 +678,7 @@ gb_global NamedTargetMetrics named_targets[] = {
|
|||||||
|
|
||||||
{ str_lit("freebsd_i386"), &target_freebsd_i386 },
|
{ str_lit("freebsd_i386"), &target_freebsd_i386 },
|
||||||
{ str_lit("freebsd_amd64"), &target_freebsd_amd64 },
|
{ str_lit("freebsd_amd64"), &target_freebsd_amd64 },
|
||||||
|
{ str_lit("freebsd_arm64"), &target_freebsd_arm64 },
|
||||||
|
|
||||||
{ str_lit("openbsd_amd64"), &target_openbsd_amd64 },
|
{ str_lit("openbsd_amd64"), &target_openbsd_amd64 },
|
||||||
{ str_lit("haiku_amd64"), &target_haiku_amd64 },
|
{ str_lit("haiku_amd64"), &target_haiku_amd64 },
|
||||||
@@ -1424,7 +1433,11 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
|
|||||||
metrics = &target_darwin_amd64;
|
metrics = &target_darwin_amd64;
|
||||||
#endif
|
#endif
|
||||||
#elif defined(GB_SYSTEM_FREEBSD)
|
#elif defined(GB_SYSTEM_FREEBSD)
|
||||||
metrics = &target_freebsd_amd64;
|
#if defined(GB_CPU_ARM)
|
||||||
|
metrics = &target_freebsd_arm64;
|
||||||
|
#else
|
||||||
|
metrics = &target_freebsd_amd64;
|
||||||
|
#endif
|
||||||
#elif defined(GB_SYSTEM_OPENBSD)
|
#elif defined(GB_SYSTEM_OPENBSD)
|
||||||
metrics = &target_openbsd_amd64;
|
metrics = &target_openbsd_amd64;
|
||||||
#elif defined(GB_SYSTEM_HAIKU)
|
#elif defined(GB_SYSTEM_HAIKU)
|
||||||
|
|||||||
@@ -3009,6 +3009,8 @@ gb_inline u32 gb_thread_current_id(void) {
|
|||||||
thread_id = gettid();
|
thread_id = gettid();
|
||||||
#elif defined(GB_SYSTEM_HAIKU)
|
#elif defined(GB_SYSTEM_HAIKU)
|
||||||
thread_id = find_thread(NULL);
|
thread_id = find_thread(NULL);
|
||||||
|
#elif defined(GB_SYSTEM_FREEBSD)
|
||||||
|
thread_id = pthread_getthreadid_np();
|
||||||
#else
|
#else
|
||||||
#error Unsupported architecture for gb_thread_current_id()
|
#error Unsupported architecture for gb_thread_current_id()
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -492,6 +492,8 @@ gb_internal u32 thread_current_id(void) {
|
|||||||
thread_id = gettid();
|
thread_id = gettid();
|
||||||
#elif defined(GB_SYSTEM_HAIKU)
|
#elif defined(GB_SYSTEM_HAIKU)
|
||||||
thread_id = find_thread(NULL);
|
thread_id = find_thread(NULL);
|
||||||
|
#elif defined(GB_SYSTEM_FREEBSD)
|
||||||
|
thread_id = pthread_getthreadid_np();
|
||||||
#else
|
#else
|
||||||
#error Unsupported architecture for thread_current_id()
|
#error Unsupported architecture for thread_current_id()
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user