|
1 | 1 | # |
2 | | -# Copyright (c) 2013, 2020, 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 |
@@ -99,9 +99,26 @@ else ifeq ($(call isTargetOs, aix), true) |
99 | 99 |
|
100 | 100 | else ifeq ($(call isTargetOs, windows), true) |
101 | 101 | DUMP_SYMBOLS_CMD := $(DUMPBIN) -symbols *.obj |
| 102 | + |
| 103 | + # The following lines create a list of vftable symbols to be filtered out of |
| 104 | + # the mapfile. Removing this line causes the linker to complain about too many |
| 105 | + # (> 64K) symbols, so the _guess_ is that this line is here to keep down the |
| 106 | + # number of exported symbols below that limit. |
| 107 | + # |
| 108 | + # Some usages of C++ lambdas require the vftable symbol of classes that use |
| 109 | + # the lambda type as a template parameter. The usage of those classes won't |
| 110 | + # link if their vftable symbols are removed. That's why there's an exception |
| 111 | + # for vftable symbols containing the string 'lambda'. |
| 112 | + # |
| 113 | + # A very simple example of a lambda usage that fails if the lambda vftable |
| 114 | + # symbols are missing in the mapfile: |
| 115 | + # |
| 116 | + # #include <functional> |
| 117 | + # std::function<void()> f = [](){} |
| 118 | + |
102 | 119 | FILTER_SYMBOLS_AWK_SCRIPT := \ |
103 | 120 | '{ \ |
104 | | - if ($$7 ~ /??_7.*@@6B@/ && $$7 !~ /type_info/) print $$7; \ |
| 121 | + if ($$7 ~ /\?\?_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print $$7; \ |
105 | 122 | }' |
106 | 123 |
|
107 | 124 | else |
|
0 commit comments