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

Re: [Xen-users] Mini-OS library linking

Hi Ian,

I managed to figure it all out (nearly). As soon as I fix a couple of things I'll publish some guidelines for cross-compiling new libraries into the current Mini-OS. Right now during compilation of my library, I pass through the various amounts of Mini-OS flags and I'm suppressing it from using the standard include path using -nostdinc in order to build it using NewLib header files. 

The strange thing is that by doing so, it gets stuck because of a missing <stddef.h>. Now... this isn't part of NewLib, so a fatal error occurs. However, Mini-OS itself has a header file <types.h> which uses the <stddef.h> from the Dom0 system headers. So I wonder if there's a way to include just one header file in GCC. Looking in /usr/include/linux/stddef.h, it has very little in it, so perhaps it's worth me including a copy in Mini-OS? Or is there a reason why they chose not to include one?

Thanks for your reply by the way, I understand it's not the easiest of topics. 

Apologies for the potentially confusing wording of my email,


On Tue, Aug 14, 2012 at 11:33 AM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
On Fri, 2012-08-10 at 19:19 +0100, Adrian Shaw wrote:
> Hi all,
> I'm trying to cross compile a library so it can be used in a Mini-OS
> C-stubdomain.

The mini-os/stubdom build system is a bit of a black art. It might help
if you were to publish your patches so we can see/understand what you
are doing.

> I have added the necessary rules to the stubdom Makefile to compile my
> library.
> The resulting static library file (.a file) I've placed with the other
> static libraries like libm.a, libc.a, libz.a, libnosys.a etc (they are
> all in a directory called
> stubdom/cross-root-x86_64/x86_64(something)/lib/
> I have also copied my library header file into the Mini-OS include
> directory in extras/mini-os/include.
> However, I am finding it very hard to find where to specify the
> linking to my static library.
> In my main.c file in stubdom/c I keep getting undefined reference
> errors.
> Please tell me if I'm going about this the wrong way.
> I was just going by how the other libraries seem to have been compiled
> in.
> What are the few things I need to have in place for me to use
> functions in main.c?
> I'm aware that this might be a daft question, but the makefile isn't
> clear to me.
> Regards,
> Adrian
> PS: I also tried to add my .a static library into the APP_OBJS in the
> c-stubdom rule, but it didn't work (complaining about no rule for that
> target - why should I need one?)

( +44

Xen-users mailing list



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