Bug 1573566 - Move the real libxul definition in a subdirectory. r=froydnj

The current setup, where gtest/libxul uses the static library in
the same directory as the shared libxul, and somehow the backend ignores
gkrust for gtest/libxul, is fragile.

Differential Revision: https://phabricator.services.mozilla.com/D42246

--HG--
rename : toolkit/library/dependentlibs.py => toolkit/library/build/dependentlibs.py
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2019-08-16 21:44:10 +00:00
Родитель 8275452b39
Коммит 312ec28e99
6 изменённых файлов: 65 добавлений и 63 удалений

Просмотреть файл

@ -45,7 +45,7 @@ exclude =
toolkit/content/tests/chrome/file_about_networking_wsh.py, toolkit/content/tests/chrome/file_about_networking_wsh.py,
toolkit/crashreporter/tools/symbolstore.py, toolkit/crashreporter/tools/symbolstore.py,
toolkit/crashreporter/tools/unit-symbolstore.py, toolkit/crashreporter/tools/unit-symbolstore.py,
toolkit/library/dependentlibs.py, toolkit/library/build/dependentlibs.py,
toolkit/locales/generate_update_locale.py, toolkit/locales/generate_update_locale.py,
toolkit/mozapps, toolkit/mozapps,
toolkit/moz.configure, toolkit/moz.configure,

Просмотреть файл

@ -25,7 +25,7 @@ def GeckoBinary(linkage='dependent', mozglue=None):
if linkage == 'dependent': if linkage == 'dependent':
USE_LIBS += [ USE_LIBS += [
'nspr', 'nspr',
'xul', 'xul-real',
] ]
elif linkage == 'standalone': elif linkage == 'standalone':
DEFINES['XPCOM_GLUE'] = True DEFINES['XPCOM_GLUE'] = True

Просмотреть файл

@ -0,0 +1,32 @@
# -*- 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/.
USE_LIBS += [
'static:xul',
]
# This library is entirely composed of Rust code, and needs to come after
# all the C++ code so any possible C++ -> Rust calls can be resolved.
USE_LIBS += ['gkrust']
Libxul('xul-real')
if CONFIG['COMPILE_ENVIRONMENT']:
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
full_libname = SHARED_LIBRARY_NAME
else:
full_libname = '%s%s%s' % (
CONFIG['DLL_PREFIX'],
SHARED_LIBRARY_NAME,
CONFIG['DLL_SUFFIX']
)
GENERATED_FILES += [('dependentlibs.list', 'dependentlibs.list.gtest')]
dep_libs_list = GENERATED_FILES[('dependentlibs.list', 'dependentlibs.list.gtest')]
dep_libs_list.script = 'dependentlibs.py:gen_list'
dep_libs_list.inputs = [
'!%s' % full_libname,
]
FINAL_TARGET_FILES += ['!dependentlibs.list', '!dependentlibs.list.gtest']

Просмотреть файл

@ -20,23 +20,5 @@ USE_LIBS += [
'static:xul', 'static:xul',
] ]
if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android':
GENERATED_FILES += ['symverscript']
GENERATED_FILES['symverscript'].script = '/build/gen_symverscript.py'
GENERATED_FILES['symverscript'].inputs = ['../symverscript.in']
GENERATED_FILES['symverscript'].flags = [
'xul%s' % CONFIG['MOZILLA_SYMBOLVERSION']
]
SYMBOLS_FILE = '!symverscript'
# Generate GDB pretty printer-autoload files only on Linux. OSX's GDB is
# too old to support Python pretty-printers; if this changes, we could
# make this 'ifdef GNU_CC'.
if CONFIG['OS_ARCH'] == 'Linux':
# Create a GDB Python auto-load file alongside the libxul shared library
# in the build directory.
DEFINES['topsrcdir'] = TOPSRCDIR
OBJDIR_PP_FILES.toolkit.library.gtest += ['../libxul.so-gdb.py.in']
Libxul('xul-gtest', Libxul('xul-gtest',
output_category=None if CONFIG['LINK_GTEST_DURING_COMPILE'] else 'gtest') output_category=None if CONFIG['LINK_GTEST_DURING_COMPILE'] else 'gtest')

Просмотреть файл

