Hello,
I get an "undefined reference to `__msync13'" error message when compiling the OCaml test suite and I've pinpointed the origin of this message to the use of the mmap function msync().
I've tried to understand Minix source code to understand how this function is defined and why it is not exported in the libraries but I must declare that's not clear in my mind and I'm reaching the limits of my knowledge on system calls.
Take the following small program:
~~ toto.c ~~~~~~~~~~
#include <stdio.h>
#include <sys/mman.h>
void toto(void * addr, unsigned int len)
{
msync(addr, len, MS_ASYNC);
printf("Hello Minix World!");
}
~~ end toto.c ~~~~~~~~~~
Compile it to create a shared library:
$ clang -fPIC -shared toto.c -o toto.so
and try to link it:
$ ld toto.so
ld: warning: cannot find entry symbol _start; defaulting to 08048171
toto.so: undefined reference to `__msync13'
If you remove the msync() call to keep only the printf() line, the "undefined reference" message disappears.
$ ld toto.so
ld: warning: cannot find entry symbol _start; defaulting to 08048171
What is the reason for this error and how can I correct it?
Thanks for any idea.
--
Pierre Métras