|
1 | 1 | # |
2 | | -# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. |
| 2 | +# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | # |
5 | 5 | # This code is free software; you can redistribute it and/or modify it |
@@ -125,9 +125,26 @@ else ifeq ($(call isTargetOs, aix), true) |
125 | 125 |
|
126 | 126 | else ifeq ($(call isTargetOs, windows), true) |
127 | 127 | DUMP_SYMBOLS_CMD := $(DUMPBIN) -symbols *.obj |
| 128 | + |
| 129 | + # The following lines create a list of vftable symbols to be filtered out of |
| 130 | + # the mapfile. Removing this line causes the linker to complain about too many |
| 131 | + # (> 64K) symbols, so the _guess_ is that this line is here to keep down the |
| 132 | + # number of exported symbols below that limit. |
| 133 | + # |
| 134 | + # Some usages of C++ lambdas require the vftable symbol of classes that use |
| 135 | + # the lambda type as a template parameter. The usage of those classes won't |
| 136 | + # link if their vftable symbols are removed. That's why there's an exception |
| 137 | + # for vftable symbols containing the string 'lambda'. |
| 138 | + # |
| 139 | + # A very simple example of a lambda usage that fails if the lambda vftable |
| 140 | + # symbols are missing in the mapfile: |
| 141 | + # |
| 142 | + # #include <functional> |
| 143 | + # std::function<void()> f = [](){} |
| 144 | + |
128 | 145 | FILTER_SYMBOLS_AWK_SCRIPT := \ |
129 | 146 | '{ \ |
130 | | - if ($$7 ~ /??_7.*@@6B@/ && $$7 !~ /type_info/) print $$7; \ |
| 147 | + if ($$7 ~ /\?\?_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print $$7; \ |
131 | 148 | }' |
132 | 149 |
|
133 | 150 | else |
|
0 commit comments