зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1483780) for build bustages on a CLOSED TREE
Backed out changeset 2b0a42c589c5 (bug 1483780) Backed out changeset 48d133cbafd3 (bug 1483780)
This commit is contained in:
Родитель
c047fdb3fb
Коммит
a6ba34f2ad
|
@ -134,25 +134,6 @@ AC_SUBST(MOZ_SIGNED_OVERFLOW_SANITIZE)
|
|||
AC_SUBST(MOZ_UNSIGNED_OVERFLOW_SANITIZE)
|
||||
AC_SUBST(MOZ_UBSAN)
|
||||
|
||||
dnl =======================================================
|
||||
dnl = Required for stand-alone (sanitizer-less) libFuzzer.
|
||||
dnl =======================================================
|
||||
if test -n "$LIBFUZZER"; then
|
||||
# must match tools/fuzzing/libfuzzer-flags.mozbuild
|
||||
if test -n "$HAVE_LIBFUZZER_FLAG_FUZZER_NO_LINK"; then
|
||||
LDFLAGS="-fsanitize=fuzzer-no-link -rdynamic $LDFLAGS"
|
||||
else
|
||||
LDFLAGS="-fsanitize-coverage=trace-pc-guard,trace-cmp -rdynamic $LDFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl =======================================================
|
||||
dnl = Required for stand-alone (sanitizer-less) libFuzzer.
|
||||
dnl =======================================================
|
||||
if test -n "$LIBFUZZER"; then
|
||||
LDFLAGS="$LIBFUZZER_FLAGS -rdynamic $LDFLAGS"
|
||||
fi
|
||||
|
||||
# The LLVM symbolizer is used by all sanitizers
|
||||
AC_SUBST(LLVM_SYMBOLIZER)
|
||||
|
||||
|
|
|
@ -1855,24 +1855,12 @@ add_gcc_flag(
|
|||
|
||||
@depends(c_compiler.try_compile(flags=['-fsanitize=fuzzer-no-link'],
|
||||
check_msg='whether the C compiler supports -fsanitize=fuzzer-no-link'))
|
||||
def libfuzzer_flags(value):
|
||||
def have_libfuzzer_flag_fuzzer_no_link(value):
|
||||
if value:
|
||||
no_link_flag_supported = True
|
||||
# recommended for (and only supported by) clang >= 6
|
||||
use_flags = ['-fsanitize=fuzzer-no-link']
|
||||
else:
|
||||
no_link_flag_supported = False
|
||||
use_flags = ['-fsanitize-coverage=trace-pc-guard,trace-cmp']
|
||||
return True
|
||||
|
||||
return namespace(
|
||||
no_link_flag_supported=no_link_flag_supported,
|
||||
use_flags=use_flags,
|
||||
)
|
||||
|
||||
set_config('HAVE_LIBFUZZER_FLAG_FUZZER_NO_LINK', libfuzzer_flags.no_link_flag_supported)
|
||||
set_config('LIBFUZZER_FLAGS', libfuzzer_flags.use_flags)
|
||||
add_old_configure_assignment('LIBFUZZER_FLAGS', libfuzzer_flags.use_flags)
|
||||
add_old_configure_assignment('HAVE_LIBFUZZER_FLAG_FUZZER_NO_LINK', have_libfuzzer_flag_fuzzer_no_link)
|
||||
set_config('HAVE_LIBFUZZER_FLAG_FUZZER_NO_LINK', have_libfuzzer_flag_fuzzer_no_link)
|
||||
|
||||
# Shared library building
|
||||
# ==============================================================
|
||||
|
|
|
@ -912,7 +912,6 @@ ifndef MOZ_ASAN
|
|||
ifndef MOZ_TSAN
|
||||
ifndef MOZ_UBSAN
|
||||
ifndef MOZ_CODE_COVERAGE
|
||||
ifndef FUZZING_INTERFACES
|
||||
# Pass the compilers and flags in use to cargo for use in build scripts.
|
||||
# * Don't do this for ASAN/TSAN builds because we don't pass our custom linker (see below)
|
||||
# which will muck things up.
|
||||
|
@ -944,7 +943,6 @@ cargo_c_compiler_envs := \
|
|||
AR_$(rust_cc_env_name)="$(AR)" \
|
||||
$(NULL)
|
||||
endif # WINNT
|
||||
endif # FUZZING_INTERFACES
|
||||
endif # MOZ_CODE_COVERAGE
|
||||
endif # MOZ_UBSAN
|
||||
endif # MOZ_TSAN
|
||||
|
@ -1010,16 +1008,14 @@ ifneq (WINNT,$(OS_ARCH))
|
|||
ifndef MOZ_ASAN
|
||||
ifndef MOZ_TSAN
|
||||
ifndef MOZ_UBSAN
|
||||
ifndef FUZZING_INTERFACES
|
||||
# Cargo needs the same linker flags as the C/C++ compiler,
|
||||
# but not the final libraries. Filter those out because they
|
||||
# cause problems on macOS 10.7; see bug 1365993 for details.
|
||||
# Also, we don't want to pass PGO flags until cargo supports them.
|
||||
target_cargo_env_vars := \
|
||||
MOZ_CARGO_WRAP_LDFLAGS="$(filter-out -fsanitize=cfi% -framework Cocoa -lobjc AudioToolbox ExceptionHandling -fprofile-%,$(LDFLAGS))" \
|
||||
MOZ_CARGO_WRAP_LD="$(CC)" \
|
||||
MOZ_CARGO_WRAP_LDFLAGS="$(filter-out -fsanitize=cfi% -framework Cocoa -lobjc AudioToolbox ExceptionHandling -fprofile-%,$(LDFLAGS))" \
|
||||
MOZ_CARGO_WRAP_LD="$(CC)" \
|
||||
$(cargo_linker_env_var)=$(topsrcdir)/build/cargo-linker
|
||||
endif # FUZZING_INTERFACES
|
||||
endif # MOZ_UBSAN
|
||||
endif # MOZ_TSAN
|
||||
endif # MOZ_ASAN
|
||||
|
|
|
@ -449,11 +449,9 @@ with only_when('--enable-compile-environment'):
|
|||
|
||||
set_config('LIBFUZZER', enable_libfuzzer)
|
||||
set_define('LIBFUZZER', enable_libfuzzer)
|
||||
add_old_configure_assignment('LIBFUZZER', enable_libfuzzer)
|
||||
|
||||
set_config('FUZZING_INTERFACES', enable_fuzzing_interfaces)
|
||||
set_define('FUZZING_INTERFACES', enable_fuzzing_interfaces)
|
||||
add_old_configure_assignment('FUZZING_INTERFACES', enable_fuzzing_interfaces)
|
||||
|
||||
# Enable pipeline operator
|
||||
# ===================================================
|
||||
|
|
|
@ -443,7 +443,7 @@ if test "$GNU_CC"; then
|
|||
# Some tools like ASan use a runtime library that is only
|
||||
# linked against executables, so we must allow undefined
|
||||
# symbols for shared objects in some cases.
|
||||
if test -z "$MOZ_ASAN$MOZ_MSAN$MOZ_UBSAN$MOZ_TSAN$FUZZING_INTERFACES"; then
|
||||
if test -z "$MOZ_ASAN$MOZ_MSAN$MOZ_UBSAN$MOZ_TSAN"; then
|
||||
# Don't allow undefined symbols in libraries
|
||||
DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
|
||||
fi
|
||||
|
|
|
@ -616,7 +616,7 @@ if test "$GNU_CC"; then
|
|||
# Some tools like ASan use a runtime library that is only
|
||||
# linked against executables, so we must allow undefined
|
||||
# symbols for shared objects in some cases.
|
||||
if test -z "$MOZ_ASAN$MOZ_MSAN$MOZ_UBSAN$MOZ_TSAN$FUZZING_INTERFACES"; then
|
||||
if test -z "$MOZ_ASAN$MOZ_MSAN$MOZ_UBSAN$MOZ_TSAN"; then
|
||||
# Don't allow undefined symbols in libraries
|
||||
DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
|
||||
|
||||
|
|
|
@ -5,4 +5,9 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
libfuzzer_flags = []
|
||||
libfuzzer_flags += CONFIG['LIBFUZZER_FLAGS']
|
||||
|
||||
if CONFIG['HAVE_LIBFUZZER_FLAG_FUZZER_NO_LINK']:
|
||||
libfuzzer_flags += ['-fsanitize=fuzzer-no-link']
|
||||
else:
|
||||
# Older Clang versions (<= 5) only support an older set of libFuzzer flags
|
||||
libfuzzer_flags += ['-fsanitize-coverage=trace-pc-guard,trace-cmp']
|
||||
|
|
Загрузка…
Ссылка в новой задаче