@ -84,12 +84,36 @@ def Libxul(name, output_category=None):
if CONFIG['RUSTC_NATVIS_LDFLAGS']: if CONFIG['RUSTC_NATVIS_LDFLAGS']:
LDFLAGS += CONFIG['RUSTC_NATVIS_LDFLAGS'] LDFLAGS += CONFIG['RUSTC_NATVIS_LDFLAGS']
Libxul('xul') if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android':
GENERATED_FILES += ['symverscript']
GENERATED_FILES['symverscript'].script = '/build/gen_symverscript.py'
GENERATED_FILES['symverscript'].inputs = ['../symverscript.in']
GENERATED_FILES['symverscript'].flags = [
'xul%s' % CONFIG['MOZILLA_SYMBOLVERSION']
]
SYMBOLS_FILE = '!symverscript'
FORCE_STATIC_LIB = True # Generate GDB pretty printer-autoload files only on Linux. OSX's GDB is
# too old to support Python pretty-printers; if this changes, we could
# make this 'ifdef GNU_CC'.
if CONFIG['OS_ARCH'] == 'Linux':
# Create a GDB Python auto-load file alongside the libxul shared library
# in the build directory.
DEFINES['topsrcdir'] = TOPSRCDIR
OBJDIR_PP_FILES.toolkit.library.gtest += ['../libxul.so-gdb.py.in']
# The real libxul definition is in ./build/moz.build, but we define a
# xul library here such that # FINAL_LIBRARY = 'xul' refers to here, which
# is then linked to both build/libxul and gtest/libxul.
Library('xul')
STATIC_LIBRARY_NAME = 'xul_s' STATIC_LIBRARY_NAME = 'xul_s'
# Use a FINAL_LIBRARY for Libxul_defines to propagate from there. They wouldn't
# propagate from here.
FINAL_LIBRARY = 'xul-real'
if CONFIG['OS_ARCH'] == 'WINNT': if CONFIG['OS_ARCH'] == 'WINNT':
SOURCES += [ SOURCES += [
'nsDllMain.cpp', 'nsDllMain.cpp',
@ -106,7 +130,10 @@ if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['CC_TYPE'] not in ('clang', 'gcc'):
'/xpcom/base', '/xpcom/base',
] ]
DIRS += ['gtest'] DIRS += [
'build',
'gtest',
]
if CONFIG['OS_ARCH'] == 'WINNT': if CONFIG['OS_ARCH'] == 'WINNT':
DIRS += ['dummydll'] DIRS += ['dummydll']
@ -334,45 +361,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
'oleaut32', 'oleaut32',
] ]
if CONFIG['COMPILE_ENVIRONMENT']:
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
full_libname = SHARED_LIBRARY_NAME
else:
full_libname = '%s%s%s' % (
CONFIG['DLL_PREFIX'],
LIBRARY_NAME,
CONFIG['DLL_SUFFIX']
)
GENERATED_FILES += [('dependentlibs.list', 'dependentlibs.list.gtest')]
dep_libs_list = GENERATED_FILES[('dependentlibs.list', 'dependentlibs.list.gtest')]
dep_libs_list.script = 'dependentlibs.py:gen_list'
dep_libs_list.inputs = [
'!%s' % full_libname,
]
FINAL_TARGET_FILES += ['!dependentlibs.list', '!dependentlibs.list.gtest']
if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android':
GENERATED_FILES += ['symverscript']
GENERATED_FILES['symverscript'].script = '/build/gen_symverscript.py'
GENERATED_FILES['symverscript'].inputs = ['symverscript.in']
GENERATED_FILES['symverscript'].flags = [
'xul%s' % CONFIG['MOZILLA_SYMBOLVERSION']
]
SYMBOLS_FILE = '!symverscript'
# Generate GDB pretty printer-autoload files only on Linux. OSX's GDB is
# too old to support Python pretty-printers; if this changes, we could
# make this 'ifdef GNU_CC'.
if CONFIG['OS_ARCH'] == 'Linux':
# Create a GDB Python auto-load file alongside the libxul shared library
# in the build directory.
DEFINES['topsrcdir'] = TOPSRCDIR
OBJDIR_PP_FILES.toolkit.library += ['libxul.so-gdb.py.in']
# This library is entirely composed of Rust code, and needs to come after
# all the C++ code so any possible C++ -> Rust calls can be resolved.
USE_LIBS += ['gkrust']
# The buildid is refreshed on every (incremental) build. But we want to avoid # The buildid is refreshed on every (incremental) build. But we want to avoid
# rebuilding libxul every time, so instead of having a source file that # rebuilding libxul every time, so instead of having a source file that
# #include's buildid.h, which would have a dependency on it, and that would # #include's buildid.h, which would have a dependency on it, and that would
@ -388,4 +376,4 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
else: else:
libxul_list = '%sxul_%s' % ( libxul_list = '%sxul_%s' % (
CONFIG['DLL_PREFIX'], CONFIG['DLL_SUFFIX'].lstrip('.')) CONFIG['DLL_PREFIX'], CONFIG['DLL_SUFFIX'].lstrip('.'))
GENERATED_FILES['buildid.cpp'].inputs = ['!%s.list' % libxul_list] GENERATED_FILES['buildid.cpp'].inputs = ['!build/%s.list' % libxul_list]