Compare commits
3 Commits
31df6146bf
...
ff71a50db7
| Author | SHA1 | Date | |
|---|---|---|---|
| ff71a50db7 | |||
| bbc6b1be4f | |||
| 101c95d45f |
8
Makefile
8
Makefile
@ -20,13 +20,13 @@ bldtst: buildtest.c arch/*.c
|
|||||||
gcc -static -nostdlib -Wno-builtin-declaration-mismatch -fno-stack-protector -o bldtst buildtest.c arch/*.c
|
gcc -static -nostdlib -Wno-builtin-declaration-mismatch -fno-stack-protector -o bldtst buildtest.c arch/*.c
|
||||||
|
|
||||||
bldtst_llvm: buildtest.c arch/*.c
|
bldtst_llvm: buildtest.c arch/*.c
|
||||||
clang -nostdlib -static -fuse-ld=lld -fno-stack-protector -o bldtst_llvm buildtest.c arch/*.c
|
clang -nostdlib -Wno-incompatible-library-redeclaration -static -fuse-ld=lld -fno-stack-protector -o bldtst_llvm buildtest.c arch/*.c
|
||||||
|
|
||||||
bldtst_x64: buildtest.c arch/x86_64.c
|
bldtst_x64: buildtest.c arch/x86_64.c
|
||||||
clang --target=x86_64-linux-gnu -nostdlib -static -fuse-ld=lld -fno-stack-protector -o bldtst_x64 buildtest.c arch/x86_64.c
|
clang --target=x86_64-linux-gnu -nostdlib -Wno-incompatible-library-redeclaration -static -fuse-ld=lld -fno-stack-protector -o bldtst_x64 buildtest.c arch/x86_64.c
|
||||||
|
|
||||||
bldtst_aarch64: buildtest.c
|
bldtst_aarch64: buildtest.c
|
||||||
clang --target=aarch64-linux-gnu -nostdlib -static -fuse-ld=lld -fno-stack-protector -o bldtst_aarch64 buildtest.c arch/aarch64.c
|
clang --target=aarch64-linux-gnu -nostdlib -Wno-incompatible-library-redeclaration -static -fuse-ld=lld -fno-stack-protector -o bldtst_aarch64 buildtest.c arch/aarch64.c
|
||||||
|
|
||||||
bldtst_mips32: buildtest.c
|
bldtst_mips32: buildtest.c
|
||||||
clang --target=mips-linux-gnu -nostdlib -static -fuse-ld=lld -fno-stack-protector -fno-pic -o bldtst_mips32 buildtest.c arch/mips.c
|
clang --target=mips-linux-gnu -nostdlib -Wno-incompatible-library-redeclaration -static -fuse-ld=lld -fno-stack-protector -fno-pic -o bldtst_mips32 buildtest.c arch/mips.c
|
||||||
|
|||||||
@ -9,6 +9,7 @@ void exit(int8_t status){
|
|||||||
: "r" ((long)status) // Input operand: status
|
: "r" ((long)status) // Input operand: status
|
||||||
: "x0", "x8" // Clobbered registers
|
: "x0", "x8" // Clobbered registers
|
||||||
);
|
);
|
||||||
|
for (;;);
|
||||||
}
|
}
|
||||||
|
|
||||||
intptr_t write(int32_t fd, const void* buf, intptr_t size){
|
intptr_t write(int32_t fd, const void* buf, intptr_t size){
|
||||||
|
|||||||
@ -10,6 +10,7 @@ void exit(int8_t status){
|
|||||||
: "r" (status)
|
: "r" (status)
|
||||||
: "a0", "v0"
|
: "a0", "v0"
|
||||||
);
|
);
|
||||||
|
for(;;);
|
||||||
}
|
}
|
||||||
|
|
||||||
intptr_t write(int32_t fd, const void* buf, intptr_t size){
|
intptr_t write(int32_t fd, const void* buf, intptr_t size){
|
||||||
|
|||||||
@ -9,6 +9,7 @@ void exit(int8_t status) {
|
|||||||
: "a"(SYS_EXIT), "D"(status)
|
: "a"(SYS_EXIT), "D"(status)
|
||||||
:
|
:
|
||||||
);
|
);
|
||||||
|
for(;;);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SYS_WRITE 1
|
#define SYS_WRITE 1
|
||||||
|
|||||||
1
sys.h
1
sys.h
@ -16,5 +16,6 @@ uint32_t fork();
|
|||||||
void *memset(void* s, int c, unsigned long n) {
|
void *memset(void* s, int c, unsigned long n) {
|
||||||
int8_t* mem = s;
|
int8_t* mem = s;
|
||||||
for(long int i = 0; i < n; ++i) mem[i] = c;
|
for(long int i = 0; i < n; ++i) mem[i] = c;
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
#endif // !MINIMALSYS_H
|
#endif // !MINIMALSYS_H
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user