Backed out changeset 098dacd3fabe (bug 1476339) for Linting failure in mozbuild/mozbuild/frontend/context.py. CLOSED TREE

--HG--
extra : amend_source : a805d5f03e8127b4248a5f95943e1f33f3b92608
This commit is contained in:
Dorel Luca 2019-10-23 01:26:46 +03:00
parent 0cbc6daf1f
commit cf3d2dccbb
6 changed files with 19 additions and 28 deletions

View File

@ -21,7 +21,9 @@ ac_add_options --disable-profiling
ac_add_options --disable-warnings-as-errors
ac_add_options --enable-coverage
export LDFLAGS="-Wl,--compress-debug-sections=zlib"
export CFLAGS="--coverage"
export CXXFLAGS="--coverage"
export LDFLAGS="--coverage -Wl,--compress-debug-sections=zlib"
# gold is required for libFuzzer to work properly
ac_add_options --enable-gold

View File

@ -13,6 +13,6 @@ ac_add_options --disable-warnings-as-errors
ac_add_options --enable-coverage
CLANG_LIB_DIR="$(cd $MOZ_FETCHES_DIR/clang/lib/clang/* && cd lib/linux && pwd)"
export LDFLAGS="-L$CLANG_LIB_DIR"
export LDFLAGS="--coverage -L$CLANG_LIB_DIR"
export LIBS="-lclang_rt.profile-x86_64"
export RUSTFLAGS="-Ccodegen-units=1 -Zprofile -Zno-landing-pads -Clink-dead-code -Coverflow-checks=off"

View File

@ -8,4 +8,7 @@ ac_add_options --disable-sandbox
ac_add_options --disable-warnings-as-errors
ac_add_options --enable-coverage
CLANG_LIB_DIR="$(cd $MOZ_FETCHES_DIR/clang/lib/clang/* && cd lib/darwin && pwd)"
export LDFLAGS="-coverage -L$CLANG_LIB_DIR"
export LIBS="-lclang_rt.profile_osx"
export RUSTFLAGS="-Ccodegen-units=1 -Zprofile -Zno-landing-pads -Clink-dead-code -Coverflow-checks=off"

View File

@ -18,6 +18,13 @@ export MOZILLA_OFFICIAL=1
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
if [ -d "$MOZ_FETCHES_DIR/clang" ]; then
CLANG_LIB_DIR="$(cd $MOZ_FETCHES_DIR/clang/lib/clang/* && cd lib/windows && pwd)"
export LIB=$LIB:$CLANG_LIB_DIR
export LDFLAGS="clang_rt.profile-x86_64.lib"
fi
export RUSTFLAGS="-Ccodegen-units=1 -Zprofile -Zno-landing-pads -Clink-dead-code -Coverflow-checks=off"
. "$topsrcdir/build/mozconfig.common.override"

View File

@ -1811,12 +1811,11 @@ def code_coverage(value):
set_config('MOZ_CODE_COVERAGE', code_coverage)
set_define('MOZ_CODE_COVERAGE', code_coverage)
@depends(target, c_compiler, vc_path, check_build_environment, mozbuild_state_path, when=code_coverage)
@imports('os')
@depends(target, c_compiler, vc_path, check_build_environment, when=code_coverage)
@imports('re')
@imports('mozpack.path')
@imports(_from='__builtin__', _import='open')
def coverage_flags(target, c_compiler, vc_path, build_env, mozbuild_state_path):
def coverage_cflags(target, c_compiler, vc_path, build_env):
cflags = ['--coverage']
if c_compiler.type in ('clang', 'clang-cl'):
@ -1844,28 +1843,9 @@ def coverage_flags(target, c_compiler, vc_path, build_env, mozbuild_state_path):
with open(response_file_path, 'w') as f:
f.write(' '.join(cflags))
cflags = ['@{}'.format(response_file_path)]
return ['@{}'.format(response_file_path)]
if target.os == 'WINNT':
if c_compiler.type == 'clang-cl':
if target.cpu == 'x86_64':
ldflags = ['clang_rt.profile-x86_64.lib']
elif target.cpu == 'x86':
ldflags = ['clang_rt.profile-i386.lib']
else:
ldflags = None
elif target.os == 'OSX':
ldflags = ['-coverage']
else:
ldflags = ['--coverage']
return namespace(
cflags=cflags,
ldflags=ldflags,
)
set_config('COVERAGE_CFLAGS', coverage_flags.cflags)
set_config('COVERAGE_LDFLAGS', coverage_flags.ldflags)
set_config('COVERAGE_CFLAGS', coverage_cflags)
# ==============================================================

View File

@ -401,7 +401,6 @@ class LinkFlags(BaseCompileFlags):
('OPTIMIZE', (context.config.substs.get('MOZ_OPTIMIZE_LDFLAGS', []) if
context.config.substs.get('MOZ_OPTIMIZE') else []),
('LDFLAGS',)),
('COVERAGE_LDFLAGS', context.config.substs.get('COVERAGE_LDFLAGS'), ('LDFLAGS',)),
)
BaseCompileFlags.__init__(self, context)
@ -473,7 +472,7 @@ class CompileFlags(BaseCompileFlags):
('CFLAGS', 'C_LDFLAGS')),
('MOZBUILD_CFLAGS', None, ('CFLAGS',)),
('MOZBUILD_CXXFLAGS', None, ('CXXFLAGS',)),
('COVERAGE_CFLAGS', context.config.substs.get('COVERAGE_CFLAGS'), ('CXXFLAGS', 'CFLAGS')),
('COVERAGE', context.config.substs.get('COVERAGE_CFLAGS'), ('CXXFLAGS', 'CFLAGS')),
)
BaseCompileFlags.__init__(self, context)