[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [Unikraft] Undefined reference error when adding code in stdlib.c



Hi All.

I added the following code in unikraft/lib/nolibc/stdlib.c

#####################################################
#include <uk/plat/time.h>
#include <sys/time.h>


#define ONE_BILLION   1000000000
void clock_gettime(struct timespec *t)
{
    long nanoseconds = ukplat_monotonic_clock();

    t->tv_sec = nanoseconds /  ONE_BILLION;
    t->tv_nsec = nanoseconds % ONE_BILLION;
}
#####################################################



Now, after I do make, I get the following error :

#####################################################
/home/ajay/unikraft/apps/helloworld/build/libnolibc.o: In function
`clock_gettime':
(.text+0x16cd): undefined reference to `ukplat_monotonic_clock'
/home/ajay/unikraft/unikraft/plat/linuxu/Linker.uk:9: recipe for
target '/home/ajay/unikraft/apps/helloworld/build/helloworld_linuxu-x86_64'
failed
make[2]: *** 
[/home/ajay/unikraft/apps/helloworld/build/helloworld_linuxu-x86_64]
Error 1
#####################################################



Seems that nolibc does not reference platform-specific code.
If so, what is the correct procedure to add this function, which can
be called generically, but uses a platform-specific API to get the
final result?


Thanks and Regards,
Ajay

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.