diff --git a/configure b/configure index ac2706b819a..26b2a71ab26 100755 --- a/configure +++ b/configure @@ -46,6 +46,7 @@ SAVED_WINDRESFLAGS=$WINDRESFLAGS # Use environment vars if set CXXFLAGS="$CXXFLAGS $CPPFLAGS" +PLUGIN_LDFLAGS=$LDFLAGS # Backslashes into forward slashes: # The following OS/2 specific code is performed to deal with handling of backslashes by ksh. @@ -977,7 +978,7 @@ Optional Libraries: --with-ieee1284-prefix=DIR prefix where libieee1284 is installed (optional) --enable-opl2lpt enable OPL2LPT support - + --with-retrowave-prefix=DIR prefix where libretrowave is installed (optional) --enable-retrowave enable RetroWave OPL3 support @@ -4201,7 +4202,7 @@ POST_OBJS_FLAGS := -Wl,-no-whole-archive append_var DEFINES "-DUNCACHED_PLUGINS" _mak_plugins=' LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/main_prog.ld -Wl,-zmax-page-size=128 -PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/plugin.ld -Wl,-zmax-page-size=128 -lstdc++ +PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/plugin.ld -Wl,-zmax-page-size=128 -lstdc++ ' ;; *) @@ -5988,6 +5989,7 @@ if test "$_enable_asan" = yes ; then else append_var CXXFLAGS "-fsanitize=address -fno-omit-frame-pointer" append_var LDFLAGS "-fsanitize=address -fno-omit-frame-pointer" + append_var PLUGIN_LDFLAGS "-fsanitize=address -fno-omit-frame-pointer" fi fi echo "$_enable_asan" @@ -5997,6 +5999,7 @@ echo_n "Enabling Thread Sanitizer... " if test "$_enable_tsan" = yes ; then append_var CXXFLAGS "-fsanitize=thread" append_var LDFLAGS "-fsanitize=thread" + append_var PLUGIN_LDFLAGS "-fsanitize=thread" fi echo "$_enable_tsan" @@ -6005,6 +6008,7 @@ echo_n "Enabling Undefined Behavior Sanitizer... " if test "$_enable_ubsan" = yes ; then append_var CXXFLAGS "-fsanitize=undefined" append_var LDFLAGS "-fsanitize=undefined" + append_var PLUGIN_LDFLAGS "-fsanitize=undefined" fi echo "$_enable_ubsan" @@ -6314,6 +6318,7 @@ OBJS += $OBJS DEFINES += $DEFINES LDFLAGS += $LDFLAGS +PLUGIN_LDFLAGS += $PLUGIN_LDFLAGS $_mak_plugins port_mk = $_port_mk diff --git a/rules.mk b/rules.mk index 88819554fe4..7081489f8c9 100644 --- a/rules.mk +++ b/rules.mk @@ -48,7 +48,7 @@ ifdef PLUGIN PLUGIN-$(MODULE) := plugins/$(PLUGIN_PREFIX)$(notdir $(MODULE))$(PLUGIN_SUFFIX) $(PLUGIN-$(MODULE)): $(MODULE_OBJS-$(MODULE)) $(PLUGIN_EXTRA_DEPS) $(QUIET)$(MKDIR) plugins - +$(QUIET_PLUGIN)$(LD) $(SAVED_LDFLAGS) $(filter-out $(PLUGIN_EXTRA_DEPS),$+) $(PLUGIN_LDFLAGS) -o $@ + +$(QUIET_PLUGIN)$(LD) $(filter-out $(PLUGIN_EXTRA_DEPS),$+) $(PLUGIN_LDFLAGS) -o $@ # Reset PLUGIN var PLUGIN:=