Use POSIX threads in Linux/Genode hybrids

- Let hybrid Linux/Genode programs use POSIX threads for the
  implementation of the Thread API.
- Prevent linkage of cxx library to hybrid Linux/Genode programs because
  the cxx functionality is covered by glibc.
This commit is contained in:
Norman Feske
2011-12-22 17:17:44 +01:00
committed by Christian Helmuth
parent f904c2be09
commit defd6a9b58
5 changed files with 229 additions and 2 deletions

View File

@@ -277,6 +277,10 @@ namespace Genode {
* \param name thread name for debugging
* \param stack_size stack size
*
* \throw Stack_too_large
* \throw Stack_alloc_failed
* \throw Context_alloc_failed
*
* The stack for the new thread will be allocated from the RAM
* session of the process environment. A small portion of the
* stack size is internally used by the framework for storing

View File

@@ -132,6 +132,18 @@ LD_CMD += $(addprefix $(LD_SCRIPT_PREFIX), $(LD_SCRIPTS))
STATIC_LIBS := $(foreach l,$(FILTER_DEPS),$(LIB_CACHE_DIR)/$l/$l.lib.a)
STATIC_LIBS := $(sort $(wildcard $(STATIC_LIBS)))
#
# For hybrid Linux/Genode programs, prevent the linkage of the normal thread
# library. Because such programs use the glibc, we map Genode's thread API
# to 'pthreads' instead to improve inter-operability with native Linux
# libraries. Furthermore, we do not need Genode's cxx library for such
# programs because the cxx functionality is already provided by the glibc.
#
ifeq ($(USE_HOST_LD_SCRIPT),yes)
STATIC_LIBS := $(filter-out $(LIB_CACHE_DIR)/thread/thread.lib.a, $(STATIC_LIBS))
STATIC_LIBS := $(filter-out $(LIB_CACHE_DIR)/cxx/cxx.lib.a, $(STATIC_LIBS))
endif
#
# We need the linker option '--whole-archive' to make sure that all library
# constructors marked with '__attribute__((constructor))' end up int the