BUILD: Add the original LDFLAGS and sanitizer LDFLAGS to PLUGIN_LDFLAGS
Adding the sanitizer flags to the PLUGIN_LDFLAGS fixes link errors for the plugins when asan, tsan, or ubsan is enabled. Adding the original LDFLAGS to PLUGIN_LDFLAGS means we no longer needs to use both in the link command for plugins.
This commit is contained in:
parent
0f5dd7cd99
commit
4d2bd56cd2
2 changed files with 8 additions and 3 deletions
5
configure
vendored
5
configure
vendored
|
@ -46,6 +46,7 @@ SAVED_WINDRESFLAGS=$WINDRESFLAGS
|
||||||
|
|
||||||
# Use environment vars if set
|
# Use environment vars if set
|
||||||
CXXFLAGS="$CXXFLAGS $CPPFLAGS"
|
CXXFLAGS="$CXXFLAGS $CPPFLAGS"
|
||||||
|
PLUGIN_LDFLAGS=$LDFLAGS
|
||||||
|
|
||||||
# Backslashes into forward slashes:
|
# Backslashes into forward slashes:
|
||||||
# The following OS/2 specific code is performed to deal with handling of backslashes by ksh.
|
# The following OS/2 specific code is performed to deal with handling of backslashes by ksh.
|
||||||
|
@ -5988,6 +5989,7 @@ if test "$_enable_asan" = yes ; then
|
||||||
else
|
else
|
||||||
append_var CXXFLAGS "-fsanitize=address -fno-omit-frame-pointer"
|
append_var CXXFLAGS "-fsanitize=address -fno-omit-frame-pointer"
|
||||||
append_var LDFLAGS "-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
|
||||||
fi
|
fi
|
||||||
echo "$_enable_asan"
|
echo "$_enable_asan"
|
||||||
|
@ -5997,6 +5999,7 @@ echo_n "Enabling Thread Sanitizer... "
|
||||||
if test "$_enable_tsan" = yes ; then
|
if test "$_enable_tsan" = yes ; then
|
||||||
append_var CXXFLAGS "-fsanitize=thread"
|
append_var CXXFLAGS "-fsanitize=thread"
|
||||||
append_var LDFLAGS "-fsanitize=thread"
|
append_var LDFLAGS "-fsanitize=thread"
|
||||||
|
append_var PLUGIN_LDFLAGS "-fsanitize=thread"
|
||||||
fi
|
fi
|
||||||
echo "$_enable_tsan"
|
echo "$_enable_tsan"
|
||||||
|
|
||||||
|
@ -6005,6 +6008,7 @@ echo_n "Enabling Undefined Behavior Sanitizer... "
|
||||||
if test "$_enable_ubsan" = yes ; then
|
if test "$_enable_ubsan" = yes ; then
|
||||||
append_var CXXFLAGS "-fsanitize=undefined"
|
append_var CXXFLAGS "-fsanitize=undefined"
|
||||||
append_var LDFLAGS "-fsanitize=undefined"
|
append_var LDFLAGS "-fsanitize=undefined"
|
||||||
|
append_var PLUGIN_LDFLAGS "-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
echo "$_enable_ubsan"
|
echo "$_enable_ubsan"
|
||||||
|
|
||||||
|
@ -6314,6 +6318,7 @@ OBJS += $OBJS
|
||||||
DEFINES += $DEFINES
|
DEFINES += $DEFINES
|
||||||
LDFLAGS += $LDFLAGS
|
LDFLAGS += $LDFLAGS
|
||||||
|
|
||||||
|
PLUGIN_LDFLAGS += $PLUGIN_LDFLAGS
|
||||||
$_mak_plugins
|
$_mak_plugins
|
||||||
|
|
||||||
port_mk = $_port_mk
|
port_mk = $_port_mk
|
||||||
|
|
2
rules.mk
2
rules.mk
|
@ -48,7 +48,7 @@ ifdef PLUGIN
|
||||||
PLUGIN-$(MODULE) := plugins/$(PLUGIN_PREFIX)$(notdir $(MODULE))$(PLUGIN_SUFFIX)
|
PLUGIN-$(MODULE) := plugins/$(PLUGIN_PREFIX)$(notdir $(MODULE))$(PLUGIN_SUFFIX)
|
||||||
$(PLUGIN-$(MODULE)): $(MODULE_OBJS-$(MODULE)) $(PLUGIN_EXTRA_DEPS)
|
$(PLUGIN-$(MODULE)): $(MODULE_OBJS-$(MODULE)) $(PLUGIN_EXTRA_DEPS)
|
||||||
$(QUIET)$(MKDIR) plugins
|
$(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
|
# Reset PLUGIN var
|
||||||
PLUGIN:=
|
PLUGIN:=
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue