diff --git a/Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig b/Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig index 71fb4d9c2694..d0b0a7e9dab5 100644 --- a/Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig +++ b/Source/JavaScriptCore/Configurations/JavaScriptCore.xcconfig @@ -26,9 +26,6 @@ DEFINES_MODULE = YES; MODULEMAP_FILE = $(SRCROOT)/JavaScriptCore.modulemap; -// Prevent C++ standard library operator new, delete and their related exception types from being exported as weak symbols. -OTHER_LDFLAGS_HIDE_SYMBOLS = -Wl,-unexported_symbol,__ZdlPvS_ -Wl,-unexported_symbol,__ZNKSt3__14__fs10filesystem18directory_iteratordeEv -Wl,-unexported_symbol,__ZNKSt3__14__fs10filesystem18directory_iteratorptEv -Wl,-unexported_symbol,__ZNKSt3__18functionIFvRN3JSC17BytecodeGeneratorEPNS1_10RegisterIDEEEclES3_S5_ -Wl,-unexported_symbol,__ZNKSt3__18functionIFvvEEclEv -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem14__is_separatorIcEENS_9enable_ifIXsr18__can_convert_charIT_EE5valueEbE4typeES4_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem18directory_iterator9incrementERNS_10error_codeE -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem18directory_iteratorppEv -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem20__is_pathable_stringINS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEvE11__range_endB6v15000ERKS8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem20__is_pathable_stringINS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEvE11__range_endB6v15004ERKS8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem20__is_pathable_stringINS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEvE11__range_endB6v15006ERKS8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem20__is_pathable_stringINS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEvE11__range_endERKS8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem20__is_pathable_stringINS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEvE13__range_beginB6v15004ERKS8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem20__is_pathable_stringINS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEvE13__range_beginB6v15006ERKS8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem20__is_pathable_stringINS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEvE13__range_beginERKS8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIA10_cPccLb1EE11__range_endB6v15000EPKc -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIA10_cPccLb1EE11__range_endB6v15004EPKc -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIA10_cPccLb1EE11__range_endB6v15006EPKc -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIA10_cPccLb1EE11__range_endEPKc -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIA10_cPccLb1EE13__range_beginB6v15000EPKc -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIA10_cPccLb1EE13__range_beginB6v15004EPKc -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIA10_cPccLb1EE13__range_beginB6v15006EPKc -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIA10_cPccLb1EE13__range_beginEPKc -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIPKcS4_cLb1EE11__range_endES4_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIPKcS4_cLb1EE13__range_beginES4_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIPKcS4_cLb1EE15__first_or_nullES4_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__throw_filesystem_errorIJRPKcRKNS1_4pathERKNS_10error_codeEEEEvDpOT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__throw_filesystem_errorB6v15004IJRPKcRKNS1_4pathERKNS_10error_codeEEEEvDpOT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__throw_filesystem_errorB6v15006IJRPKcRKNS1_4pathERKNS_10error_codeEEEEvDpOT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem28recursive_directory_iteratorppEv -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem4path20__source_is_absoluteIcEEbT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem4path6appendIPKcEENS_9enable_ifIXsr13__is_pathableIT_EE5valueERS2_E4typeERKS7_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem4pathdVERKS2_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem6u8pathIPKcEENS_9enable_ifIXsr13__is_pathableIT_EE5valueENS1_4pathEE4typeERKS6_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE14__append_rangeB6v15000IPKcEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES8_S8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE14__append_rangeB6v15004IPKcEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES8_S8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE14__append_rangeB6v15006IPKcEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES8_S8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE14__append_rangeIPKcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES8_S8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE14__append_rangeIPKcEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES8_S8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE15__append_sourceB6v15000IA10_cEEvRNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE15__append_sourceB6v15004IA10_cEEvRNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE15__append_sourceB6v15006IA10_cEEvRNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE15__append_sourceIA10_cEEvRNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE15__append_sourceIPKcEEvRNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIDuE14__append_rangeB6v15000ERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPKDuSC_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIDuE14__append_rangeB6v15004ERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPKDuSC_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIDuE14__append_rangeB6v15006ERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPKDuSC_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIDuE14__append_rangeERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPKDuSC_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIDuE15__append_sourceB6v15000INS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEEEvRNS5_IcNS6_IcEENS8_IcEEEERKT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIDuE15__append_sourceB6v15004INS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEEEvRNS5_IcNS6_IcEENS8_IcEEEERKT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIDuE15__append_sourceB6v15006INS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEEEvRNS5_IcNS6_IcEENS8_IcEEEERKT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIDuE15__append_sourceINS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEEEvRNS5_IcNS6_IcEENS8_IcEEEERKT_ -Wl,-unexported_symbol,__ZNSt3__18functionIFvRN3JSC17BytecodeGeneratorEPNS1_10RegisterIDEEED1Ev -Wl,-unexported_symbol,__ZNSt3__18functionIFvRN3JSC17BytecodeGeneratorEPNS1_10RegisterIDEEED2Ev -Wl,-unexported_symbol,__ZNSt3__18functionIFvvEEC1EOS2_ -Wl,-unexported_symbol,__ZNSt3__18functionIFvvEEC2EOS2_ -Wl,-unexported_symbol,__ZNSt3__18functionIFvvEED1Ev -Wl,-unexported_symbol,__ZNSt3__18functionIFvvEED2Ev -Wl,-unexported_symbol,__ZnwmPv -Wl,-unexported_symbol,__ZTISt9bad_alloc -Wl,-unexported_symbol,__ZTISt9exception -Wl,-unexported_symbol,__ZTSSt9bad_alloc -Wl,-unexported_symbol,__ZTSSt9exception -Wl,-unexported_symbol,__ZTVNSt3__117bad_function_callE -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem20__is_pathable_stringINS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEvE11__range_endB6v15007ERKS8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem20__is_pathable_stringINS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEvE13__range_beginB6v15007ERKS8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIA10_cPccLb1EE11__range_endB6v15007EPKc -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIA10_cPccLb1EE13__range_beginB6v15007EPKc -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__throw_filesystem_errorB6v15007IJRPKcRKNS1_4pathERKNS_10error_codeEEEEvDpOT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIDuE14__append_rangeB6v15007ERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPKDuSC_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIDuE15__append_sourceB6v15007INS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEEEvRNS5_IcNS6_IcEENS8_IcEEEERKT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE14__append_rangeB6v15007IPKcEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES8_S8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE15__append_sourceB6v15007IA10_cEEvRNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem20__is_pathable_stringINS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEvE11__range_endB7v160000ERKS8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem20__is_pathable_stringINS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEvE13__range_beginB7v160000ERKS8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__throw_filesystem_errorB7v160000IJRPKcRKNS1_4pathERKNS_10error_codeEEEEvDpOT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIDuE14__append_rangeB7v160000ERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPKDuSC_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIDuE15__append_sourceB7v160000INS_12basic_stringIDuNS_11char_traitsIDuEENS_9allocatorIDuEEEEEEvRNS5_IcNS6_IcEENS8_IcEEEERKT_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIA10_cPccLb1EE11__range_endB7v160000EPKc -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem24__is_pathable_char_arrayIA10_cPccLb1EE13__range_beginB7v160000EPKc -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE14__append_rangeB7v160000IPKcEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES8_S8_ -Wl,-unexported_symbol,__ZNSt3__14__fs10filesystem8_PathCVTIcE15__append_sourceB7v160000IA10_cEEvRNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKT_; - WK_ERROR_WHEN_LINKING_WITH_STATIC_INITIALIZERS = -Xlinker -no_inits; WK_NO_STATIC_INITIALIZERS = $(WK_NO_STATIC_INITIALIZERS_$(CONFIGURATION)_$(WK_ANY_SANITIZER_ENABLED)_$(ENABLE_LLVM_PROFILE_GENERATION)); WK_NO_STATIC_INITIALIZERS_Release__ = $(WK_ERROR_WHEN_LINKING_WITH_STATIC_INITIALIZERS); @@ -36,7 +33,7 @@ WK_NO_STATIC_INITIALIZERS_Release_NO_ = $(WK_ERROR_WHEN_LINKING_WITH_STATIC_INIT WK_NO_STATIC_INITIALIZERS_Production__ = $(WK_ERROR_WHEN_LINKING_WITH_STATIC_INITIALIZERS); WK_NO_STATIC_INITIALIZERS_Production_NO_ = $(WK_ERROR_WHEN_LINKING_WITH_STATIC_INITIALIZERS); -OTHER_LDFLAGS_BASE = $(OTHER_LDFLAGS_HIDE_SYMBOLS) -force_load $(WTF_ARCHIVE) -force_load $(BMALLOC_ARCHIVE) -load_hidden $(LIBPAS_ARCHIVE) $(SOURCE_VERSION_LDFLAGS) $(WK_NO_STATIC_INITIALIZERS); +OTHER_LDFLAGS_BASE = -unexported_symbols_list $(SRCROOT)/unexported-libc++.txt -force_load $(WTF_ARCHIVE) -force_load $(BMALLOC_ARCHIVE) -load_hidden $(LIBPAS_ARCHIVE) $(SOURCE_VERSION_LDFLAGS) $(WK_NO_STATIC_INITIALIZERS); OTHER_LDFLAGS[sdk=embedded*] = $(inherited) $(OTHER_LDFLAGS_BASE); OTHER_LDFLAGS[sdk=macosx*] = $(inherited) $(OTHER_LDFLAGS_BASE) -framework CoreServices $(PROFILE_GENERATE_OR_USE_LDFLAGS); diff --git a/Source/JavaScriptCore/unexported-libc++.txt b/Source/JavaScriptCore/unexported-libc++.txt new file mode 100644 index 000000000000..1446c2e386ec --- /dev/null +++ b/Source/JavaScriptCore/unexported-libc++.txt @@ -0,0 +1,30 @@ +# This unexport list uses the Itanium mangling rules [1] to hide any symbols +# emitted from libc++ headers. +# [1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.type + +# std:: namespace, with any valid combination of restrict (r), volatile (V), or const (K) +__ZSt* +__Z[KVr]St* +__ZK[Vr]St* +__ZKVrSt* + +# nested std:: namespace, with the above qualifiers +__ZNSt* +__ZN[KVr]St* +__ZNK[Vr]St* +__ZNKVrSt* + +# vtable for std::, with the above qualifiers +__ZTVSt* +__ZTV[KVr]St* +__ZTVK[Vr]St* +__ZTVKVrSt* + +# typeinfo for std:: +__ZT[IS]St* + +# global operator new and new[] +__Zn[wa]* + +# global operator delete and delete[] +__Zd[la]*