From 45996dec1b0b7712238f4c5b2f5a048b6072c08c Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 30 Oct 2008 00:42:43 +0100 Subject: [PATCH] Added LD_RUN_PATH when linking shared libraries This LD_RUN_PATH "hack" is the only way how I was able to link a program, which depends in a shared library, which depends on another shared library. The $ORIGIN didn't work here. The problem with this solution is that the absolute path is compiled in the library. --- snippets/linux | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/linux b/snippets/linux index c3b552b..a5153a0 100644 --- a/snippets/linux +++ b/snippets/linux @@ -387,7 +387,7 @@ $(1)_shared_libs = $$(patsubst %,$(USER_LIB_DIR)/lib%.$(SOLIB_EXT),$$(filter $$( #$$(warning $(1)_shared_libs = $$($(1)_shared_libs)) $(USER_LIB_DIR)/lib$(1).$(SOLIB_EXT): $$($(1)_shared_libs) $$($(1)_objslo) @$(QUIET_CMD_ECHO) " LINK $$@" - $(Q) $(CC) --shared -Xlinker -soname=lib$(1).$(SOLIB_EXT) -o $$@ $$($(1)_objslo) $$(LOADLIBES) $$($(1)_libs:%=-l%) + $(Q)LD_RUN_PATH=$(USER_LIB_DIR) $(CC) --shared -Xlinker -soname=lib$(1).$(SOLIB_EXT) -o $$@ $$($(1)_objslo) $$(LOADLIBES) $$($(1)_libs:%=-l%) endef -include $(shell find $(USER_BUILD_DIR) -name 'lib*.omkvar') -- 2.39.2