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

Re: linking to Math library with OSKit 20000202



> Date: Fri, 26 May 2000 16:47:29 -0200 (GMT+2)
> From: John Leuner <jewel@pixie.co.za>
> Subject: Re: linking to Math library with OSKit 20000202
> To: Ian Braithwaite <idb@iau.dtu.dk>
> 
> > The math library is liboskit_freebsd_m.a
> > 
> > You still seem to have both the freebsd C library and the minimal C
> > library, -loskit_freebsd_c and -loskit_c above.
> 
> With the following link command:
> 
> kissmeimage: /home/jewel/oskit-install/lib/oskit/multiboot.o $(DEPENDLIBS) 
> $(MYOBJECTS)
>         $(LD) -Ttext 100000 $(LDFLAGS) $(OSKIT_LDFLAGS) \
>         -o $@ $(filter-out %.a,$^) \
>         -loskit_clientos -loskit_startup -loskit_com -loskit_freebsd_c
> 	-loskit_kern -loskit_fsnamespace -loskit_memfs -loskit_lmm /home/jewel/oskit-install/lib/oskit/crtn.o -loskit_posix
> 	-loskit_freebsd_dev  -loskit_freebsd_m
> 
> I get errors for missing pthread functions (as expected), but I also have
> 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!

> When add -loskit_threads, I get:
> ...

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 ...

Follow-Ups: