[Prev][Next][Index][Thread]
Re: linking to Math library with OSKit 20000202
> > errors for:
> > ...
>
> This is just how ld works. There are circular dependencies between libkern
> and libfreebsd_c. libkern references new symbols from the C library that
> were not referenced (and hence not resolved) the first time freebsd_c was
> scanned. This can be "fixed" by including -loskit_freebsd_c a second time
> after -loskit_kern. Adding -loskit_c as you did had the same effect except
> that you now have pieces of two incompatible c libraries. You don't want
> that!
Ok, I had a vague idea of how the linker worked previously, but you've
clarified what is going on!
> Same song, different verse. The threads library has dependencies on libdev
> and libsvm.
>
> The correct set of libraries for what you are doing is (I think!):
>
> -loskit_startup -loskit_clientos -loskit_threads -loskit_svm \
> -loskit_amm -loskit_dev -loskit_freebsd_m -loskit_freebsd_c_r \
> -loskit_kern -loskit_freebsd_c_r -loskit_threads -loskit_svm \
> -loskit_amm -loskit_lmm
>
> Are you appalled? You should be! We have attempted to bury this in a gcc
> front end script. If you "make install"ed your OSkit, it should put
> x86-oskit-gcc in the bin directory. This fires up GCC with a special specs
> file that configures the default set of libraries. With that installed,
> you should be able to replace the above with:
>
> x86-oskit-gcc -posix-oskit -pthread ...
Well it wouldn't be too much of a problem if there was a small amount of
libraries. Unfortunately not only are there many libraries but I'm totally
ignorant of the dependencies between them.
How do I figure out what depends on what. At the moment my best guess is
to look at the index in the oskit docs and guess from the functions that
the different libs implement.
Right now my link command is:
-loskit_startup -loskit_clientos -loskit_startup -loskit_com
-loskit_fsnamespace -loskit_threads -loskit_svm \
-loskit_amm -loskit_dev -loskit_freebsd_m -loskit_freebsd_c_r \
-loskit_kern -loskit_freebsd_c_r -loskit_svm \
-loskit_amm -loskit_lmm -loskit_freebsd_dev -loskit_linux_fs
-loskit_freebsd_c_r -loskit_kern -loskit_fsnamespace
and my first errors are:
/home/jewel/oskit-install/lib//liboskit_threads.a(osenv_safe.o): In
function `safeinterface_query':
/home/jewel/oskit-20000202/threads/osenv_safe.c:37: undefined reference to
`osenv_safe_iid'
/home/jewel/oskit-install/lib//liboskit_threads.a(osenv_safe.o): In
function `safeinterface_stream':
/home/jewel/oskit-20000202/threads/osenv_safe.c:66: undefined reference to
`oskit_wrap_stream'
/home/jewel/oskit-install/lib//liboskit_threads.a(osenv_safe.o): In
function `safeinterface_asyncio':
/home/jewel/oskit-20000202/threads/osenv_safe.c:78: undefined reference to
`oskit_wrap_asyncio'
/home/jewel/oskit-install/lib//liboskit_threads.a(osenv_safe.o): In
function `safeinterface_socket':
/home/jewel/oskit-20000202/threads/osenv_safe.c:90: undefined reference to
`oskit_wrap_socket'
/home/jewel/oskit-install/lib//liboskit_threads.a(osenv_safe.o): In
function `safeinterface_sockio':
/home/jewel/oskit-20000202/threads/osenv_safe.c:102: undefined reference
to `oskit_wrap_sockio'
So this is the thread library looking for references to what? It's
confusing to see the file osenv_safe.c looking for symbol osenv_safe_iid.
Is there any other documentation about resolving these link dependencies?
Thanks Mike
John
References: