From 1947d08e78430d50b57025bbffb58d63bfd5520f Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Sun, 3 Feb 2013 02:47:01 +0100 Subject: [PATCH] Use the host c++ for linking hybrid applications Some shared libraries of the host system contain search paths for finding other needed shared libraries. These paths get evaluated only by a native linker. To find all needed shared libraries, with this patch, the host linker is used to link hybrid applications. Fixes #645. --- base-linux/lib/import/import-lx_hybrid.mk | 3 +++ base/mk/prg.mk | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/base-linux/lib/import/import-lx_hybrid.mk b/base-linux/lib/import/import-lx_hybrid.mk index 1abc38c75a..2bc5d2f6fc 100644 --- a/base-linux/lib/import/import-lx_hybrid.mk +++ b/base-linux/lib/import/import-lx_hybrid.mk @@ -102,3 +102,6 @@ endif # because we use the host compiler's libgcc, omit the Genode toolchain's version LD_LIBGCC = + +# use the host c++ for linking to find shared libraries in DT_RPATH library paths +LD_CMD = c++ diff --git a/base/mk/prg.mk b/base/mk/prg.mk index 2eec9dd67e..2ffe23499d 100644 --- a/base/mk/prg.mk +++ b/base/mk/prg.mk @@ -106,7 +106,9 @@ SHARED_LIBS := $(sort $(wildcard $(SHARED_LIBS))) # # Use CXX for linking # -LD_CMD := $(CXX) $(CXX_LINK_OPT) +LD_CMD ?= $(CXX) + +LD_CMD += $(CXX_LINK_OPT) ifeq ($(SHARED_LIBS),) LD_SCRIPTS := $(LD_SCRIPT_STATIC)