Skip to content

Commit

Permalink
Bug 1370695 - Remove build system code handling binary components. r=…
Browse files Browse the repository at this point in the history
…glandium

MozReview-Commit-ID: BKHWR34vWsu

--HG--
extra : rebase_source : d870a222d393479bb8ede2aaec571299488806c0
  • Loading branch information
chmanchester committed Jun 13, 2017
1 parent 6608736 commit 4797958
Show file tree
Hide file tree
Showing 19 changed files with 2 additions and 270 deletions.
3 changes: 0 additions & 3 deletions build/docs/defining-binaries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,6 @@ essentially the same as the above mentioned templates, prefixed with "Gecko":
- ``GeckoSharedLibrary``
- ``GeckoFramework``

There is also ``XPCOMBinaryComponent`` for XPCOM components, which is a
special kind of library.

All the Gecko-prefixed templates take the same arguments as their
non-Gecko-prefixed counterparts, and can take a few more arguments
for non-standard cases. See the definition of ``GeckoBinary`` in
Expand Down
11 changes: 0 additions & 11 deletions build/gecko_templates.mozbuild
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,3 @@ def GeckoFramework(name, **kwargs):
kwargs.setdefault('mozglue', 'library')

GeckoBinary(**kwargs)


@template
def XPCOMBinaryComponent(name):
'''Template defining an XPCOM binary component for Gecko.
`name` is the name of the component.
'''
GeckoSharedLibrary(name)

IS_COMPONENT = True
1 change: 0 additions & 1 deletion build/unix/gnu-ld-scripts/components-export-list

This file was deleted.

7 changes: 0 additions & 7 deletions build/unix/gnu-ld-scripts/components-version-script

This file was deleted.

10 changes: 1 addition & 9 deletions config/makefiles/target_binaries.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,10 @@ PROGRAMS_TARGET := target
INSTALL_TARGETS += PROGRAMS
endif

ifdef LIBRARY
ifdef DIST_INSTALL
ifdef IS_COMPONENT
$(error Shipping static component libs makes no sense.)
endif
endif # DIST_INSTALL
endif # LIBRARY


ifdef SHARED_LIBRARY
SHARED_LIBRARY_FILES = $(SHARED_LIBRARY)
SHARED_LIBRARY_DEST ?= $(FINAL_TARGET)$(if $(IS_COMPONENT),/components)
SHARED_LIBRARY_DEST ?= $(FINAL_TARGET)
SHARED_LIBRARY_TARGET = target
INSTALL_TARGETS += SHARED_LIBRARY
endif # SHARED_LIBRARY
Expand Down
64 changes: 0 additions & 64 deletions config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -328,23 +328,12 @@ ifneq ($(HOST_CPPSRCS)$(HOST_CMMSRCS),)
HOST_CPP_PROG_LINK = 1
endif

