From a7365ab9297e0128e4809c476b6adcd37ff2718d Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 27 Sep 2021 14:08:38 -0400 Subject: [PATCH] Add plugin linking notes to plugin.mk. --- plugin.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin.mk b/plugin.mk index 5b04b77a..cf6b3461 100644 --- a/plugin.mk +++ b/plugin.mk @@ -18,6 +18,7 @@ FLAGS += -fPIC FLAGS += -I$(RACK_DIR)/include -I$(RACK_DIR)/dep/include LDFLAGS += -shared +# Plugins must link to libRack because when Rack is used as a plugin of another application, its symbols are not available to subsequently loaded shared libraries. LDFLAGS += -L$(RACK_DIR) -lRack include $(RACK_DIR)/arch.mk @@ -28,7 +29,7 @@ ifdef ARCH_LIN # I don't really understand the side effects (see GCC manual), but so far tests are positive. FLAGS += -fno-gnu-unique LDFLAGS += -Wl,-rpath=. - # Since the compiler we're using could have a newer version than the minimum supported libstdc++ version, link it statically. + # Since the plugin's compiler could be a different version than Rack's compiler, link libstdc++ and libgcc statically to avoid ABI issues. LDFLAGS += -static-libstdc++ -static-libgcc RACK_USER_DIR ?= $(HOME)/.Rack2 endif