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

[Xen-devel] Error when Glib cross compiled into Mini-OS without the support of "_POSIX_THREADS"


  • To: xen-devel <xen-devel@xxxxxxxxxxxxx>
  • From: "Lele MA" <lelema.zh@xxxxxxxxx>
  • Date: Thu, 25 Sep 2014 17:08:52 +0800 (CST)
  • Delivery-date: Thu, 25 Sep 2014 09:11:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Hi all,

I am trying to cross compile Glib into xen stubdom (based on Mini-OS). Does anyone knows how to cross compile the library into mini-OS?

I add the 'cross-glib' target in Makefile. The cross compilation and installation are succeed.

But when cross compiled with the main.c that include <glib.h>, it yields:
        cross-root-x86_64/x86_64-xen-elf/include/glib-2.0/glib/deprecated/gthread.h:162:5: error: unknown type name âpthread_tâ
        make[1]: *** [main.o] Error 1

The Makefile rules like this:

    TARGET_CPPFLAGS += -isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include/glib-2.0  
    TARGET_CPPFLAGS += -isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib/glib-2.0/include

     .PHONY: cross-glib
     cross-glib: glib-$(GLIB_VERSION) $(NEWLIB_STAMPFILE)
           ( cd $< && \
            CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf --verbose --host=$(GNU_TARGET_ARCH)-xen-elf && \
            $(MAKE) DESTDIR= && \
            $(MAKE) DESTDIR= install )
     .PHONY: $(CROSS_ROOT)
     $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci cross-glib


Then I compile the c-stubdom with command "make c-stubdom"
I find pthread_t is defined in <sys/types.h>, which is included in 'pthread.h':
      #if defined(_POSIX_THREADS)
      #include <sys/types.h>
      #include <time.h>
      #include <sys/sched.h>

Does it mean the system doesn't define "_POSIX_THREADS"?
If so, can I still use the glib in the Mini-OS without the support of "_POSIX_THREADS"?

Any advice will be appreciated!

Lele Ma
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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