From 8f12e555af83576a77e9946a6597a3c64b49e480 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Sun, 3 Feb 2013 02:43:31 +0100 Subject: [PATCH] lx_hybrid: reserve thread context area for core core does not use POSIX threads when built for the 'lx_hybrid_x86' platform, so we need to reserve the thread-context area via a segment in the program to prevent clashes with vdso and shared libraries. Fixes #639. --- base-linux/mk/spec-linux.mk | 2 +- base-linux/src/core/target.mk | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/base-linux/mk/spec-linux.mk b/base-linux/mk/spec-linux.mk index fe6e06151..39d0da246 100644 --- a/base-linux/mk/spec-linux.mk +++ b/base-linux/mk/spec-linux.mk @@ -13,7 +13,7 @@ LD_TEXT_ADDR ?= 0x01000000 LD_SCRIPT_STATIC = $(call select_from_repositories,src/platform/genode.ld) \ $(call select_from_repositories,src/platform/context_area.nostdlib.ld) else -LD_SCRIPT_STATIC = +LD_SCRIPT_STATIC ?= endif ifneq ($(filter hardening_tool_chain, $(SPECS)),) diff --git a/base-linux/src/core/target.mk b/base-linux/src/core/target.mk index 234cd7af5..a947333d6 100644 --- a/base-linux/src/core/target.mk +++ b/base-linux/src/core/target.mk @@ -31,6 +31,16 @@ INC_DIR += $(REP_DIR)/src/core/include \ HOST_INC_DIR += /usr/include +# +# core does not use POSIX threads when built for the 'lx_hybrid_x86' platform, +# so we need to reserve the thread-context area via a segment in the program to +# prevent clashes with vdso and shared libraries. +# +ifeq ($(findstring always_hybrid, $(SPECS)), always_hybrid) +LD_SCRIPT_STATIC = $(LD_SCRIPT_DEFAULT) \ + $(call select_from_repositories,src/platform/context_area.stdlib.ld) +endif + vpath main.cc $(GEN_CORE_DIR) vpath thread.cc $(BASE_DIR)/src/base/thread vpath ram_session_component.cc $(GEN_CORE_DIR)