arm: fixing libc

This commit is contained in:
Steven Hugg 2023-12-30 15:49:48 -05:00
parent 949e216c69
commit 70eee2bdae
3 changed files with 18 additions and 2 deletions

View File

@ -0,0 +1,16 @@
#include <string.h>
#include <stdio.h>
#define SERIAL_OUT ((int*)0x4000048)
void putchar_(char c) {
*SERIAL_OUT = c;
}
int main() {
int x = 2024*2;
x /= 2; // TODO: we need this to bring in __aeabi_uldivmod() etc.
printf("Hello World! %d\n", x);
return 0;
}

View File

@ -359,8 +359,8 @@ export var PLATFORM_PARAMS = {
arch: 'arm32',
define: ['__ARM__', 'DISABLE_UNIMPLEMENTED_LIBC_APIS', 'PRINTF_ALIAS_STANDARD_FUNCTION_NAMES_SOFT'],
extra_compile_args: ['-I./arch/arm/include', '-I./openlibm/include', '-I./openlibm/src', '-I./printf/src'],
extra_link_files: ['crt0.c', 'arm-libtcc1.a', 'libc.a'],
extra_link_args: ['arm-libtcc1.a', 'libc.a'],
extra_link_files: ['crt0.c', 'libtcc1.a', 'libc.a'],
extra_link_args: ['-ltcc1', '-lc'],
crt0: 'crt0.c',
},
};