#
# This will strip out symbols that the component should not be
# exporting from the .dynsym section.
#
ifdef IS_COMPONENT
EXTRA_DSO_LDOPTS += $(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
endif # IS_COMPONENT

#
# MacOS X specific stuff
#

ifeq ($(OS_ARCH),Darwin)
ifdef SHARED_LIBRARY
ifdef IS_COMPONENT
EXTRA_DSO_LDOPTS += -bundle
else
ifdef MOZ_IOS
_LOADER_PATH := @rpath
else
Expand All @@ -353,25 +342,6 @@ endif
EXTRA_DSO_LDOPTS += -dynamiclib -install_name $(_LOADER_PATH)/$(SHARED_LIBRARY) -compatibility_version 1 -current_version 1 -single_module
endif
endif
endif

#
# On NetBSD a.out systems, use -Bsymbolic. This fixes what would otherwise be
# fatal symbol name clashes between components.
#
ifeq ($(OS_ARCH),NetBSD)
ifeq ($(DLL_SUFFIX),.so.1.0)
ifdef IS_COMPONENT
EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
endif
endif
endif

ifeq ($(OS_ARCH),FreeBSD)
ifdef IS_COMPONENT
EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
endif
endif

ifeq ($(OS_ARCH),NetBSD)
ifneq (,$(filter arc cobalt hpcmips mipsco newsmips pmax sgimips,$(OS_TEST)))
Expand All @@ -382,42 +352,10 @@ endif
endif
endif

#
# HP-UXBeOS specific section: for COMPONENTS only, add -Bsymbolic flag
# which uses internal symbols first
#
ifeq ($(OS_ARCH),HP-UX)
ifdef IS_COMPONENT
ifeq ($(GNU_CC)$(GNU_CXX),)
EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
ifneq ($(HAS_EXTRAEXPORTS),1)
MKSHLIB += -Wl,+eNSGetModule -Wl,+eerrno
MKCSHLIB += +eNSGetModule +eerrno
ifneq ($(OS_TEST),ia64)
MKSHLIB += -Wl,+e_shlInit
MKCSHLIB += +e_shlInit
endif # !ia64
endif # !HAS_EXTRAEXPORTS
endif # non-gnu compilers
endif # IS_COMPONENT
endif # HP-UX

ifeq ($(OS_ARCH),AIX)
ifdef IS_COMPONENT
ifneq ($(HAS_EXTRAEXPORTS),1)
MKSHLIB += -bE:$(MOZILLA_DIR)/build/unix/aix.exp -bnoexpall
MKCSHLIB += -bE:$(MOZILLA_DIR)/build/unix/aix.exp -bnoexpall
endif # HAS_EXTRAEXPORTS
endif # IS_COMPONENT
endif # AIX

#
# Linux: add -Bsymbolic flag for components
#
ifeq ($(OS_ARCH),Linux)
ifdef IS_COMPONENT
EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
endif
ifdef LD_VERSION_SCRIPT
EXTRA_DSO_LDOPTS += -Wl,--version-script,$(LD_VERSION_SCRIPT)
EXTRA_DEPS += $(LD_VERSION_SCRIPT)
Expand Down Expand Up @@ -455,11 +393,9 @@ endif
#
ifeq ($(OS_ARCH),WINNT)
ifdef GNU_CC
ifndef IS_COMPONENT
DSO_LDOPTS += -Wl,--out-implib -Wl,$(IMPORT_LIBRARY)
endif
endif
endif

ifeq ($(USE_TVFS),1)
IFLAGS1 = -rb
Expand Down
24 changes: 0 additions & 24 deletions old-configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1216,24 +1216,6 @@ dnl Only one oddball right now (QNX), but this gives us flexibility
dnl if any other platforms need to override this in the future.
AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)

dnl ========================================================
dnl = Flags to strip unused symbols from .so components and
dnl = to export jemalloc symbols when linking a program
dnl ========================================================
case "$target" in
*-linux*|*-kfreebsd*-gnu|*-gnu*)
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
;;
*-darwin*)
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
;;
*-mingw*)
if test -n "$GNU_CC"; then
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
fi
;;
esac

if test -z "$COMPILE_ENVIRONMENT"; then
SKIP_COMPILER_CHECKS=1
SKIP_LIBRARY_CHECKS=1
Expand Down Expand Up @@ -4896,11 +4878,6 @@ if test "$NECKO_COOKIES"; then
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_COOKIES"
fi

dnl ========================================================
if test "$MOZ_DEBUG" -o "$MOZ_DMD"; then
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
fi

dnl ========================================================
dnl =
dnl = Maintainer debug option (no --enable equivalent)
Expand Down Expand Up @@ -4956,7 +4933,6 @@ AC_SUBST(PKG_SKIP_STRIP)
AC_SUBST(STRIP_FLAGS)
AC_SUBST(USE_ELF_HACK)
AC_SUBST(INCREMENTAL_LINKER)
AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)

AC_SUBST(MOZ_FIX_LINK_PATHS)

