BareMetal is a 64-bit OS for x86-64 based computers. The OS is written entirely in Assembly while applications can be written in Assembly, C/C++, and Rust.
1.74k
stars
302
forks
source link
Provide a minimal implementation of the newlib syscalls times function #77
The newlib syscalls times function is undefined for BareMetal; this causes problems when trying to link a program that calls a standard C library function that depends on the times function, such as the standard C library clock function.
root@debian:# gcc -std=c99 -pedantic -I newlib-2.2.0/newlib/libc/include/ -c clocktest.c -o clocktest.o
root@debian:# ld -T app.ld -o clocktest.app crt0.o clocktest.o libc.a
libc.a(lib_a-timesr.o): In function `_times_r':
/root/BareMetal/newlib/build/x86_64-pc-baremetal/newlib/libc/reent/../../../../../newlib-2.2.0/newlib/libc/reent/timesr.c:60: undefined reference to `times'
Although this is only a minimal implementation of the times function, it will allow programs that depends on the times function to link and fail gracefully.
The newlib syscalls
times
function is undefined for BareMetal; this causes problems when trying to link a program that calls a standard C library function that depends on thetimes
function, such as the standard C libraryclock
function.Take for example the following C program:
The following error occurs:
Although this is only a minimal implementation of the
times
function, it will allow programs that depends on thetimes
function to link and fail gracefully.