Skip to content
Permalink
Browse files
8275405: Linking error for classes with lambda template parameters an…
…d virtual functions

Reviewed-by: ihse, pliden
  • Loading branch information
stefank committed Oct 21, 2021
1 parent a120937 commit 09f5235c65de546640d5f923fa9369e28643c6ed
Showing 1 changed file with 18 additions and 1 deletion.
@@ -99,9 +99,26 @@ else ifeq ($(call isTargetOs, aix), true)

else ifeq ($(call isTargetOs, windows), true)
DUMP_SYMBOLS_CMD := $(DUMPBIN) -symbols *.obj

# The following lines create a list of vftable symbols to be filtered out of
# the mapfile. Removing this line causes the linker to complain about too many
# (> 64K) symbols, so the _guess_ is that this line is here to keep down the
# number of exported symbols below that limit.
#
# Some usages of C++ lambdas require the vftable symbol of classes that use
# the lambda type as a template parameter. The usage of those classes won't
# link if their vftable symbols are removed. That's why there's an exception
# for vftable symbols containing the string 'lambda'.
#
# A very simple example of a lambda usage that fails if the lambda vftable
# symbols are missing in the mapfile:
#
# #include <functional>
# std::function<void()> f = [](){}

FILTER_SYMBOLS_AWK_SCRIPT := \
'{ \
if ($$7 ~ /??_7.*@@6B@/ && $$7 !~ /type_info/) print $$7; \
if ($$7 ~ /??_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print $$7; \
}'

else

1 comment on commit 09f5235

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 09f5235 Oct 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.