mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Added arm64 support for NetBSD
This commit is contained in:
@@ -10,7 +10,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build, Check, and Test
|
- name: Build, Check, and Test
|
||||||
timeout-minutes: 25
|
timeout-minutes: 15
|
||||||
uses: vmactions/netbsd-vm@v1
|
uses: vmactions/netbsd-vm@v1
|
||||||
with:
|
with:
|
||||||
release: "10.0"
|
release: "10.0"
|
||||||
@@ -31,6 +31,7 @@ jobs:
|
|||||||
./odin version
|
./odin version
|
||||||
./odin report
|
./odin report
|
||||||
./odin check examples/all -vet -strict-style -target:netbsd_amd64
|
./odin check examples/all -vet -strict-style -target:netbsd_amd64
|
||||||
|
./odin check examples/all -vet -strict-style -target:netbsd_arm64
|
||||||
(cd tests/core; gmake all_bsd)
|
(cd tests/core; gmake all_bsd)
|
||||||
(cd tests/internal; gmake all_bsd)
|
(cd tests/internal; gmake all_bsd)
|
||||||
(cd tests/issues; ./run.sh)
|
(cd tests/issues; ./run.sh)
|
||||||
|
|||||||
+15
-2
@@ -1039,6 +1039,13 @@ gb_global TargetMetrics target_netbsd_amd64 = {
|
|||||||
str_lit("x86_64-unknown-netbsd-elf"),
|
str_lit("x86_64-unknown-netbsd-elf"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
gb_global TargetMetrics target_netbsd_arm64 = {
|
||||||
|
TargetOs_netbsd,
|
||||||
|
TargetArch_arm64,
|
||||||
|
8, 8, 16, 16,
|
||||||
|
str_lit("aarch64-unknown-netbsd-elf"),
|
||||||
|
};
|
||||||
|
|
||||||
gb_global TargetMetrics target_haiku_amd64 = {
|
gb_global TargetMetrics target_haiku_amd64 = {
|
||||||
TargetOs_haiku,
|
TargetOs_haiku,
|
||||||
TargetArch_amd64,
|
TargetArch_amd64,
|
||||||
@@ -1154,8 +1161,10 @@ gb_global NamedTargetMetrics named_targets[] = {
|
|||||||
{ str_lit("freebsd_amd64"), &target_freebsd_amd64 },
|
{ str_lit("freebsd_amd64"), &target_freebsd_amd64 },
|
||||||
{ str_lit("freebsd_arm64"), &target_freebsd_arm64 },
|
{ str_lit("freebsd_arm64"), &target_freebsd_arm64 },
|
||||||
|
|
||||||
{ str_lit("openbsd_amd64"), &target_openbsd_amd64 },
|
|
||||||
{ str_lit("netbsd_amd64"), &target_netbsd_amd64 },
|
{ str_lit("netbsd_amd64"), &target_netbsd_amd64 },
|
||||||
|
{ str_lit("netbsd_arm64"), &target_netbsd_arm64 },
|
||||||
|
|
||||||
|
{ str_lit("openbsd_amd64"), &target_openbsd_amd64 },
|
||||||
{ str_lit("haiku_amd64"), &target_haiku_amd64 },
|
{ str_lit("haiku_amd64"), &target_haiku_amd64 },
|
||||||
|
|
||||||
{ str_lit("freestanding_wasm32"), &target_freestanding_wasm32 },
|
{ str_lit("freestanding_wasm32"), &target_freestanding_wasm32 },
|
||||||
@@ -1916,7 +1925,11 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
|
|||||||
#elif defined(GB_SYSTEM_OPENBSD)
|
#elif defined(GB_SYSTEM_OPENBSD)
|
||||||
metrics = &target_openbsd_amd64;
|
metrics = &target_openbsd_amd64;
|
||||||
#elif defined(GB_SYSTEM_NETBSD)
|
#elif defined(GB_SYSTEM_NETBSD)
|
||||||
metrics = &target_netbsd_amd64;
|
#if defined(GB_CPU_ARM)
|
||||||
|
metrics = &target_netbsd_arm64;
|
||||||
|
#else
|
||||||
|
metrics = &target_netbsd_amd64;
|
||||||
|
#endif
|
||||||
#elif defined(GB_SYSTEM_HAIKU)
|
#elif defined(GB_SYSTEM_HAIKU)
|
||||||
metrics = &target_haiku_amd64;
|
metrics = &target_haiku_amd64;
|
||||||
#elif defined(GB_CPU_ARM)
|
#elif defined(GB_CPU_ARM)
|
||||||
|
|||||||
@@ -256,6 +256,7 @@ extern "C" {
|
|||||||
|
|
||||||
#if defined(GB_SYSTEM_NETBSD)
|
#if defined(GB_SYSTEM_NETBSD)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <lwp.h>
|
||||||
#define lseek64 lseek
|
#define lseek64 lseek
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -3027,6 +3028,8 @@ gb_inline u32 gb_thread_current_id(void) {
|
|||||||
thread_id = find_thread(NULL);
|
thread_id = find_thread(NULL);
|
||||||
#elif defined(GB_SYSTEM_FREEBSD)
|
#elif defined(GB_SYSTEM_FREEBSD)
|
||||||
thread_id = pthread_getthreadid_np();
|
thread_id = pthread_getthreadid_np();
|
||||||
|
#elif defined(GB_SYSTEM_NETBSD)
|
||||||
|
thread_id = (u32)_lwp_self();
|
||||||
#else
|
#else
|
||||||
#error Unsupported architecture for gb_thread_current_id()
|
#error Unsupported architecture for gb_thread_current_id()
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -494,6 +494,8 @@ gb_internal u32 thread_current_id(void) {
|
|||||||
thread_id = find_thread(NULL);
|
thread_id = find_thread(NULL);
|
||||||
#elif defined(GB_SYSTEM_FREEBSD)
|
#elif defined(GB_SYSTEM_FREEBSD)
|
||||||
thread_id = pthread_getthreadid_np();
|
thread_id = pthread_getthreadid_np();
|
||||||
|
#elif defined(GB_SYSTEM_NETBSD)
|
||||||
|
thread_id = (u32)_lwp_self();
|
||||||
#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