diff --git a/build/unix/stdc++compat/stdc++compat.cpp b/build/unix/stdc++compat/stdc++compat.cpp index 5ce33346c17d..d8637042ae74 100644 --- a/build/unix/stdc++compat/stdc++compat.cpp +++ b/build/unix/stdc++compat/stdc++compat.cpp @@ -8,7 +8,6 @@ #include #include #include -#include /* GLIBCXX_3.4.16 is from gcc 4.6.1 (172240) GLIBCXX_3.4.17 is from gcc 4.7.0 (174383) @@ -145,12 +144,6 @@ namespace std { * depending on optimization level */ template basic_ios>::operator bool() const; } // namespace std - -/* operator delete with size is only available in CXXAPI_1.3.9, equivalent to - * GLIBCXX_3.4.21. */ -void operator delete(void* ptr, size_t size) noexcept(true) { - ::operator delete(ptr); -} #endif #if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 23) @@ -161,18 +154,3 @@ template basic_string, allocator>::basic_string( const basic_string&, size_t, const allocator&); } // namespace std #endif - -/* The __cxa_thread_atexit_impl symbol is only available on GLIBC 2.18, but we - * want things to keep working on 2.17. It's not actually used directly from - * C++ code, but through __cxa_thead_atexit in libstdc++. The problem we have, - * though, is that rust's libstd also uses it, introducing a dependency we - * don't actually want. Fortunately, we can fall back to libstdc++'s wrapper - * (which, on systems without __cxa_thread_atexit_impl, has its own compatible - * implementation). - * The __cxa_thread_atexit symbol itself is marked CXXABI_1.3.7, which is - * equivalent to GLIBCXX_3.4.18. - */ -extern "C" int __cxa_thread_atexit_impl(void (*dtor)(void*), void* obj, - void* dso_handle) { - return __cxxabiv1::__cxa_thread_atexit(dtor, obj, dso_handle); -} diff --git a/python/mozbuild/mozbuild/action/check_binary.py b/python/mozbuild/mozbuild/action/check_binary.py index 57ccfa6b29df..1b69b8bcd3d2 100644 --- a/python/mozbuild/mozbuild/action/check_binary.py +++ b/python/mozbuild/mozbuild/action/check_binary.py @@ -23,7 +23,6 @@ from mozpack.executables import ( STDCXX_MAX_VERSION = Version('3.4.19') -CXXABI_MAX_VERSION = Version('1.3.7') GLIBC_MAX_VERSION = Version('2.17') LIBGCC_MAX_VERSION = Version('4.8') @@ -97,8 +96,11 @@ def iter_symbols(binary): continue addr = int(m.group(0), 16) # The second "column" is 7 one-character items that can be - # whitespaces. We don't have use for their value, so just skip - # those. + # whitespaces. + flags = line[m.end():][:7] + # We're only interested whether the symbol might be weak. + weak = 'w' in flags + rest = line[m.end() + 9:].split() # The number of remaining colums will vary between ELF and MACHO. # On ELF, we have: @@ -117,6 +119,7 @@ def iter_symbols(binary): 'size': int(rest[1], 16) if ty == ELF else 0, 'name': name, 'version': ver or None, + 'weak': weak, } else: export_table = False @@ -144,6 +147,7 @@ def iter_symbols(binary): 'size': 0, 'name': name, 'version': None, + 'weak': None, } @@ -165,6 +169,11 @@ def check_dep_versions(target, binary, lib, prefix, max_version): if sym['addr'] != 0: continue + # Versions for weak symbols don't matter, since the code must + # handle the case where they're not defined. + if sym['weak']: + continue + # No version to check if not sym['version']: continue @@ -186,8 +195,6 @@ def check_dep_versions(target, binary, lib, prefix, max_version): def check_stdcxx(target, binary): check_dep_versions( target, binary, 'libstdc++', 'GLIBCXX', STDCXX_MAX_VERSION) - check_dep_versions( - target, binary, 'libstdc++', 'CXXABI', CXXABI_MAX_VERSION) def check_libgcc(target, binary):