Expand Down
5 changes: 0 additions & 5 deletions python/mozbuild/mozbuild/backend/recursivemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
b'HOST_LIBRARY_NAME',
b'HOST_PROGRAM',
b'HOST_SIMPLE_PROGRAMS',
b'IS_COMPONENT',
b'JAR_MANIFEST',
b'JAVA_JAR_TARGETS',
b'LD_VERSION_SCRIPT',
Expand Down Expand Up @@ -1232,8 +1231,6 @@ def _process_shared_library(self, libdef, backend_file):
backend_file.write('FORCE_SHARED_LIB := 1\n')
backend_file.write('IMPORT_LIBRARY := %s\n' % libdef.import_name)
backend_file.write('SHARED_LIBRARY := %s\n' % libdef.lib_name)
if libdef.variant == libdef.COMPONENT:
backend_file.write('IS_COMPONENT := 1\n')
if libdef.soname:
backend_file.write('DSO_SONAME := %s\n' % libdef.soname)
if libdef.symbols_file:
Expand Down Expand Up @@ -1303,7 +1300,6 @@ def pretty_relpath(lib):
if isinstance(obj, SharedLibrary):
write_shared_and_system_libs(lib)
elif isinstance(obj, SharedLibrary):
assert lib.variant != lib.COMPONENT
backend_file.write_once('SHARED_LIBS += %s/%s\n'
% (relpath, lib.import_name))
elif isinstance(obj, (Program, SimpleProgram)):
Expand All @@ -1312,7 +1308,6 @@ def pretty_relpath(lib):
% (relpath, lib.import_name))
write_shared_and_system_libs(lib)
else:
assert lib.variant != lib.COMPONENT
backend_file.write_once('SHARED_LIBS += %s/%s\n'
% (relpath, lib.import_name))
elif isinstance(obj, (HostLibrary, HostProgram, HostSimpleProgram)):
Expand Down
18 changes: 0 additions & 18 deletions python/mozbuild/mozbuild/frontend/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,12 +1169,6 @@ def aggregate(files):
with the host compiler.
"""),

'IS_COMPONENT': (bool, bool,
"""Whether the library contains a binary XPCOM component manifest.
Implies FORCE_SHARED_LIB.
"""),

'HOST_LIBRARY_NAME': (unicode, unicode,
"""Name of target library generated when cross compiling.
"""),
Expand Down Expand Up @@ -1836,7 +1830,6 @@ def aggregate(files):
'HOST_PROGRAM',
'HOST_LIBRARY_NAME',
'HOST_SIMPLE_PROGRAMS',
'IS_COMPONENT',
'IS_FRAMEWORK',
'LIBRARY_NAME',
'PROGRAM',
Expand Down Expand Up @@ -2213,17 +2206,6 @@ def Program(name):
FORCE_SHARED_LIB = True
''',

'IS_COMPONENT': '''
Please use
XPCOMBinaryComponent('foo')
instead of
Library('foo') [ or LIBRARY_NAME = 'foo' ]
IS_COMPONENT = True
''',

'IS_FRAMEWORK': '''
Please use
Expand Down
6 changes: 1 addition & 5 deletions python/mozbuild/mozbuild/frontend/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,6 @@ def __init__(self, context):

def link_library(self, obj):
assert isinstance(obj, BaseLibrary)
if isinstance(obj, SharedLibrary) and obj.variant == obj.COMPONENT:
raise LinkageWrongKindError(
'Linkable.link_library() does not take components.')
if obj.KIND != self.KIND:
raise LinkageWrongKindError('%s != %s' % (obj.KIND, self.KIND))
# Linking multiple Rust libraries into an object would result in
Expand Down Expand Up @@ -576,8 +573,7 @@ class SharedLibrary(Library):
}

FRAMEWORK = 1
COMPONENT = 2
MAX_VARIANT = 3
MAX_VARIANT = 2

def __init__(self, context, basename, real_name=None,
soname=None, variant=None, symbols_file=False):
Expand Down
18 changes: 0 additions & 18 deletions python/mozbuild/mozbuild/frontend/emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
XPIDLFile,
)
from mozpack.chrome.manifest import (
ManifestBinaryComponent,
Manifest,
)

Expand Down Expand Up @@ -608,7 +607,6 @@ def check_unique_binary(program, kind):
shared_name = context.get('SHARED_LIBRARY_NAME')

is_framework = context.get('IS_FRAMEWORK')
is_component = context.get('IS_COMPONENT')

soname = context.get('SONAME')

Expand All @@ -630,22 +628,10 @@ def check_unique_binary(program, kind):
raise SandboxValidationError(
'FINAL_LIBRARY conflicts with IS_FRAMEWORK. '
'Please remove one.', context)
if is_component:
raise SandboxValidationError(
'FINAL_LIBRARY conflicts with IS_COMPONENT. '
'Please remove one.', context)
static_args['link_into'] = final_lib
static_lib = True

if libname:
if is_component:
if static_lib:
raise SandboxValidationError(
'IS_COMPONENT conflicts with FORCE_STATIC_LIB. '
'Please remove one.', context)
shared_lib = True
shared_args['variant'] = SharedLibrary.COMPONENT

if is_framework:
if soname:
raise SandboxValidationError(
Expand Down Expand Up @@ -742,10 +728,6 @@ def check_unique_binary(program, kind):
self._linkage.append((context, lib, 'USE_LIBS'))
linkables.append(lib)
generated_files.add(lib.lib_name)
if is_component and not context['NO_COMPONENTS_MANIFEST']:
yield ChromeManifestEntry(context,
'components/components.manifest',
ManifestBinaryComponent('components', lib.lib_name))
if symbols_file and isinstance(symbols_file, SourcePath):
script = mozpath.join(
mozpath.dirname(mozpath.dirname(__file__)),
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4797958

Please sign in to comment.