Skip to content
/ osd Public

Commit d91516e

Browse files
committed
Getting rid of unsupported platforms
1 parent 722ce9b commit d91516e

File tree

2 files changed

+19
-26
lines changed

2 files changed

+19
-26
lines changed

.vscode/c_cpp_properties.json

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
"defines": ["__arm__", "__ARM_PCS"],
1919
"compilerPath": "toolchain/toolchain.hisilicon-hi3516ev200/bin/arm-openipc-linux-musleabi-gcc",
2020
"cStandard": "c11"
21-
},{
22-
"name": "arm9-glibc",
23-
"includePath": ["${workspaceFolder}/**"],
24-
"defines": ["__arm__", "__ARM_PCS"],
25-
"compilerPath": "toolchain/arm926t-gcc13-musl-3_0/bin/arm-openipc-linux-musleabi-gcc",
26-
"cStandard": "c11"
2721
},{
2822
"name": "arm9-musl3",
2923
"includePath": ["${workspaceFolder}/**"],
@@ -36,12 +30,6 @@
3630
"defines": ["__arm__", "__ARM_PCS"],
3731
"compilerPath": "toolchain/toolchain.hisilicon-hi3516cv200/bin/arm-openipc-linux-musleabi-gcc",
3832
"cStandard": "c11"
39-
},{
40-
"name": "arm9-uclibc",
41-
"includePath": ["${workspaceFolder}/**"],
42-
"defines": ["__arm__", "__ARM_PCS"],
43-
"compilerPath": "toolchain/toolchain.grainmedia-gm8136/bin/arm-openipc-linux-uclibcgnueabi-gcc",
44-
"cStandard": "c11"
4533
},{
4634
"name": "armhf-glibc",
4735
"includePath": ["${workspaceFolder}/**"],
@@ -54,18 +42,6 @@
5442
"defines": ["__arm__", "__ARM_PCS_VFP"],
5543
"compilerPath": "toolchain/toolchain.sigmastar-infinity6/bin/arm-openipc-linux-musleabihf-gcc",
5644
"cStandard": "c11"
57-
},{
58-
"name": "mips-musl",
59-
"includePath": ["${workspaceFolder}/**"],
60-
"defines": ["__mips__"],
61-
"compilerPath": "toolchain/toolchain.ingenic-t31/bin/mipsel-openipc-linux-musl-gcc",
62-
"cStandard": "c11"
63-
},{
64-
"name": "riscv64-musl",
65-
"includePath": ["${workspaceFolder}/**"],
66-
"defines": ["__riscv", "__riscv__"],
67-
"compilerPath": "toolchain/riscv64-lp64d--musl--stable-2024.05-1/bin/riscv64-linux-gcc",
68-
"cStandard": "c11"
6945
}
7046
],
7147
"version": 4

src/compat.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,34 @@ int sTaT(const char *path, struct _stat_ *buf)
2222
buf->st_mode = st.st_mode;
2323
return ret;
2424
}
25+
#else
26+
#include <fcntl.h>
27+
#include <sys/stat.h>
28+
29+
int stat(const char *restrict path, struct stat *restrict buf)
30+
{
31+
return fstatat(AT_FDCWD, path, buf, 0);
32+
}
2533
#endif
2634
#endif
2735

2836
void __assert(void) {}
2937
void akuio_clean_invalidate_dcache(void) {}
38+
#ifndef __GLIBC__
3039
void backtrace(void) {}
3140
void backtrace_symbols(void) {}
32-
#ifndef __GLIBC__
41+
#endif
3342
void __ctype_b(void) {}
43+
#ifndef __GLIBC__
3444
void __ctype_b_loc(void) {}
3545
void __ctype_tolower(void) {}
3646
#endif
3747
void _MI_PRINT_GetDebugLevel(void) {}
3848
void __pthread_register_cancel(void) {}
3949
void __pthread_unregister_cancel(void) {}
50+
#ifndef __UCLIBC__
4051
void _stdlib_mb_cur_max(void) {}
52+
#endif
4153

4254
float __expf_finite(float x) { return expf(x); }
4355
int __fgetc_unlocked(FILE *stream) { return fgetc(stream); }
@@ -47,6 +59,11 @@ void *mmap(void *start, size_t len, int prot, int flags, int fd, uint32_t off) {
4759
return (void*)syscall(SYS_mmap2, start, len, prot, flags, fd, off >> 12);
4860
}
4961

62+
void *__mmap64(void *start, size_t len, int prot, int flags, int fd, off_t off) {
63+
return (void*)syscall(SYS_mmap2, start, len, prot, flags, fd, off >> 12);
64+
}
65+
#if !(defined(__ARM_PCS_VFP) && defined(__UCLIBC__))
5066
void *mmap64(void *start, size_t len, int prot, int flags, int fd, off_t off) {
5167
return (void*)syscall(SYS_mmap2, start, len, prot, flags, fd, off >> 12);
52-
}
68+
}
69+
#endif

0 commit comments

Comments
 (0)