From: "Lele MA" <lelema.zh@gmail.com>
To: xen-devel <xen-devel@lists.xen.org>
Subject: Error when Glib cross compiled into Mini-OS without the support of "_POSIX_THREADS"
Date: Thu, 25 Sep 2014 17:08:52 +0800 (CST) [thread overview]
Message-ID: <ba3f2d9.b0f1.148ac11fa0f.Coremail.lelema.zh@gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1612 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 3067 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next reply other threads:[~2014-09-25 9:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-25 9:08 Lele MA [this message]
2014-09-25 10:56 ` Error when Glib cross compiled into Mini-OS without the support of "_POSIX_THREADS" Ian Campbell
2014-09-25 12:50 ` Lele MA
2014-09-25 12:55 ` Ian Campbell
2014-09-25 15:41 ` Antti Kantee
2014-09-25 16:56 ` Marcin Cieslak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba3f2d9.b0f1.148ac11fa0f.Coremail.lelema.zh@gmail.com \
--to=lelema.zh@gmail.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).