diff --git a/build/moz.build b/build/moz.build index d21832eaf2f8..671e77e97b35 100644 --- a/build/moz.build +++ b/build/moz.build @@ -18,8 +18,6 @@ if CONFIG["OS_ARCH"] == "WINNT": else: DIRS += ["unix"] -DIRS += ["pure_virtual"] - if CONFIG["MOZ_STDCXX_COMPAT"]: DIRS += ["unix/stdc++compat"] diff --git a/build/pure_virtual/moz.build b/build/pure_virtual/moz.build deleted file mode 100644 index 4bab7673cafe..000000000000 --- a/build/pure_virtual/moz.build +++ /dev/null @@ -1,11 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -Library("pure_virtual") - -SOURCES += ["pure_virtual.c"] - -FORCE_STATIC_LIB = True diff --git a/build/pure_virtual/pure_virtual.c b/build/pure_virtual/pure_virtual.c deleted file mode 100644 index d85c65f4219c..000000000000 --- a/build/pure_virtual/pure_virtual.c +++ /dev/null @@ -1,25 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include - -// This function is used in vtables to point at pure virtual methods. -// The implementation in the standard library usually aborts, but -// the function is normally never called (a call would be a bug). -// Each of these entries in vtables, however, require an unnecessary -// dynamic relocation. Defining our own function makes the linker -// point the vtables here instead of the standard library, replacing -// the dynamic relocations with relative relocations. -// -// On Windows, it doesn't really make a difference, but on macOS it -// can be packed better, saving about 10KB in libxul, and on 64-bits -// ELF systems, with packed relative relocations, it saves 140KB. -// -// Another advantage of having our own is that the abort() will fall -// back to our own abort() rather than the system's. -#ifdef _MSC_VER -int __cdecl _purecall() { abort(); } -#else -__attribute__((visibility("hidden"))) void __cxa_pure_virtual() { abort(); } -#endif diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py index c883608900a8..360205f8ec97 100644 --- a/python/mozbuild/mozbuild/frontend/emitter.py +++ b/python/mozbuild/mozbuild/frontend/emitter.py @@ -388,7 +388,6 @@ class TreeMetadataEmitter(LoggingMixin): context, obj, variable, self.STDCXXCOMPAT_NAME[obj.KIND] ) if obj.KIND == "target": - self._link_library(context, obj, variable, "pure_virtual") for lib in context.config.substs.get("STLPORT_LIBS", []): obj.link_system_library(lib)