Commit 2c8663aa authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

[gyp] remove gyp files.

R=machenbach@chromium.org

Bug: v8:7335
Change-Id: Ied1101295fc9ee37fcc038b9aeb557229722df0b
Reviewed-on: https://chromium-review.googlesource.com/897566
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51185}
parent 922d14b4
......@@ -37,8 +37,6 @@
/base
/build
/buildtools
/gypfiles/.gold_plugin
/gypfiles/win_toolchain.json
/hydrogen.cfg
/obj
/out
......
......@@ -79,7 +79,6 @@ include_rules = [
# checkdeps.py shouldn't check for includes in these directories:
skip_child_includes = [
'build',
'gypfiles',
'third_party',
]
......@@ -334,13 +333,6 @@ hooks = [
'-s', 'v8/tools/mips_toolchain.tar.gz.sha1',
],
},
{
# A change to a .gyp, .gypi, or to GYP itself should run the generator.
'name': 'regyp_if_needed',
'pattern': '.',
'condition': 'build_for_node != True',
'action': ['python', 'v8/gypfiles/gyp_v8', '--running-as-hook'],
},
# Download and initialize "vpython" VirtualEnv environment packages.
{
'name': 'vpython_common',
......
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Variable default definitions. Override them by exporting them in your shell.
OUTDIR ?= out
TESTJOBS ?=
GYPFLAGS ?=
TESTFLAGS ?=
ANDROID_NDK_HOST_ARCH ?=
ANDROID_V8 ?= /data/local/tmp/v8
$(warning Make (gyp) is deprecated. Please use GN instead.)
$(warning See https://github.com/v8/v8/wiki/Building-with-GN)
$(warning Or contact yangguo@chromium.org.)
$(error Expect the Makefile to be removed soon)
include tools/Makefile.tags
# Special build flags. Use them like this: "make library=shared"
# library=shared || component=shared_library
ifeq ($(library), shared)
GYPFLAGS += -Dcomponent=shared_library
endif
ifdef component
GYPFLAGS += -Dcomponent=$(component)
endif
# disassembler=on
ifeq ($(disassembler), on)
GYPFLAGS += -Dv8_enable_disassembler=1
endif
# objectprint=on
ifeq ($(objectprint), on)
GYPFLAGS += -Dv8_object_print=1
endif
# verifycsa=on
ifeq ($(verifycsa), on)
GYPFLAGS += -Dv8_enable_verify_csa=1
endif
# verifyheap=on
ifeq ($(verifyheap), on)
GYPFLAGS += -Dv8_enable_verify_heap=1
endif
# tracemaps=on
ifeq ($(tracemaps), on)
GYPFLAGS += -Dv8_trace_maps=1
endif
# concurrentmarking=on
ifeq ($(concurrentmarking), on)
GYPFLAGS += -Dv8_enable_concurrent_marking=1
endif
# backtrace=off
ifeq ($(backtrace), off)
GYPFLAGS += -Dv8_enable_backtrace=0
else
GYPFLAGS += -Dv8_enable_backtrace=1
endif
# verifypredictable=on
ifeq ($(verifypredictable), on)
GYPFLAGS += -Dv8_enable_verify_predictable=1
endif
# snapshot=off
ifeq ($(snapshot), off)
GYPFLAGS += -Dv8_use_snapshot='false'
endif
ifeq ($(snapshot), external)
GYPFLAGS += -Dv8_use_external_startup_data=1
endif
# extrachecks=on/off
ifeq ($(extrachecks), on)
GYPFLAGS += -Ddcheck_always_on=1 -Dv8_enable_handle_zapping=1
endif
ifeq ($(extrachecks), off)
GYPFLAGS += -Ddcheck_always_on=0 -Dv8_enable_handle_zapping=0
endif
# slowdchecks=on/off
ifeq ($(slowdchecks), on)
GYPFLAGS += -Dv8_enable_slow_dchecks=1
endif
ifeq ($(slowdchecks), off)
GYPFLAGS += -Dv8_enable_slow_dchecks=0
endif
# debugsymbols=on
ifeq ($(debugsymbols), on)
GYPFLAGS += -Drelease_extra_cflags=-ggdb3
endif
# gdbjit=on/off
ifeq ($(gdbjit), on)
GYPFLAGS += -Dv8_enable_gdbjit=1
endif
ifeq ($(gdbjit), off)
GYPFLAGS += -Dv8_enable_gdbjit=0
endif
# vtunejit=on
ifeq ($(vtunejit), on)
GYPFLAGS += -Dv8_enable_vtunejit=1
endif
# unalignedaccess=on
ifeq ($(unalignedaccess), on)
GYPFLAGS += -Dv8_can_use_unaligned_accesses=true
endif
# randomseed=12345, disable random seed via randomseed=0
ifdef randomseed
GYPFLAGS += -Dv8_random_seed=$(randomseed)
endif
# soname_version=1.2.3
ifdef soname_version
GYPFLAGS += -Dsoname_version=$(soname_version)
endif
# werror=no
ifeq ($(werror), no)
GYPFLAGS += -Dwerror=''
endif
# strictaliasing=off (workaround for GCC-4.5)
ifeq ($(strictaliasing), off)
GYPFLAGS += -Dv8_no_strict_aliasing=1
endif
# regexp=interpreted
ifeq ($(regexp), interpreted)
GYPFLAGS += -Dv8_interpreted_regexp=1
endif
# i18nsupport=off
ifeq ($(i18nsupport), off)
GYPFLAGS += -Dv8_enable_i18n_support=0
TESTFLAGS += --noi18n
endif
# deprecationwarnings=on
ifeq ($(deprecationwarnings), on)
GYPFLAGS += -Dv8_deprecation_warnings=1
endif
# vectorstores=on
ifeq ($(vectorstores), on)
GYPFLAGS += -Dv8_vector_stores=1
endif
# imminentdeprecationwarnings=on
ifeq ($(imminentdeprecationwarnings), on)
GYPFLAGS += -Dv8_imminent_deprecation_warnings=1
endif
# asan=on
ifeq ($(asan), on)
GYPFLAGS += -Dasan=1 -Dclang=1
TESTFLAGS += --asan
ifeq ($(lsan), on)
GYPFLAGS += -Dlsan=1
endif
endif
ifdef embedscript
GYPFLAGS += -Dembed_script=$(embedscript)
endif
ifdef warmupscript
GYPFLAGS += -Dwarmup_script=$(warmupscript)
endif
ifeq ($(goma), on)
GYPFLAGS += -Duse_goma=1
endif
# v8_os_page_size=0, when 0 or not specified use build OS page size
ifdef v8_os_page_size
ifneq ($(v8_os_page_size), 0)
ifneq ($(snapshot), off)
GYPFLAGS += -Dv8_os_page_size=$(v8_os_page_size)
endif
endif
endif
# arm specific flags.
# arm_version=<number | "default">
ifneq ($(strip $(arm_version)),)
GYPFLAGS += -Darm_version=$(arm_version)
else
# Deprecated (use arm_version instead): armv7=false/true
ifeq ($(armv7), false)
GYPFLAGS += -Darm_version=6
else
ifeq ($(armv7), true)
GYPFLAGS += -Darm_version=7
endif
endif
endif
# hardfp=on/off. Deprecated, use armfloatabi
ifeq ($(hardfp),on)
GYPFLAGS += -Darm_float_abi=hard
else
ifeq ($(hardfp),off)
GYPFLAGS += -Darm_float_abi=softfp
endif
endif
# fpu: armfpu=xxx
# xxx: vfp, vfpv3-d16, vfpv3, neon.
ifeq ($(armfpu),)
GYPFLAGS += -Darm_fpu=default
else
GYPFLAGS += -Darm_fpu=$(armfpu)
endif
# float abi: armfloatabi=softfp/hard
ifeq ($(armfloatabi),)
ifeq ($(hardfp),)
GYPFLAGS += -Darm_float_abi=default
endif
else
GYPFLAGS += -Darm_float_abi=$(armfloatabi)
endif
# armthumb=on/off
ifeq ($(armthumb), off)
GYPFLAGS += -Darm_thumb=0
else
ifeq ($(armthumb), on)
GYPFLAGS += -Darm_thumb=1
endif
endif
# arm_test_noprobe=on
# With this flag set, by default v8 will only use features implied
# by the compiler (no probe). This is done by modifying the default
# values of enable_armv7, enable_vfp3, enable_32dregs and enable_neon.
# Modifying these flags when launching v8 will enable the probing for
# the specified values.
ifeq ($(arm_test_noprobe), on)
GYPFLAGS += -Darm_test_noprobe=on
endif
# Do not omit the frame pointer, needed for profiling with perf
ifeq ($(no_omit_framepointer), on)
GYPFLAGS += -Drelease_extra_cflags=-fno-omit-frame-pointer
endif
ifdef android_ndk_root
GYPFLAGS += -Dandroid_ndk_root=$(android_ndk_root)
export ANDROID_NDK_ROOT = $(android_ndk_root)
endif
# ----------------- available targets: --------------------
# - any arch listed in ARCHES (see below)
# - any mode listed in MODES
# - every combination <arch>.<mode>, e.g. "ia32.release"
# - "native": current host's architecture, release mode
# - any of the above with .check appended, e.g. "ia32.release.check"
# - "android": cross-compile for Android/ARM
# - default (no target specified): build all DEFAULT_ARCHES and MODES
# - "check": build all targets and run all tests
# - "<arch>.clean" for any <arch> in ARCHES
# - "clean": clean all ARCHES
# ----------------- internal stuff ------------------------
# Architectures and modes to be compiled. Consider these to be internal
# variables, don't override them (use the targets instead).
ARCHES = ia32 x64 arm arm64 mips mipsel mips64 mips64el ppc ppc64 s390 s390x
ARCHES32 = ia32 arm mips mipsel ppc s390
DEFAULT_ARCHES = ia32 x64 arm
MODES = release debug optdebug
DEFAULT_MODES = release debug
ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \
android_mipsel
# List of files that trigger Makefile regeneration:
GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \
gypfiles/shim_headers.gypi gypfiles/features.gypi \
gypfiles/standalone.gypi \
gypfiles/toolchain.gypi gypfiles/all.gyp gypfiles/mac/asan.gyp \
gypfiles/cctest.gyp gypfiles/fuzzer.gyp \
gypfiles/unittests.gyp gypfiles/v8.gyp \
gypfiles/parser-shell.gyp gypfiles/gmock.gyp gypfiles/gtest.gyp \
gypfiles/samples.gyp gypfiles/v8vtune.gyp gypfiles/d8.gyp \
gypfiles/inspector-test.gyp gypfiles/mkgrokdump.gyp
# Generates all combinations of ARCHES and MODES, e.g. "ia32.release".
BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES)))
ANDROID_BUILDS = $(foreach mode,$(MODES), \
$(addsuffix .$(mode),$(ANDROID_ARCHES)))
# Generates corresponding test targets, e.g. "ia32.release.check".
CHECKS = $(addsuffix .check,$(BUILDS))
QUICKCHECKS = $(addsuffix .quickcheck,$(BUILDS))
ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS))
# File where previously used GYPFLAGS are stored.
ENVFILE = $(OUTDIR)/environment
.PHONY: all check clean builddeps dependencies $(ENVFILE).new native \
qc quickcheck $(QUICKCHECKS) turbocheck \
$(addsuffix .quickcheck,$(MODES)) $(addsuffix .quickcheck,$(ARCHES)) \
$(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \
$(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \
$(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS)
# Target definitions. "all" is the default.
all: $(DEFAULT_MODES)
# Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile
# having been created before.
buildbot:
$(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \
builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)"
# Compile targets. MODES and ARCHES are convenience targets.
.SECONDEXPANSION:
$(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES))
$(ARCHES): $(addprefix $$@.,$(DEFAULT_MODES))
# Defines how to build a particular target (e.g. ia32.release).
$(BUILDS): $(OUTDIR)/Makefile.$$@
@$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \
BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
python -c "print \
raw_input().replace('opt', '').capitalize()") \
builddir="$(shell pwd)/$(OUTDIR)/$@"
native: $(OUTDIR)/Makefile.native
@$(MAKE) -C "$(OUTDIR)" -f Makefile.native \
BUILDTYPE=Release \
builddir="$(shell pwd)/$(OUTDIR)/$@"
$(ANDROID_ARCHES): $(addprefix $$@.,$(MODES))
$(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) Makefile.android
@$(MAKE) -f Makefile.android $@ \
ARCH="$(basename $@)" \
MODE="$(subst .,,$(suffix $@))" \
OUTDIR="$(OUTDIR)" \
GYPFLAGS="$(GYPFLAGS)"
# Test targets.
check: all
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \
$(TESTFLAGS)
$(addsuffix .check,$(MODES)): $$(basename $$@)
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--mode=$(basename $@) $(TESTFLAGS)
$(addsuffix .check,$(ARCHES)): $$(basename $$@)
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch=$(basename $@) $(TESTFLAGS)
$(CHECKS): $$(basename $$@)
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(basename $@) $(TESTFLAGS)
$(addsuffix .quickcheck,$(MODES)): $$(basename $$@)
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--mode=$(basename $@) $(TESTFLAGS) --quickcheck
$(addsuffix .quickcheck,$(ARCHES)): $$(basename $$@)
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch=$(basename $@) $(TESTFLAGS) --quickcheck
$(QUICKCHECKS): $$(basename $$@)
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(basename $@) $(TESTFLAGS) --quickcheck
$(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@)
@tools/android-sync.sh $(basename $@) $(OUTDIR) \
$(shell pwd) $(ANDROID_V8)
$(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(basename $@) \
--timeout=600 \
--command-prefix="tools/android-run.py" $(TESTFLAGS)
$(addsuffix .check, $(ANDROID_ARCHES)): \
$(addprefix $$(basename $$@).,$(MODES)).check
native.check: native
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
--arch-and-mode=. $(TESTFLAGS)
SUPERFASTTESTMODES = ia32.release
FASTTESTMODES = $(SUPERFASTTESTMODES),x64.release,ia32.optdebug,x64.optdebug,arm.optdebug,arm64.release
FASTCOMPILEMODES = $(FASTTESTMODES),arm64.optdebug
COMMA = ,
EMPTY =
SPACE = $(EMPTY) $(EMPTY)
quickcheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) --quickcheck \
--download-data mozilla webkit
gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) --quickcheck
qc: quickcheck
turbocheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) \
--quickcheck --variants=turbofan --download-data mozilla webkit
gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) \
--quickcheck --variants=turbofan
tc: turbocheck
# Clean targets. You can clean each architecture individually, or everything.
$(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)):
rm -f $(OUTDIR)/Makefile.$(basename $@)*
rm -rf $(OUTDIR)/$(basename $@).release
rm -rf $(OUTDIR)/$(basename $@).debug
rm -rf $(OUTDIR)/$(basename $@).optdebug
find $(OUTDIR) -regex '.*\(host\|target\)\.$(basename $@).*\.mk' -delete
native.clean:
rm -f $(OUTDIR)/Makefile.native
rm -rf $(OUTDIR)/native
find $(OUTDIR) -regex '.*\(host\|target\)\.native\.mk' -delete
clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)) native.clean
# GYP file generation targets.
OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(BUILDS))
$(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
$(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
cut -f 2 -d " " | cut -f 1 -d "-" ))
$(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
$(eval CXX_TARGET_ARCH:=$(subst x86_64,x64,$(CXX_TARGET_ARCH)))
$(eval CXX_TARGET_ARCH:=$(subst s390x,s390,$(CXX_TARGET_ARCH)))
$(eval CXX_TARGET_ARCH:=$(subst powerpc,ppc,$(CXX_TARGET_ARCH)))
$(eval CXX_TARGET_ARCH:=$(subst ppc64,ppc,$(CXX_TARGET_ARCH)))
$(eval CXX_TARGET_ARCH:=$(subst ppcle,ppc,$(CXX_TARGET_ARCH)))
$(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@))))
PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfiles:$(PYTHONPATH):$(shell pwd)/tools/gyp/pylib:$(PYTHONPATH)" \
GYP_GENERATORS=make \
tools/gyp/gyp --generator-output="$(OUTDIR)" gypfiles/all.gyp \
-Igypfiles/standalone.gypi --depth=. \
-Dv8_target_arch=$(V8_TARGET_ARCH) \
$(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \
-Dtarget_arch=$(V8_TARGET_ARCH), \
$(if $(shell echo $(ARCHES32) | grep $(V8_TARGET_ARCH)), \
-Dtarget_arch=ia32,)) \
$(if $(findstring optdebug,$@),-Dv8_optimized_debug=1,) \
-S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS)
$(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfiles:$(PYTHONPATH):$(shell pwd)/tools/gyp/pylib:$(PYTHONPATH)" \
GYP_GENERATORS=make \
tools/gyp/gyp --generator-output="$(OUTDIR)" gypfiles/all.gyp \
-Igypfiles/standalone.gypi --depth=. -S.native $(GYPFLAGS)
# Replaces the old with the new environment file if they're different, which
# will trigger GYP to regenerate Makefiles.
$(ENVFILE): $(ENVFILE).new
@if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) > /dev/null; \
then rm $(ENVFILE).new; \
else mv $(ENVFILE).new $(ENVFILE); fi
# Stores current GYPFLAGS in a file.
$(ENVFILE).new:
$(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
cut -f 2 -d " " | cut -f 1 -d "-" ))
$(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
$(eval CXX_TARGET_ARCH:=$(subst x86_64,x64,$(CXX_TARGET_ARCH)))
@mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS) -Dtarget_arch=$(CXX_TARGET_ARCH)" > $(ENVFILE).new;
dependencies builddeps:
$(error Use 'gclient sync' instead)
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Those definitions should be consistent with the main Makefile
ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \
android_mipsel android_x87
MODES = release debug
# Generates all combinations of ANDROID ARCHES and MODES,
# e.g. "android_ia32.release" or "android_arm.release"
ANDROID_BUILDS = $(foreach mode,$(MODES), \
$(addsuffix .$(mode),$(ANDROID_ARCHES)))
ifeq ($(ARCH), android_arm)
DEFINES = target_arch=arm v8_target_arch=arm
else ifeq ($(ARCH), android_arm64)
DEFINES = target_arch=arm64 v8_target_arch=arm64
else ifeq ($(ARCH), android_mipsel)
DEFINES = target_arch=mipsel v8_target_arch=mipsel
else ifeq ($(ARCH), android_ia32)
DEFINES = target_arch=ia32 v8_target_arch=ia32
else ifeq ($(ARCH), android_x64)
DEFINES = target_arch=x64 v8_target_arch=x64
else ifeq ($(ARCH), android_x87)
DEFINES = target_arch=ia32 v8_target_arch=x87
else
$(error Target architecture "${ARCH}" is not supported)
endif
# Common flags.
DEFINES += OS=android
.SECONDEXPANSION:
$(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@
@$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \
BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
python -c "print raw_input().capitalize()") \
builddir="$(shell pwd)/$(OUTDIR)/$@"
# Android GYP file generation targets.
ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS))
$(ANDROID_MAKEFILES):
GYP_GENERATORS=make-android \
GYP_DEFINES="${DEFINES}" \
PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfiles:$(PYTHONPATH)" \
tools/gyp/gyp --generator-output="${OUTDIR}" gypfiles/all.gyp \
-Igypfiles/standalone.gypi --depth=. \
-S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS}
......@@ -286,39 +286,6 @@ def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api):
return []
def _CheckMissingFiles(input_api, output_api):
"""Runs verify_source_deps.py to ensure no files were added that are not in
GN.
"""
# We need to wait until we have an input_api object and use this
# roundabout construct to import checkdeps because this file is
# eval-ed and thus doesn't have __file__.
original_sys_path = sys.path
try:
sys.path = [input_api.os_path.join(input_api.PresubmitLocalPath(),
'gypfiles')] + sys.path
from verify_source_deps import missing_gn_files, missing_gyp_files
finally:
# Restore sys.path to what it was before.
sys.path = original_sys_path
gn_files = missing_gn_files()
gyp_files = missing_gyp_files()
results = []
if gn_files:
results.append(output_api.PresubmitError(
"You added one or more source files but didn't update the\n"
"corresponding BUILD.gn files:\n",
gn_files))
if gyp_files:
results.append(output_api.PresubmitError(
"You added one or more source files but didn't update the\n"
"corresponding gyp files:\n",
gyp_files))
return results
def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
results = []
......@@ -334,7 +301,6 @@ def _CommonChecks(input_api, output_api):
results.extend(_CheckHeadersHaveIncludeGuards(input_api, output_api))
results.extend(
_CheckNoInlineHeaderIncludesInNormalHeaders(input_api, output_api))
results.extend(_CheckMissingFiles(input_api, output_api))
results.extend(_CheckJSONFiles(input_api, output_api))
results.extend(_CheckMacroUndefs(input_api, output_api))
results.extend(input_api.RunTests(
......
......@@ -64,9 +64,6 @@
'merges': {
'filepath': '.',
},
'gypfiles': {
'filepath': 'gypfiles/',
},
'inspector': {
'filepath': 'inspector',
},
......@@ -116,9 +113,6 @@
# Only enabled on branches created with tools/release/create_release.py
# 'v8-merges@googlegroups.com',
],
'gypfiles': [
'machenbach@chromium.org',
],
'inspector': [
'devtools-reviews@chromium.org',
],
......
machenbach@chromium.org
For build instructions, please refer to:
https://code.google.com/p/v8/wiki/BuildingWithGYP
TL;DR version on *nix:
$ make dependencies # Only needed once.
$ make ia32.release -j8
$ make ia32.release.check # Optionally: run tests.
# Copyright 2011 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'All',
'type': 'none',
'dependencies': [
'd8.gyp:d8',
'inspector-test.gyp:*',
'mkgrokdump.gyp:*',
],
'conditions': [
['component!="shared_library"', {
'dependencies': [
'parser-shell.gyp:parser-shell',
],
}],
# These items don't compile for Android on Mac.
['host_os!="mac" or OS!="android"', {
'dependencies': [
'samples.gyp:*',
'cctest.gyp:*',
'fuzzer.gyp:*',
'unittests.gyp:*',
],
}],
]
}
]
}
# Copyright 2012 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'v8_code': 1,
'generated_file': '<(SHARED_INTERMEDIATE_DIR)/resources.cc',
'cctest_sources': [
'../test/cctest/compiler/c-signature.h',
'../test/cctest/compiler/call-tester.h',
'../test/cctest/compiler/codegen-tester.cc',
'../test/cctest/compiler/codegen-tester.h',
'../test/cctest/compiler/code-assembler-tester.h',
'../test/cctest/compiler/function-tester.cc',
'../test/cctest/compiler/function-tester.h',
'../test/cctest/compiler/graph-builder-tester.h',
'../test/cctest/compiler/test-basic-block-profiler.cc',
'../test/cctest/compiler/test-branch-combine.cc',
'../test/cctest/compiler/test-run-unwinding-info.cc',
'../test/cctest/compiler/test-gap-resolver.cc',
'../test/cctest/compiler/test-graph-visualizer.cc',
'../test/cctest/compiler/test-code-generator.cc',
'../test/cctest/compiler/test-code-assembler.cc',
'../test/cctest/compiler/test-instruction.cc',
'../test/cctest/compiler/test-js-context-specialization.cc',
'../test/cctest/compiler/test-js-constant-cache.cc',
'../test/cctest/compiler/test-js-typed-lowering.cc',
'../test/cctest/compiler/test-jump-threading.cc',
'../test/cctest/compiler/test-linkage.cc',
'../test/cctest/compiler/test-loop-analysis.cc',
'../test/cctest/compiler/test-machine-operator-reducer.cc',
'../test/cctest/compiler/test-multiple-return.cc',
'../test/cctest/compiler/test-node.cc',
'../test/cctest/compiler/test-operator.cc',
'../test/cctest/compiler/test-representation-change.cc',
'../test/cctest/compiler/test-run-bytecode-graph-builder.cc',
'../test/cctest/compiler/test-run-calls-to-external-references.cc',
'../test/cctest/compiler/test-run-deopt.cc',
'../test/cctest/compiler/test-run-intrinsics.cc',
'../test/cctest/compiler/test-run-jsbranches.cc',
'../test/cctest/compiler/test-run-jscalls.cc',
'../test/cctest/compiler/test-run-jsexceptions.cc',
'../test/cctest/compiler/test-run-jsobjects.cc',
'../test/cctest/compiler/test-run-jsops.cc',
'../test/cctest/compiler/test-run-load-store.cc',
'../test/cctest/compiler/test-run-machops.cc',
'../test/cctest/compiler/test-run-native-calls.cc',
'../test/cctest/compiler/test-run-retpoline.cc',
'../test/cctest/compiler/test-run-stackcheck.cc',
'../test/cctest/compiler/test-run-stubs.cc',
'../test/cctest/compiler/test-run-tail-calls.cc',
'../test/cctest/compiler/test-run-variables.cc',
'../test/cctest/compiler/test-run-wasm-machops.cc',
'../test/cctest/compiler/value-helper.cc',
'../test/cctest/compiler/value-helper.h',
'../test/cctest/cctest.cc',
'../test/cctest/cctest.h',
'../test/cctest/expression-type-collector-macros.h',
'../test/cctest/gay-fixed.cc',
'../test/cctest/gay-fixed.h',
'../test/cctest/gay-precision.cc',
'../test/cctest/gay-precision.h',
'../test/cctest/gay-shortest.cc',
'../test/cctest/gay-shortest.h',
'../test/cctest/heap/heap-tester.h',
'../test/cctest/heap/heap-utils.cc',
'../test/cctest/heap/heap-utils.h',
'../test/cctest/heap/test-alloc.cc',
'../test/cctest/heap/test-array-buffer-tracker.cc',
'../test/cctest/heap/test-compaction.cc',
'../test/cctest/heap/test-concurrent-marking.cc',
'../test/cctest/heap/test-embedder-tracing.cc',
'../test/cctest/heap/test-heap.cc',
'../test/cctest/heap/test-incremental-marking.cc',
'../test/cctest/heap/test-invalidated-slots.cc',
'../test/cctest/heap/test-lab.cc',
'../test/cctest/heap/test-mark-compact.cc',
'../test/cctest/heap/test-page-promotion.cc',
'../test/cctest/heap/test-spaces.cc',
'../test/cctest/interpreter/interpreter-tester.cc',
'../test/cctest/interpreter/interpreter-tester.h',
'../test/cctest/interpreter/source-position-matcher.cc',
'../test/cctest/interpreter/source-position-matcher.h',
'../test/cctest/interpreter/test-bytecode-generator.cc',
'../test/cctest/interpreter/test-interpreter.cc',
'../test/cctest/interpreter/test-interpreter-intrinsics.cc',
'../test/cctest/interpreter/test-source-positions.cc',
'../test/cctest/interpreter/bytecode-expectations-printer.cc',
'../test/cctest/interpreter/bytecode-expectations-printer.h',
'../test/cctest/libplatform/test-tracing.cc',
'../test/cctest/libsampler/test-sampler.cc',
'../test/cctest/parsing/test-parse-decision.cc',
'../test/cctest/parsing/test-preparser.cc',
'../test/cctest/parsing/test-scanner-streams.cc',
'../test/cctest/parsing/test-scanner.cc',
'../test/cctest/print-extension.cc',
'../test/cctest/print-extension.h',
'../test/cctest/profiler-extension.cc',
'../test/cctest/profiler-extension.h',
'../test/cctest/scope-test-helper.h',
'../test/cctest/setup-isolate-for-tests.cc',
'../test/cctest/setup-isolate-for-tests.h',
'../test/cctest/test-access-checks.cc',
'../test/cctest/test-accessor-assembler.cc',
'../test/cctest/test-accessors.cc',
'../test/cctest/test-allocation.cc',
'../test/cctest/test-api.cc',
'../test/cctest/test-api.h',
'../test/cctest/test-api-accessors.cc',
'../test/cctest/test-api-interceptors.cc',
'../test/cctest/test-array-list.cc',
'../test/cctest/test-atomicops.cc',
'../test/cctest/test-bignum.cc',
'../test/cctest/test-bignum-dtoa.cc',
'../test/cctest/test-bit-vector.cc',
'../test/cctest/test-circular-queue.cc',
'../test/cctest/test-code-layout.cc',
'../test/cctest/test-code-stub-assembler.cc',
'../test/cctest/test-compiler.cc',
'../test/cctest/test-constantpool.cc',
'../test/cctest/test-conversions.cc',
'../test/cctest/test-cpu-profiler.cc',
'../test/cctest/test-date.cc',
'../test/cctest/test-debug.cc',
'../test/cctest/test-decls.cc',
'../test/cctest/test-deoptimization.cc',
'../test/cctest/test-dictionary.cc',
'../test/cctest/test-diy-fp.cc',
'../test/cctest/test-double.cc',
'../test/cctest/test-dtoa.cc',
'../test/cctest/test-elements-kind.cc',
'../test/cctest/test-fast-dtoa.cc',
'../test/cctest/test-feedback-vector.cc',
'../test/cctest/test-feedback-vector.h',
'../test/cctest/test-field-type-tracking.cc',
'../test/cctest/test-fixed-dtoa.cc',
'../test/cctest/test-flags.cc',
'../test/cctest/test-func-name-inference.cc',
'../test/cctest/test-global-handles.cc',
'../test/cctest/test-global-object.cc',
'../test/cctest/test-hashcode.cc',
'../test/cctest/test-hashmap.cc',
'../test/cctest/test-heap-profiler.cc',
'../test/cctest/test-identity-map.cc',
'../test/cctest/test-intl.cc',
'../test/cctest/test-inobject-slack-tracking.cc',
'../test/cctest/test-isolate-independent-builtins.cc',
'../test/cctest/test-liveedit.cc',
'../test/cctest/test-lockers.cc',
'../test/cctest/test-log.cc',
'../test/cctest/test-managed.cc',
'../test/cctest/test-mementos.cc',
'../test/cctest/test-modules.cc',
'../test/cctest/test-object.cc',
'../test/cctest/test-orderedhashtable.cc',
'../test/cctest/test-parsing.cc',
'../test/cctest/test-platform.cc',
'../test/cctest/test-profile-generator.cc',
'../test/cctest/test-random-number-generator.cc',
'../test/cctest/test-regexp.cc',
'../test/cctest/test-representation.cc',
'../test/cctest/test-sampler-api.cc',
'../test/cctest/test-serialize.cc',
'../test/cctest/test-strings.cc',
'../test/cctest/test-symbols.cc',
'../test/cctest/test-strtod.cc',
'../test/cctest/test-thread-termination.cc',
'../test/cctest/test-threads.cc',
'../test/cctest/test-trace-event.cc',
'../test/cctest/test-traced-value.cc',
'../test/cctest/test-transitions.cc',
'../test/cctest/test-transitions.h',
'../test/cctest/test-typedarrays.cc',
'../test/cctest/test-types.cc',
'../test/cctest/test-unbound-queue.cc',
'../test/cctest/test-unboxed-doubles.cc',
'../test/cctest/test-unscopables-hidden-prototype.cc',
'../test/cctest/test-usecounters.cc',
'../test/cctest/test-utils.cc',
'../test/cctest/test-version.cc',
'../test/cctest/test-weakmaps.cc',
'../test/cctest/test-weaksets.cc',
'../test/cctest/trace-extension.cc',
'../test/cctest/trace-extension.h',
'../test/cctest/types-fuzz.h',
'../test/cctest/unicode-helpers.h',
'../test/cctest/wasm/test-c-wasm-entry.cc',
'../test/cctest/wasm/test-streaming-compilation.cc',
'../test/cctest/wasm/test-run-wasm.cc',
'../test/cctest/wasm/test-run-wasm-64.cc',
'../test/cctest/wasm/test-run-wasm-asmjs.cc',
'../test/cctest/wasm/test-run-wasm-atomics.cc',
'../test/cctest/wasm/test-run-wasm-interpreter.cc',
'../test/cctest/wasm/test-run-wasm-js.cc',
'../test/cctest/wasm/test-run-wasm-module.cc',
'../test/cctest/wasm/test-run-wasm-relocation.cc',
'../test/cctest/wasm/test-run-wasm-sign-extension.cc',
'../test/cctest/wasm/test-run-wasm-simd.cc',
'../test/cctest/wasm/test-wasm-breakpoints.cc',
"../test/cctest/wasm/test-wasm-codegen.cc",
'../test/cctest/wasm/test-wasm-interpreter-entry.cc',
'../test/cctest/wasm/test-wasm-stack.cc',
'../test/cctest/wasm/test-wasm-trap-position.cc',
'../test/cctest/wasm/wasm-run-utils.cc',
'../test/cctest/wasm/wasm-run-utils.h',
],
'cctest_sources_ia32': [
'../test/cctest/test-assembler-ia32.cc',
'../test/cctest/test-code-stubs.cc',
'../test/cctest/test-code-stubs.h',
'../test/cctest/test-code-stubs-ia32.cc',
'../test/cctest/test-disasm-ia32.cc',
'../test/cctest/test-log-stack-tracer.cc',
'../test/cctest/test-run-wasm-relocation-ia32.cc',
],
'cctest_sources_x64': [
'../test/cctest/test-assembler-x64.cc',
'../test/cctest/test-code-stubs.cc',
'../test/cctest/test-code-stubs.h',
'../test/cctest/test-code-stubs-x64.cc',
'../test/cctest/test-disasm-x64.cc',
'../test/cctest/test-macro-assembler-x64.cc',
'../test/cctest/test-log-stack-tracer.cc',
'../test/cctest/test-run-wasm-relocation-x64.cc',
],
'cctest_sources_arm': [
'../test/cctest/assembler-helper-arm.cc',
'../test/cctest/assembler-helper-arm.h',
'../test/cctest/test-assembler-arm.cc',
'../test/cctest/test-code-stubs.cc',
'../test/cctest/test-code-stubs.h',
'../test/cctest/test-code-stubs-arm.cc',
'../test/cctest/test-disasm-arm.cc',
'../test/cctest/test-macro-assembler-arm.cc',
'../test/cctest/test-run-wasm-relocation-arm.cc',
'../test/cctest/test-sync-primitives-arm.cc',
],
'cctest_sources_arm64': [
'../test/cctest/test-utils-arm64.cc',
'../test/cctest/test-utils-arm64.h',
'../test/cctest/test-assembler-arm64.cc',
'../test/cctest/test-code-stubs.cc',
'../test/cctest/test-code-stubs.h',
'../test/cctest/test-code-stubs-arm64.cc',
'../test/cctest/test-disasm-arm64.cc',
'../test/cctest/test-fuzz-arm64.cc',
'../test/cctest/test-javascript-arm64.cc',
'../test/cctest/test-js-arm64-variables.cc',
'../test/cctest/test-run-wasm-relocation-arm64.cc',
'../test/cctest/test-sync-primitives-arm64.cc',
],
'cctest_sources_s390': [
'../test/cctest/test-assembler-s390.cc',
'../test/cctest/test-code-stubs.cc',
'../test/cctest/test-code-stubs.h',
'../test/cctest/test-disasm-s390.cc',
],
'cctest_sources_ppc': [
'../test/cctest/test-assembler-ppc.cc',
'../test/cctest/test-code-stubs.cc',
'../test/cctest/test-code-stubs.h',
'../test/cctest/test-disasm-ppc.cc',
],
'cctest_sources_mips': [
'../test/cctest/test-assembler-mips.cc',
'../test/cctest/test-code-stubs.cc',
'../test/cctest/test-code-stubs.h',
'../test/cctest/test-code-stubs-mips.cc',
'../test/cctest/test-disasm-mips.cc',
'../test/cctest/test-macro-assembler-mips.cc',
],
'cctest_sources_mipsel': [
'../test/cctest/test-assembler-mips.cc',
'../test/cctest/test-code-stubs.cc',
'../test/cctest/test-code-stubs.h',
'../test/cctest/test-code-stubs-mips.cc',
'../test/cctest/test-disasm-mips.cc',
'../test/cctest/test-macro-assembler-mips.cc',
],
'cctest_sources_mips64': [
'../test/cctest/test-assembler-mips64.cc',
'../test/cctest/test-code-stubs.cc',
'../test/cctest/test-code-stubs.h',
'../test/cctest/test-code-stubs-mips64.cc',
'../test/cctest/test-disasm-mips64.cc',
'../test/cctest/test-macro-assembler-mips64.cc',
],
'cctest_sources_mips64el': [
'../test/cctest/test-assembler-mips64.cc',
'../test/cctest/test-code-stubs.cc',
'../test/cctest/test-code-stubs.h',
'../test/cctest/test-code-stubs-mips64.cc',
'../test/cctest/test-disasm-mips64.cc',
'../test/cctest/test-macro-assembler-mips64.cc',
],
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'cctest',
'type': 'executable',
'dependencies': [
'resources',
'v8.gyp:v8_libbase',
'v8.gyp:v8_libplatform',
],
'include_dirs': [
'..',
],
'sources': [
'../test/common/wasm/flag-utils.h',
'../test/common/wasm/test-signatures.h',
'../test/common/wasm/wasm-macro-gen.h',
'../test/common/wasm/wasm-module-runner.cc',
'../test/common/wasm/wasm-module-runner.h',
'<@(cctest_sources)',
'<(generated_file)',
],
'conditions': [
['v8_target_arch=="ia32"', {
'sources': [
'<@(cctest_sources_ia32)',
],
}],
['v8_target_arch=="x64"', {
'sources': [
'<@(cctest_sources_x64)',
],
}],
['v8_target_arch=="arm"', {
'sources': [
'<@(cctest_sources_arm)',
],
}],
['v8_target_arch=="arm64"', {
'sources': [
'<@(cctest_sources_arm64)',
],
}],
['v8_target_arch=="s390"', {
'sources': [
'<@(cctest_sources_s390)',
],
}],
['v8_target_arch=="s390x"', {
'sources': [
'<@(cctest_sources_s390)',
],
}],
['v8_target_arch=="ppc"', {
'sources': [
'<@(cctest_sources_ppc)',
],
}],
['v8_target_arch=="ppc64"', {
'sources': [
'<@(cctest_sources_ppc)',
],
}],
['v8_target_arch=="mips"', {
'sources': [
'<@(cctest_sources_mips)',
],
}],
['v8_target_arch=="mipsel"', {
'sources': [
'<@(cctest_sources_mipsel)',
],
}],
['v8_target_arch=="mips64"', {
'sources': [
'<@(cctest_sources_mips64)',
],
}],
['v8_target_arch=="mips64el"', {
'sources': [
'<@(cctest_sources_mips64el)',
],
}],
[ 'OS=="win"', {
'msvs_settings': {
'VCCLCompilerTool': {
# MSVS wants this for gay-{precision,shortest}.cc.
'AdditionalOptions': ['/bigobj'],
},
},
}],
['v8_target_arch=="ppc" or v8_target_arch=="ppc64" \
or v8_target_arch=="arm" or v8_target_arch=="arm64" \
or v8_target_arch=="s390" or v8_target_arch=="s390x" \
or v8_target_arch=="mips" or v8_target_arch=="mips64" \
or v8_target_arch=="mipsel" or v8_target_arch=="mips64el"', {
# disable fmadd/fmsub so that expected results match generated code in
# RunFloat64MulAndFloat64Add1 and friends.
'cflags': ['-ffp-contract=off'],
}],
['OS=="aix"', {
'ldflags': [ '-Wl,-bbigtoc' ],
}],
['component=="shared_library"', {
# cctest can't be built against a shared library, so we need to
# depend on the underlying static target in that case.
'dependencies': ['v8.gyp:v8_maybe_snapshot'],
'defines': [ 'BUILDING_V8_SHARED', ]
}, {
'dependencies': ['v8.gyp:v8'],
}],
['v8_use_snapshot=="true"', {
'dependencies': ['v8.gyp:v8_initializers'],
}],
],
},
{
'target_name': 'resources',
'type': 'none',
'variables': {
'file_list': [
'../tools/splaytree.js',
'../tools/codemap.js',
'../tools/csvparser.js',
'../tools/consarray.js',
'../tools/profile.js',
'../tools/profile_view.js',
'../tools/arguments.js',
'../tools/logreader.js',
'../test/cctest/log-eq-of-logging-and-traversal.js',
],
},
'actions': [
{
'action_name': 'js2c',
'inputs': [
'../tools/js2c.py',
'<@(file_list)',
],
'outputs': [
'<(generated_file)',
],
'action': [
'python',
'../tools/js2c.py',
'<@(_outputs)',
'TEST', # type
'<@(file_list)',
],
}
],
},
{
'target_name': 'generate-bytecode-expectations',
'type': 'executable',
'dependencies': [
'v8.gyp:v8',
'v8.gyp:v8_libbase',
'v8.gyp:v8_libplatform',
],
'include_dirs+': [
'..',
],
'sources': [
'../test/cctest/interpreter/bytecode-expectations-printer.cc',
'../test/cctest/interpreter/bytecode-expectations-printer.h',
'../test/cctest/interpreter/generate-bytecode-expectations.cc',
],
},
],
}
#!/usr/bin/env python
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# CC/CXX wrapper script that excludes certain file patterns from coverage
# instrumentation.
import re
import subprocess
import sys
exclusions = [
'buildtools',
'src/third_party',
'third_party',
'test',
'testing',
]
def remove_if_exists(string_list, item):
if item in string_list:
string_list.remove(item)
args = sys.argv[1:]
text = ' '.join(sys.argv[2:])
for exclusion in exclusions:
if re.search(r'\-o obj/%s[^ ]*\.o' % exclusion, text):
remove_if_exists(args, '-fprofile-arcs')
remove_if_exists(args, '-ftest-coverage')
remove_if_exists(args, '-fsanitize-coverage=func')
remove_if_exists(args, '-fsanitize-coverage=bb')
remove_if_exists(args, '-fsanitize-coverage=edge')
remove_if_exists(args, '-fsanitize-coverage=trace-pc-guard')
remove_if_exists(args, '-fsanitize-coverage=bb,trace-pc-guard')
break
sys.exit(subprocess.check_call(args))
# Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'v8_code': 1,
# Enable support for Intel VTune. Supported on ia32/x64 only
'v8_enable_vtunejit%': 0,
'v8_enable_i18n_support%': 1,
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'd8',
'type': 'executable',
'dependencies': [
'v8.gyp:v8',
'v8.gyp:v8_libbase',
'v8.gyp:v8_libplatform',
],
# Generated source files need this explicitly:
'include_dirs+': [
'..',
'<(DEPTH)',
],
'sources': [
'../src/d8.h',
'../src/d8.cc',
'../src/d8-console.h',
'../src/d8-console.cc',
'<(SHARED_INTERMEDIATE_DIR)/d8-js.cc',
],
'conditions': [
[ 'want_separate_host_toolset==1', {
'toolsets': [ 'target', ],
'dependencies': [
'd8_js2c#host',
],
}, {
'dependencies': [
'd8_js2c',
],
}],
['(OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="netbsd" \
or OS=="openbsd" or OS=="solaris" or OS=="android" \
or OS=="qnx" or OS=="aix")', {
'sources': [ '../src/d8-posix.cc', ]
}],
[ 'OS=="win"', {
'sources': [ '../src/d8-windows.cc', ]
}],
[ 'component!="shared_library"', {
'conditions': [
[ 'v8_postmortem_support=="true"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-Wl,-force_load,<(PRODUCT_DIR)/libv8_base.a'
],
},
}],
],
}],
['v8_enable_vtunejit==1', {
'dependencies': [
'v8vtune.gyp:v8_vtune',
],
}],
['v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
],
}],
['OS=="win" and v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icudata',
],
}],
],
},
{
'target_name': 'd8_js2c',
'type': 'none',
'variables': {
'js_files': [
'../src/d8.js',
'../src/js/macros.py',
],
},
'conditions': [
[ 'want_separate_host_toolset==1', {
'toolsets': ['host'],
}, {
'toolsets': ['target'],
}]
],
'actions': [
{
'action_name': 'd8_js2c',
'inputs': [
'../tools/js2c.py',
'<@(js_files)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/d8-js.cc',
],
'action': [
'python',
'../tools/js2c.py',
'<@(_outputs)',
'D8',
'<@(js_files)'
],
},
],
},
],
}
# Copyright 2013 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Compile time controlled V8 features.
{
'variables': {
'variables': {
'v8_target_arch%': '<(target_arch)',
},
# Allows the embedder to add a custom suffix to the version string.
'v8_embedder_string%': '',
'v8_enable_disassembler%': 0,
'v8_promise_internal_field_count%': 0,
'v8_enable_gdbjit%': 0,
'v8_enable_verify_csa%': 0,
'v8_object_print%': 0,
'v8_enable_verify_heap%': 0,
'v8_trace_maps%': 0,
# Enable the snapshot feature, for fast context creation.
# http://v8project.blogspot.com/2015/09/custom-startup-snapshots.html
'v8_use_snapshot%': 'true',
'v8_enable_verify_predictable%': 0,
# With post mortem support enabled, metadata is embedded into libv8 that
# describes various parameters of the VM for use by debuggers. See
# tools/gen-postmortem-metadata.py for details.
'v8_postmortem_support%': 'false',
# Interpreted regexp engine exists as platform-independent alternative
# based where the regular expression is compiled to a bytecode.
'v8_interpreted_regexp%': 0,
# Enable ECMAScript Internationalization API. Enabling this feature will
# add a dependency on the ICU library.
'v8_enable_i18n_support%': 1,
# Enable compiler warnings when using V8_DEPRECATED apis.
'v8_deprecation_warnings%': 0,
# Enable compiler warnings when using V8_DEPRECATE_SOON apis.
'v8_imminent_deprecation_warnings%': 0,
# Set to 1 to enable DCHECKs in release builds.
'dcheck_always_on%': 0,
# Enable/disable JavaScript API accessors.
'v8_js_accessors%': 0,
# Temporary flag to allow embedders to update their microtasks scopes.
'v8_check_microtasks_scopes_consistency%': 'false',
# Enable concurrent marking.
'v8_enable_concurrent_marking%': 1,
# Enables various testing features.
'v8_enable_test_features%': 0,
# Controls the threshold for on-heap/off-heap Typed Arrays.
'v8_typed_array_max_size_in_heap%': 64,
},
'target_defaults': {
'conditions': [
['v8_embedder_string!=""', {
'defines': ['V8_EMBEDDER_STRING="<(v8_embedder_string)"',],
}],
['v8_enable_disassembler==1', {
'defines': ['ENABLE_DISASSEMBLER',],
}],
['v8_promise_internal_field_count!=0', {
'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT','v8_promise_internal_field_count'],
}],
['v8_enable_gdbjit==1', {
'defines': ['ENABLE_GDB_JIT_INTERFACE',],
}],
['v8_enable_verify_csa==1', {
'defines': ['ENABLE_VERIFY_CSA',],
}],
['v8_object_print==1', {
'defines': ['OBJECT_PRINT',],
}],
['v8_enable_verify_heap==1', {
'defines': ['VERIFY_HEAP',],
}],
['v8_trace_maps==1', {
'defines': ['V8_TRACE_MAPS',],
}],
['v8_enable_test_features==1', {
'defines': ['V8_ENABLE_ALLOCATION_TIMEOUT', 'V8_ENABLE_FORCE_SLOW_PATH'],
}],
['v8_enable_verify_predictable==1', {
'defines': ['VERIFY_PREDICTABLE',],
}],
['v8_interpreted_regexp==1', {
'defines': ['V8_INTERPRETED_REGEXP',],
}],
['v8_deprecation_warnings==1', {
'defines': ['V8_DEPRECATION_WARNINGS',],
}],
['v8_imminent_deprecation_warnings==1', {
'defines': ['V8_IMMINENT_DEPRECATION_WARNINGS',],
}],
['v8_enable_i18n_support==1', {
'defines': ['V8_INTL_SUPPORT',],
}],
['v8_use_snapshot=="true" and v8_use_external_startup_data==1', {
'defines': ['V8_USE_EXTERNAL_STARTUP_DATA',],
}],
['dcheck_always_on!=0', {
'defines': ['DEBUG',],
}],
['v8_check_microtasks_scopes_consistency=="true"', {
'defines': ['V8_CHECK_MICROTASKS_SCOPES_CONSISTENCY',],
}],
['v8_enable_concurrent_marking==1', {
'defines': ['V8_CONCURRENT_MARKING',],
}],
], # conditions
'configurations': {
'DebugBaseCommon': {
'abstract': 1,
'variables': {
'v8_enable_handle_zapping%': 1,
},
'conditions': [
['v8_enable_handle_zapping==1', {
'defines': ['ENABLE_HANDLE_ZAPPING',],
}],
],
}, # Debug
'Release': {
'variables': {
'v8_enable_handle_zapping%': 1,
},
'conditions': [
['v8_enable_handle_zapping==1', {
'defines': ['ENABLE_HANDLE_ZAPPING',],
}],
], # conditions
}, # Release
}, # configurations
'defines': [
'V8_GYP_BUILD',
'V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=<(v8_typed_array_max_size_in_heap)',
], # defines
}, # target_defaults
}
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'v8_code': 1,
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'v8_simple_json_fuzzer',
'type': 'executable',
'dependencies': [
'json_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'json_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/json.cc',
],
},
{
'target_name': 'v8_simple_parser_fuzzer',
'type': 'executable',
'dependencies': [
'parser_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'parser_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/parser.cc',
],
},
{
'target_name': 'v8_simple_regexp_builtins_fuzzer',
'type': 'executable',
'dependencies': [
'regexp_builtins_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'regexp_builtins_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/regexp-builtins.cc',
'../test/fuzzer/regexp_builtins/mjsunit.js.h',
],
},
{
'target_name': 'v8_simple_regexp_fuzzer',
'type': 'executable',
'dependencies': [
'regexp_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'regexp_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/regexp.cc',
],
},
{
'target_name': 'v8_simple_multi_return_fuzzer',
'type': 'executable',
'dependencies': [
'multi_return_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'multi_return_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/cctest/compiler/c-signature.h',
'../test/cctest/compiler/call-helper.h',
'../test/cctest/compiler/raw-machine-assembler-tester.h',
'../test/fuzzer/multi-return.cc',
],
},
{
'target_name': 'v8_simple_wasm_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'wasm_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/wasm.cc',
'../test/common/wasm/wasm-module-runner.cc',
'../test/common/wasm/wasm-module-runner.h',
'../test/fuzzer/wasm-fuzzer-common.cc',
'../test/fuzzer/wasm-fuzzer-common.h',
],
},
{
'target_name': 'v8_simple_wasm_async_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_async_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'wasm_async_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/wasm-async.cc',
'../test/common/wasm/wasm-module-runner.cc',
'../test/common/wasm/wasm-module-runner.h',
'../test/fuzzer/wasm-fuzzer-common.cc',
'../test/fuzzer/wasm-fuzzer-common.h',
],
},
{
'target_name': 'v8_simple_wasm_code_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_code_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'wasm_code_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/wasm-code.cc',
'../test/common/wasm/test-signatures.h',
'../test/common/wasm/wasm-module-runner.cc',
'../test/common/wasm/wasm-module-runner.h',
'../test/fuzzer/wasm-fuzzer-common.cc',
'../test/fuzzer/wasm-fuzzer-common.h',
],
},
{
'target_name': 'v8_simple_wasm_compile_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_compile_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'wasm_compile_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/wasm-compile.cc',
'../test/common/wasm/test-signatures.h',
'../test/common/wasm/wasm-module-runner.cc',
'../test/common/wasm/wasm-module-runner.h',
'../test/fuzzer/wasm-fuzzer-common.cc',
'../test/fuzzer/wasm-fuzzer-common.h',
],
},
{
'target_name': 'v8_simple_wasm_data_section_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_data_section_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'wasm_data_section_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/wasm-data-section.cc',
'../test/common/wasm/wasm-module-runner.cc',
'../test/common/wasm/wasm-module-runner.h',
'../test/fuzzer/wasm-fuzzer-common.cc',
'../test/fuzzer/wasm-fuzzer-common.h',
],
},
{
'target_name': 'v8_simple_wasm_function_sigs_section_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_function_sigs_section_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'wasm_function_sigs_section_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/wasm-function-sigs-section.cc',
'../test/common/wasm/wasm-module-runner.cc',
'../test/common/wasm/wasm-module-runner.h',
'../test/fuzzer/wasm-fuzzer-common.cc',
'../test/fuzzer/wasm-fuzzer-common.h',
],
},
{
'target_name': 'v8_simple_wasm_globals_section_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_globals_section_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'wasm_globals_section_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/wasm-globals-section.cc',
'../test/common/wasm/wasm-module-runner.cc',
'../test/common/wasm/wasm-module-runner.h',
'../test/fuzzer/wasm-fuzzer-common.cc',
'../test/fuzzer/wasm-fuzzer-common.h',
],
},
{
'target_name': 'v8_simple_wasm_imports_section_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_imports_section_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'wasm_imports_section_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/wasm-imports-section.cc',
'../test/common/wasm/wasm-module-runner.cc',
'../test/common/wasm/wasm-module-runner.h',
'../test/fuzzer/wasm-fuzzer-common.cc',
'../test/fuzzer/wasm-fuzzer-common.h',
],
},
{
'target_name': 'v8_simple_wasm_memory_section_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_memory_section_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'wasm_memory_section_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/wasm-memory-section.cc',
'../test/common/wasm/wasm-module-runner.cc',
'../test/common/wasm/wasm-module-runner.h',
'../test/fuzzer/wasm-fuzzer-common.cc',
'../test/fuzzer/wasm-fuzzer-common.h',
],
},
{
'target_name': 'v8_simple_wasm_names_section_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_names_section_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'wasm_names_section_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/wasm-names-section.cc',
'../test/common/wasm/wasm-module-runner.cc',
'../test/common/wasm/wasm-module-runner.h',
'../test/fuzzer/wasm-fuzzer-common.cc',
'../test/fuzzer/wasm-fuzzer-common.h',
],
},
{
'target_name': 'v8_simple_wasm_types_section_fuzzer',
'type': 'executable',
'dependencies': [
'wasm_types_section_fuzzer_lib',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer.cc',
],
},
{
'target_name': 'wasm_types_section_fuzzer_lib',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8_libplatform',
'fuzzer_support',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/wasm-types-section.cc',
'../test/common/wasm/wasm-module-runner.cc',
'../test/common/wasm/wasm-module-runner.h',
'../test/fuzzer/wasm-fuzzer-common.cc',
'../test/fuzzer/wasm-fuzzer-common.h',
],
},
{
'target_name': 'fuzzer_support',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8',
'v8.gyp:v8_libbase',
'v8.gyp:v8_libplatform',
],
'include_dirs': [
'..',
],
'sources': [
'../test/fuzzer/fuzzer-support.cc',
'../test/fuzzer/fuzzer-support.h',
],
'conditions': [
['v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
],
}],
],
},
],
}
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'gmock',
'type': 'static_library',
'dependencies': [
'gtest.gyp:gtest',
],
'sources': [
# Sources based on files in r173 of gmock.
'../testing/gmock/include/gmock/gmock-actions.h',
'../testing/gmock/include/gmock/gmock-cardinalities.h',
'../testing/gmock/include/gmock/gmock-generated-actions.h',
'../testing/gmock/include/gmock/gmock-generated-function-mockers.h',
'../testing/gmock/include/gmock/gmock-generated-matchers.h',
'../testing/gmock/include/gmock/gmock-generated-nice-strict.h',
'../testing/gmock/include/gmock/gmock-matchers.h',
'../testing/gmock/include/gmock/gmock-spec-builders.h',
'../testing/gmock/include/gmock/gmock.h',
'../testing/gmock/include/gmock/internal/gmock-generated-internal-utils.h',
'../testing/gmock/include/gmock/internal/gmock-internal-utils.h',
'../testing/gmock/include/gmock/internal/gmock-port.h',
'../testing/gmock/src/gmock-all.cc',
'../testing/gmock/src/gmock-cardinalities.cc',
'../testing/gmock/src/gmock-internal-utils.cc',
'../testing/gmock/src/gmock-matchers.cc',
'../testing/gmock/src/gmock-spec-builders.cc',
'../testing/gmock/src/gmock.cc',
'../testing/gmock-support.h', # gMock helpers
'../testing/gmock_custom/gmock/internal/custom/gmock-port.h',
],
'sources!': [
'../testing/gmock/src/gmock-all.cc', # Not needed by our build.
],
'include_dirs': [
'../testing/gmock_custom',
'../testing/gmock',
'../testing/gmock/include',
],
'all_dependent_settings': {
'include_dirs': [
'../testing/gmock_custom',
'../testing/gmock/include', # So that gmock headers can find themselves.
],
},
'export_dependent_settings': [
'gtest.gyp:gtest',
],
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host', 'target'],
}, {
'toolsets': ['target'],
}],
],
},
{
'target_name': 'gmock_main',
'type': 'static_library',
'dependencies': [
'gmock',
],
'sources': [
'../testing/gmock/src/gmock_main.cc',
],
},
],
}
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'gtest',
'toolsets': ['host', 'target'],
'type': 'static_library',
'sources': [
'../testing/gtest/include/gtest/gtest-death-test.h',
'../testing/gtest/include/gtest/gtest-message.h',
'../testing/gtest/include/gtest/gtest-param-test.h',
'../testing/gtest/include/gtest/gtest-printers.h',
'../testing/gtest/include/gtest/gtest-spi.h',
'../testing/gtest/include/gtest/gtest-test-part.h',
'../testing/gtest/include/gtest/gtest-typed-test.h',
'../testing/gtest/include/gtest/gtest.h',
'../testing/gtest/include/gtest/gtest_pred_impl.h',
'../testing/gtest/include/gtest/internal/gtest-death-test-internal.h',
'../testing/gtest/include/gtest/internal/gtest-filepath.h',
'../testing/gtest/include/gtest/internal/gtest-internal.h',
'../testing/gtest/include/gtest/internal/gtest-linked_ptr.h',
'../testing/gtest/include/gtest/internal/gtest-param-util-generated.h',
'../testing/gtest/include/gtest/internal/gtest-param-util.h',
'../testing/gtest/include/gtest/internal/gtest-port.h',
'../testing/gtest/include/gtest/internal/gtest-string.h',
'../testing/gtest/include/gtest/internal/gtest-tuple.h',
'../testing/gtest/include/gtest/internal/gtest-type-util.h',
'../testing/gtest/src/gtest-all.cc',
'../testing/gtest/src/gtest-death-test.cc',
'../testing/gtest/src/gtest-filepath.cc',
'../testing/gtest/src/gtest-internal-inl.h',
'../testing/gtest/src/gtest-port.cc',
'../testing/gtest/src/gtest-printers.cc',
'../testing/gtest/src/gtest-test-part.cc',
'../testing/gtest/src/gtest-typed-test.cc',
'../testing/gtest/src/gtest.cc',
'../testing/gtest-support.h',
],
'sources!': [
'../testing/gtest/src/gtest-all.cc', # Not needed by our build.
],
'include_dirs': [
'../testing/gtest',
'../testing/gtest/include',
],
'dependencies': [
'gtest_prod',
],
'defines': [
# In order to allow regex matches in gtest to be shared between Windows
# and other systems, we tell gtest to always use it's internal engine.
'GTEST_HAS_POSIX_RE=0',
'GTEST_LANG_CXX11=1',
],
'all_dependent_settings': {
'defines': [
'GTEST_HAS_POSIX_RE=0',
'GTEST_LANG_CXX11=1',
],
},
'conditions': [
['OS=="android"', {
'defines': [
'GTEST_HAS_CLONE=0',
],
'direct_dependent_settings': {
'defines': [
'GTEST_HAS_CLONE=0',
],
},
}],
],
'direct_dependent_settings': {
'defines': [
'UNIT_TEST',
],
'include_dirs': [
'../testing/gtest/include', # So that gtest headers can find themselves.
],
'target_conditions': [
['_type=="executable"', {
'test': 1,
'conditions': [
['OS=="mac"', {
'run_as': {
'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'],
},
}],
['OS=="win"', {
'run_as': {
'action????': ['$(TargetPath)', '--gtest_print_time'],
},
}],
],
}],
],
'msvs_disabled_warnings': [4800],
},
},
{
'target_name': 'gtest_main',
'type': 'static_library',
'dependencies': [
'gtest',
],
'sources': [
'../testing/gtest/src/gtest_main.cc',
],
},
{
'target_name': 'gtest_prod',
'toolsets': ['host', 'target'],
'type': 'none',
'sources': [
'../testing/gtest/include/gtest/gtest_prod.h',
],
},
],
}
# Copyright 2015 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Sets up various automatic gyp environment variables. These are used by
gyp_v8 and landmines.py which run at different stages of runhooks. To
make sure settings are consistent between them, all setup should happen here.
"""
import os
import sys
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
V8_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir))
def apply_gyp_environment(file_path=None):
"""
Reads in a *.gyp_env file and applies the valid keys to os.environ.
"""
if not file_path or not os.path.exists(file_path):
return
file_contents = open(file_path).read()
try:
file_data = eval(file_contents, {'__builtins__': None}, None)
except SyntaxError, e:
e.filename = os.path.abspath(file_path)
raise
supported_vars = ( 'V8_GYP_FILE',
'V8_GYP_SYNTAX_CHECK',
'GYP_DEFINES',
'GYP_GENERATORS',
'GYP_GENERATOR_FLAGS',
'GYP_GENERATOR_OUTPUT', )
for var in supported_vars:
val = file_data.get(var)
if val:
if var in os.environ:
print 'INFO: Environment value for "%s" overrides value in %s.' % (
var, os.path.abspath(file_path)
)
else:
os.environ[var] = val
def set_environment():
"""Sets defaults for GYP_* variables."""
if 'SKIP_V8_GYP_ENV' not in os.environ:
# Update the environment based on v8.gyp_env
gyp_env_path = os.path.join(os.path.dirname(V8_ROOT), 'v8.gyp_env')
apply_gyp_environment(gyp_env_path)
if not os.environ.get('GYP_GENERATORS'):
# Default to ninja on all platforms.
os.environ['GYP_GENERATORS'] = 'ninja'
#!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# This script is wrapper for V8 that adds some support for how GYP
# is invoked by V8 beyond what can be done in the gclient hooks.
import argparse
import glob
import gyp_environment
import os
import platform
import shlex
import subprocess
import sys
script_dir = os.path.dirname(os.path.realpath(__file__))
v8_root = os.path.abspath(os.path.join(script_dir, os.pardir))
sys.path.insert(0, os.path.join(v8_root, 'tools', 'gyp', 'pylib'))
import gyp
# Add paths so that pymod_do_main(...) can import files.
sys.path.insert(
1, os.path.abspath(os.path.join(v8_root, 'tools', 'generate_shim_headers')))
sys.path.append(
os.path.abspath(os.path.join(v8_root, 'third_party', 'binutils')))
def GetOutputDirectory():
"""Returns the output directory that GYP will use."""
# Handle command line generator flags.
parser = argparse.ArgumentParser()
parser.add_argument('-G', dest='genflags', default=[], action='append')
genflags = parser.parse_known_args()[0].genflags
# Handle generator flags from the environment.
genflags += shlex.split(os.environ.get('GYP_GENERATOR_FLAGS', ''))
needle = 'output_dir='
for item in genflags:
if item.startswith(needle):
return item[len(needle):]
return 'out'
def additional_include_files(args=[]):
"""
Returns a list of additional (.gypi) files to include, without
duplicating ones that are already specified on the command line.
"""
# Determine the include files specified on the command line.
# This doesn't cover all the different option formats you can use,
# but it's mainly intended to avoid duplicating flags on the automatic
# makefile regeneration which only uses this format.
specified_includes = set()
for arg in args:
if arg.startswith('-I') and len(arg) > 2:
specified_includes.add(os.path.realpath(arg[2:]))
result = []
def AddInclude(path):
if os.path.realpath(path) not in specified_includes:
result.append(path)
# Always include standalone.gypi
AddInclude(os.path.join(v8_root, 'gypfiles', 'standalone.gypi'))
# Optionally add supplemental .gypi files if present.
supplements = glob.glob(os.path.join(v8_root, '*', 'supplement.gypi'))
for supplement in supplements:
AddInclude(supplement)
return result
def run_gyp(args):
if gyp.main(args) != 0:
print 'Error running GYP'
sys.exit(rc)
if __name__ == '__main__':
args = sys.argv[1:]
gyp_chromium_no_action = os.environ.get('GYP_CHROMIUM_NO_ACTION')
if gyp_chromium_no_action == '1':
print 'Skipping gyp_v8 due to GYP_CHROMIUM_NO_ACTION env var.'
sys.exit(0)
running_as_hook = '--running-as-hook'
if running_as_hook in args and gyp_chromium_no_action != '0':
print 'GYP is now disabled by default in runhooks.\n'
print 'If you really want to run this, either run '
print '`python gypfiles/gyp_v8` explicitly by hand '
print 'or set the environment variable GYP_CHROMIUM_NO_ACTION=0.'
sys.exit(0)
if running_as_hook in args:
args.remove(running_as_hook)
gyp_environment.set_environment()
# This could give false positives since it doesn't actually do real option
# parsing. Oh well.
gyp_file_specified = False
for arg in args:
if arg.endswith('.gyp'):
gyp_file_specified = True
break
# If we didn't get a file, check an env var, and then fall back to
# assuming 'all.gyp' from the same directory as the script.
if not gyp_file_specified:
gyp_file = os.environ.get('V8_GYP_FILE')
if gyp_file:
# Note that V8_GYP_FILE values can't have backslashes as
# path separators even on Windows due to the use of shlex.split().
args.extend(shlex.split(gyp_file))
else:
args.append(os.path.join(script_dir, 'all.gyp'))
args.extend(['-I' + i for i in additional_include_files(args)])
# There shouldn't be a circular dependency relationship between .gyp files
args.append('--no-circular-check')
# Set the GYP DEPTH variable to the root of the V8 project.
args.append('--depth=' + os.path.relpath(v8_root))
# If V8_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check
# to enfore syntax checking.
syntax_check = os.environ.get('V8_GYP_SYNTAX_CHECK')
if syntax_check and int(syntax_check):
args.append('--check')
print 'Updating projects from gyp files...'
sys.stdout.flush()
# Generate for the architectures supported on the given platform.
gyp_args = list(args)
gyp_args.extend(['-D', 'gyp_output_dir=' + GetOutputDirectory()])
gyp_generators = os.environ.get('GYP_GENERATORS', '')
if platform.system() == 'Linux' and gyp_generators != 'ninja':
# Work around for crbug.com/331475.
for f in glob.glob(os.path.join(v8_root, 'out', 'Makefile.*')):
os.unlink(f)
# --generator-output defines where the Makefile goes.
gyp_args.append('--generator-output=out')
# -Goutput_dir defines where the build output goes, relative to the
# Makefile. Set it to . so that the build output doesn't end up in out/out.
gyp_args.append('-Goutput_dir=.')
gyp_defines = os.environ.get('GYP_DEFINES', '')
# Automatically turn on crosscompile support for platforms that need it.
if all(('ninja' in gyp_generators,
'OS=android' in gyp_defines,
'GYP_CROSSCOMPILE' not in os.environ)):
os.environ['GYP_CROSSCOMPILE'] = '1'
run_gyp(gyp_args)
# Copyright 2013 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# This file is (possibly, depending on python version) imported by
# gyp_v8 when GYP_PARALLEL=1 and it creates sub-processes through the
# multiprocessing library.
# Importing in Python 2.6 (fixed in 2.7) on Windows doesn't search for imports
# that don't end in .py (and aren't directories with an __init__.py). This
# wrapper makes "import gyp_v8" work with those old versions and makes it
# possible to execute gyp_v8.py directly on Windows where the extension is
# useful.
import os
path = os.path.abspath(os.path.split(__file__)[0])
execfile(os.path.join(path, 'gyp_v8'))
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'v8_code': 1,
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'inspector-test',
'type': 'executable',
'dependencies': [
'v8.gyp:v8_libplatform',
'v8.gyp:v8_libbase',
'v8.gyp:v8',
],
'include_dirs': [
'..',
],
'sources': [
'../test/inspector/inspector-test.cc',
'../test/inspector/isolate-data.cc',
'../test/inspector/isolate-data.h',
'../test/inspector/task-runner.cc',
'../test/inspector/task-runner.h',
],
'conditions': [
['v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
],
}],
],
},
],
}
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'protocol_path': '../third_party/inspector_protocol',
'inspector_path': '../src/inspector',
},
'includes': [
'inspector.gypi',
'../third_party/inspector_protocol/inspector_protocol.gypi',
],
'targets': [
{ 'target_name': 'inspector_injected_script',
'type': 'none',
'toolsets': ['target'],
'actions': [
{
'action_name': 'convert_js_to_cpp_char_array',
'inputs': [
'<(inspector_path)/build/xxd.py',
'<(inspector_injected_script_source)',
],
'outputs': [
'<(inspector_generated_injected_script)',
],
'action': [
'python',
'<(inspector_path)/build/xxd.py',
'InjectedScriptSource_js',
'<(inspector_path)/injected-script-source.js',
'<@(_outputs)'
],
},
],
# Since this target generates header files, it needs to be a hard dependency.
'hard_dependency': 1,
},
{ 'target_name': 'protocol_compatibility',
'type': 'none',
'toolsets': ['target'],
'actions': [
{
'action_name': 'protocol_compatibility',
'inputs': [
'<(inspector_path)/js_protocol.json',
],
'outputs': [
'<@(SHARED_INTERMEDIATE_DIR)/src/js_protocol.stamp',
],
'action': [
'python',
'<(protocol_path)/CheckProtocolCompatibility.py',
'--stamp', '<@(_outputs)',
'<(inspector_path)/js_protocol.json',
],
'message': 'Generating inspector protocol sources from protocol json definition',
},
]
},
{ 'target_name': 'protocol_generated_sources',
'type': 'none',
'dependencies': [ 'protocol_compatibility' ],
'toolsets': ['target'],
'actions': [
{
'action_name': 'protocol_generated_sources',
'inputs': [
'<(inspector_path)/js_protocol.json',
'<(inspector_path)/inspector_protocol_config.json',
'<@(inspector_protocol_files)',
],
'outputs': [
'<@(inspector_generated_sources)',
],
'action': [
'python',
'<(protocol_path)/CodeGenerator.py',
'--jinja_dir', '../third_party',
'--output_base', '<(SHARED_INTERMEDIATE_DIR)/src/inspector',
'--config', '<(inspector_path)/inspector_protocol_config.json',
],
'message': 'Generating inspector protocol sources from protocol json',
},
]
},
],
}
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'inspector_generated_sources': [
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Forward.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Protocol.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Protocol.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Console.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Console.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Debugger.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Debugger.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/HeapProfiler.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/HeapProfiler.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Profiler.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Profiler.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Runtime.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Runtime.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Schema.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Schema.h',
'<(SHARED_INTERMEDIATE_DIR)/include/inspector/Debugger.h',
'<(SHARED_INTERMEDIATE_DIR)/include/inspector/Runtime.h',
'<(SHARED_INTERMEDIATE_DIR)/include/inspector/Schema.h',
],
'inspector_injected_script_source': '../src/inspector/injected-script-source.js',
'inspector_generated_injected_script': '<(SHARED_INTERMEDIATE_DIR)/src/inspector/injected-script-source.h',
'inspector_all_sources': [
'<@(inspector_generated_sources)',
'<(inspector_generated_injected_script)',
'../include/v8-inspector.h',
'../include/v8-inspector-protocol.h',
'../src/inspector/injected-script.cc',
'../src/inspector/injected-script.h',
'../src/inspector/inspected-context.cc',
'../src/inspector/inspected-context.h',
'../src/inspector/remote-object-id.cc',
'../src/inspector/remote-object-id.h',
'../src/inspector/search-util.cc',
'../src/inspector/search-util.h',
'../src/inspector/string-16.cc',
'../src/inspector/string-16.h',
'../src/inspector/string-util.cc',
'../src/inspector/string-util.h',
'../src/inspector/test-interface.cc',
'../src/inspector/test-interface.h',
'../src/inspector/v8-console.cc',
'../src/inspector/v8-console.h',
'../src/inspector/v8-console-agent-impl.cc',
'../src/inspector/v8-console-agent-impl.h',
'../src/inspector/v8-console-message.cc',
'../src/inspector/v8-console-message.h',
'../src/inspector/v8-debugger.cc',
'../src/inspector/v8-debugger.h',
'../src/inspector/v8-debugger-agent-impl.cc',
'../src/inspector/v8-debugger-agent-impl.h',
'../src/inspector/v8-debugger-script.cc',
'../src/inspector/v8-debugger-script.h',
'../src/inspector/v8-function-call.cc',
'../src/inspector/v8-function-call.h',
'../src/inspector/v8-heap-profiler-agent-impl.cc',
'../src/inspector/v8-heap-profiler-agent-impl.h',
'../src/inspector/v8-injected-script-host.cc',
'../src/inspector/v8-injected-script-host.h',
'../src/inspector/v8-inspector-impl.cc',
'../src/inspector/v8-inspector-impl.h',
'../src/inspector/v8-inspector-session-impl.cc',
'../src/inspector/v8-inspector-session-impl.h',
'../src/inspector/v8-internal-value-type.cc',
'../src/inspector/v8-internal-value-type.h',
'../src/inspector/v8-profiler-agent-impl.cc',
'../src/inspector/v8-profiler-agent-impl.h',
'../src/inspector/v8-regex.cc',
'../src/inspector/v8-regex.h',
'../src/inspector/v8-runtime-agent-impl.cc',
'../src/inspector/v8-runtime-agent-impl.h',
'../src/inspector/v8-schema-agent-impl.cc',
'../src/inspector/v8-schema-agent-impl.h',
'../src/inspector/v8-stack-trace-impl.cc',
'../src/inspector/v8-stack-trace-impl.h',
'../src/inspector/v8-value-utils.cc',
'../src/inspector/v8-value-utils.h',
'../src/inspector/wasm-translation.cc',
'../src/inspector/wasm-translation.h',
]
}
}
# Copyright 2015 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'asan_dynamic_runtime',
'toolsets': ['target', 'host'],
'type': 'none',
'variables': {
# Every target is going to depend on asan_dynamic_runtime, so allow
# this one to depend on itself.
'prune_self_dependency': 1,
# Path is relative to this GYP file.
'asan_rtl_mask_path':
'../../third_party/llvm-build/Release+Asserts/lib/clang/*/lib/darwin',
'asan_osx_dynamic':
'<(asan_rtl_mask_path)/libclang_rt.asan_osx_dynamic.dylib',
},
'copies': [
{
'destination': '<(PRODUCT_DIR)',
'files': [
'<!(/bin/ls <(asan_osx_dynamic))',
],
},
],
},
],
}
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'v8_code': 1,
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'mkgrokdump',
'type': 'executable',
'dependencies': [
'v8.gyp:v8',
'v8.gyp:v8_libbase',
'v8.gyp:v8_libplatform',
],
'include_dirs': [
'..',
],
'sources': [
'../test/mkgrokdump/mkgrokdump.cc',
],
},
],
}
# Copyright 2013 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
'variables': {
'v8_code': 1,
'v8_enable_i18n_support%': 1,
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'parser-shell',
'type': 'executable',
'dependencies': [
'v8.gyp:v8',
'v8.gyp:v8_libbase',
'v8.gyp:v8_libplatform',
],
'conditions': [
['v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
],
}],
],
'include_dirs+': [
'..',
],
'sources': [
'../tools/parser-shell.cc',
'../tools/shell-utils.h',
],
},
],
}
#!/usr/bin/env python
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Legacy test-runner wrapper supporting a product of multiple architectures and
modes.
"""
import argparse
import itertools
from os.path import abspath, dirname, join
import subprocess
import sys
BASE_DIR = dirname(dirname(abspath(__file__)))
RUN_TESTS = join(BASE_DIR, 'tools', 'run-tests.py')
def main():
parser = argparse.ArgumentParser(description='Legacy test-runner wrapper')
parser.add_argument(
'--arch', help='Comma-separated architectures to run tests on')
parser.add_argument(
'--mode', help='Comma-separated modes to run tests on')
parser.add_argument(
'--arch-and-mode',
help='Architecture and mode in the format \'arch.mode\'',
)
args, remaining_args = parser.parse_known_args(sys.argv)
if (args.arch or args.mode) and args.arch_and_mode:
parser.error('The flags --arch-and-mode and --arch/--mode are exclusive.')
arch = (args.arch or 'ia32,x64,arm').split(',')
mode = (args.mode or 'release,debug').split(',')
if args.arch_and_mode:
arch_and_mode = map(
lambda am: am.split('.'),
args.arch_and_mode.split(','))
arch = map(lambda am: am[0], arch_and_mode)
mode = map(lambda am: am[1], arch_and_mode)
ret_code = 0
for a, m in itertools.product(arch, mode):
ret_code |= subprocess.check_call(
[RUN_TESTS] + remaining_args[1:] + ['--arch', a, '--mode', m])
return ret_code
if __name__ == '__main__':
sys.exit(main())
# Copyright 2012 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'v8_code': 1,
'v8_enable_i18n_support%': 1,
'v8_toolset_for_shell%': 'target',
},
'includes': ['toolchain.gypi', 'features.gypi'],
'target_defaults': {
'type': 'executable',
'dependencies': [
'v8.gyp:v8',
'v8.gyp:v8_libbase',
'v8.gyp:v8_libplatform',
],
'include_dirs': [
'..',
],
'conditions': [
['v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
],
}],
['OS=="win" and v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icudata',
],
}],
],
},
'targets': [
{
'target_name': 'v8_shell',
'sources': [
'../samples/shell.cc',
],
'conditions': [
[ 'want_separate_host_toolset==1', {
'toolsets': [ '<(v8_toolset_for_shell)', ],
}],
],
},
{
'target_name': 'hello-world',
'sources': [
'../samples/hello-world.cc',
],
},
{
'target_name': 'process',
'sources': [
'../samples/process.cc',
],
},
],
}
# Copyright 2016 the V8 project authors. All rights reserved.
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file is meant to be included to set clang-specific compiler flags.
# To use this the following variable can be defined:
# clang_warning_flags: list: Compiler flags to pass to clang.
# clang_warning_flags_unset: list: Compiler flags to not pass to clang.
#
# Only use this in third-party code. In chromium_code, fix your code to not
# warn instead!
#
# Note that the gypi file is included in target_defaults, so it does not need
# to be explicitly included.
#
# Warning flags set by this will be used on all platforms. If you want to set
# warning flags on only some platforms, you have to do so manually.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'my_target',
# 'variables': {
# 'clang_warning_flags': ['-Wno-awesome-warning'],
# 'clang_warning_flags_unset': ['-Wpreviously-set-flag'],
# }
# }
{
'variables': {
'clang_warning_flags_unset%': [], # Provide a default value.
},
'conditions': [
['clang==1', {
# This uses >@ instead of @< to also see clang_warning_flags set in
# targets directly, not just the clang_warning_flags in target_defaults.
'cflags': [ '>@(clang_warning_flags)' ],
'cflags!': [ '>@(clang_warning_flags_unset)' ],
'xcode_settings': {
'WARNING_CFLAGS': ['>@(clang_warning_flags)'],
'WARNING_CFLAGS!': ['>@(clang_warning_flags_unset)'],
},
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [ '>@(clang_warning_flags)' ],
'AdditionalOptions!': [ '>@(clang_warning_flags_unset)' ],
},
},
}],
['clang==0 and host_clang==1', {
'target_conditions': [
['_toolset=="host"', {
'cflags': [ '>@(clang_warning_flags)' ],
'cflags!': [ '>@(clang_warning_flags_unset)' ],
}],
],
}],
],
}
# Copyright 2013 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# This file is meant to be included into a target to handle shim headers
# in a consistent manner. To use this the following variables need to be
# defined:
# headers_root_path: string: path to directory containing headers
# header_filenames: list: list of header file names
{
'variables': {
'shim_headers_path': '<(SHARED_INTERMEDIATE_DIR)/shim_headers/<(_target_name)/<(_toolset)',
'shim_generator_additional_args%': [],
},
'include_dirs++': [
'<(shim_headers_path)',
],
'all_dependent_settings': {
'include_dirs+++': [
'<(shim_headers_path)',
],
},
'actions': [
{
'variables': {
'generator_path': '<(DEPTH)/tools/generate_shim_headers/generate_shim_headers.py',
'generator_args': [
'--headers-root', '<(headers_root_path)',
'--output-directory', '<(shim_headers_path)',
'<@(shim_generator_additional_args)',
'<@(header_filenames)',
],
},
'action_name': 'generate_<(_target_name)_shim_headers',
'inputs': [
'<(generator_path)',
],
'outputs': [
'<!@pymod_do_main(generate_shim_headers <@(generator_args) --outputs)',
],
'action': ['python',
'<(generator_path)',
'<@(generator_args)',
'--generate',
],
'message': 'Generating <(_target_name) shim headers.',
},
],
}
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Definitions to be used when building stand-alone V8 binaries.
{
# We need to include toolchain.gypi here for third-party sources that don't
# directly include it themselves.
'includes': ['toolchain.gypi'],
'variables': {
'component%': 'static_library',
'clang_xcode%': 0,
# Track where uninitialized memory originates from. From fastest to
# slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
# - track the chain of stores leading from allocation site to use site.
'msan_track_origins%': 2,
'visibility%': 'hidden',
'v8_enable_backtrace%': 0,
'v8_enable_i18n_support%': 1,
'v8_deprecation_warnings': 1,
'v8_imminent_deprecation_warnings': 1,
'v8_check_microtasks_scopes_consistency': 'true',
'msvs_multi_core_compile%': '1',
'mac_deployment_target%': '10.7',
'release_extra_cflags%': '',
'variables': {
'variables': {
'variables': {
'variables': {
'conditions': [
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or \
OS=="netbsd" or OS=="mac" or OS=="qnx" or OS=="aix"', {
# This handles the Unix platforms we generally deal with.
# Anything else gets passed through, which probably won't work
# very well; such hosts should pass an explicit target_arch
# to gyp.
'host_arch%': '<!pymod_do_main(detect_v8_host_arch)',
}, {
# OS!="linux" and OS!="freebsd" and OS!="openbsd" and
# OS!="netbsd" and OS!="mac" and OS!="aix"
'host_arch%': 'ia32',
}],
],
},
'host_arch%': '<(host_arch)',
'target_arch%': '<(host_arch)',
# By default we build against a stable sysroot image to avoid
# depending on the packages installed on the local machine. Set this
# to 0 to build against locally installed headers and libraries (e.g.
# if packaging for a linux distro)
'use_sysroot%': 1,
},
'host_arch%': '<(host_arch)',
'target_arch%': '<(target_arch)',
'use_sysroot%': '<(use_sysroot)',
'base_dir%': '<!(cd <(DEPTH) && python -c "import os; print os.getcwd()")',
# Instrument for code coverage and use coverage wrapper to exclude some
# files. Uses gcov if clang=0 is set explicitly. Otherwise,
# sanitizer_coverage must be set too.
'coverage%': 0,
# Default sysroot if no sysroot can be provided.
'sysroot%': '',
'conditions': [
# The system root for linux builds.
['OS=="linux" and use_sysroot==1', {
'conditions': [
['target_arch=="arm"', {
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_arm-sysroot',
}],
['target_arch=="x64"', {
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_amd64-sysroot',
}],
['target_arch=="ia32"', {
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_i386-sysroot',
}],
['target_arch=="mipsel"', {
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_mips-sysroot',
}],
],
}], # OS=="linux" and use_sysroot==1
],
},
'base_dir%': '<(base_dir)',
'host_arch%': '<(host_arch)',
'target_arch%': '<(target_arch)',
'v8_target_arch%': '<(target_arch)',
'coverage%': '<(coverage)',
'sysroot%': '<(sysroot)',
'asan%': 0,
'lsan%': 0,
'msan%': 0,
'tsan%': 0,
# Enable coverage gathering instrumentation in sanitizer tools. This flag
# also controls coverage granularity (1 for function-level, 2 for
# block-level, 3 for edge-level).
'sanitizer_coverage%': 0,
# Use dynamic libraries instrumented by one of the sanitizers
# instead of the standard system libraries. Set this flag to download
# prebuilt binaries from GCS.
'use_prebuilt_instrumented_libraries%': 0,
# Use libc++ (buildtools/third_party/libc++ and
# buildtools/third_party/libc++abi) instead of stdlibc++ as standard
# library. This is intended to be used for instrumented builds.
'use_custom_libcxx%': 0,
'clang_dir%': '<(base_dir)/third_party/llvm-build/Release+Asserts',
'make_clang_dir%': '<(base_dir)/third_party/llvm-build/Release+Asserts',
# Control Flow Integrity for virtual calls and casts.
# See http://clang.llvm.org/docs/ControlFlowIntegrity.html
'cfi_vptr%': 0,
'cfi_diag%': 0,
'cfi_blacklist%': '<(base_dir)/tools/cfi/blacklist.txt',
# Set to 1 to enable fast builds.
# TODO(machenbach): Only configured for windows.
'fastbuild%': 0,
# goma settings.
# 1 to use goma.
# If no gomadir is set, it uses the default gomadir.
'use_goma%': 0,
'gomadir%': '',
'test_isolation_mode%': 'noop',
# By default, use ICU data file (icudtl.dat).
'icu_use_data_file_flag%': 1,
'conditions': [
# Set default gomadir.
['OS=="win"', {
'gomadir': 'c:\\goma\\goma-win',
}, {
'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
}],
['host_arch!="ppc" and host_arch!="ppc64" and host_arch!="ppc64le" and host_arch!="s390" and host_arch!="s390x"', {
'host_clang%': 1,
}, {
'host_clang%': 0,
}],
# linux_use_bundled_gold: whether to use the gold linker binary checked
# into third_party/binutils. Force this off via GYP_DEFINES when you
# are using a custom toolchain and need to control -B in ldflags.
# Do not use 32-bit gold on 32-bit hosts as it runs out address space
# for component=static_library builds.
['((OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm" or (target_arch=="ia32" and host_arch=="x64"))) or (OS=="linux" and target_arch=="mipsel")', {
'linux_use_bundled_gold%': 1,
}, {
'linux_use_bundled_gold%': 0,
}],
],
},
'base_dir%': '<(base_dir)',
'clang_dir%': '<(clang_dir)',
'make_clang_dir%': '<(make_clang_dir)',
'host_arch%': '<(host_arch)',
'host_clang%': '<(host_clang)',
'target_arch%': '<(target_arch)',
'v8_target_arch%': '<(v8_target_arch)',
'werror%': '-Werror',
'use_goma%': '<(use_goma)',
'gomadir%': '<(gomadir)',
'asan%': '<(asan)',
'lsan%': '<(lsan)',
'msan%': '<(msan)',
'tsan%': '<(tsan)',
'sanitizer_coverage%': '<(sanitizer_coverage)',
'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
'use_custom_libcxx%': '<(use_custom_libcxx)',
'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
'cfi_vptr%': '<(cfi_vptr)',
'cfi_diag%': '<(cfi_diag)',
'cfi_blacklist%': '<(cfi_blacklist)',
'test_isolation_mode%': '<(test_isolation_mode)',
'fastbuild%': '<(fastbuild)',
'coverage%': '<(coverage)',
'sysroot%': '<(sysroot)',
'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
# Add a simple extras solely for the purpose of the cctests
'v8_extra_library_files': ['../test/cctest/test-extra.js'],
'v8_experimental_extra_library_files': ['../test/cctest/test-experimental-extra.js'],
# .gyp files or targets should set v8_code to 1 if they build V8 specific
# code, as opposed to external code. This variable is used to control such
# things as the set of warnings to enable, and whether warnings are treated
# as errors.
'v8_code%': 0,
# Speeds up Debug builds:
# 0 - Compiler optimizations off (debuggable) (default). This may
# be 5x slower than Release (or worse).
# 1 - Turn on optimizations and disable slow DCHECKs, but leave
# V8_ENABLE_CHECKS and most other assertions enabled. This may cause
# some v8 tests to fail in the Debug configuration. This roughly
# matches the performance of a Release build and can be used by
# embedders that need to build their own code as debug but don't want
# or need a debug version of V8. This should produce near-release
# speeds.
'v8_optimized_debug%': 0,
# Use external files for startup data blobs:
# the JS builtins sources and the start snapshot.
# Embedders that don't use standalone.gypi will need to add
# their own default value.
'v8_use_external_startup_data%': 1,
# Relative path to icu.gyp from this file.
'icu_gyp_path': '../third_party/icu/icu.gyp',
'conditions': [
['(v8_target_arch=="arm" and host_arch!="arm") or \
(v8_target_arch=="arm64" and host_arch!="arm64") or \
(v8_target_arch=="mipsel" and host_arch!="mipsel") or \
(v8_target_arch=="mips64el" and host_arch!="mips64el") or \
(v8_target_arch=="x64" and host_arch!="x64") or \
(OS=="android" or OS=="qnx")', {
'want_separate_host_toolset': 1,
}, {
'want_separate_host_toolset': 0,
}],
['OS == "win"', {
'os_posix%': 0,
}, {
'os_posix%': 1,
}],
['OS=="win" and use_goma==1', {
# goma doesn't support pch yet.
'chromium_win_pch': 0,
# goma doesn't support PDB yet.
'fastbuild%': 1,
}],
['((v8_target_arch=="ia32" or v8_target_arch=="x64") and \
(OS=="linux" or OS=="mac")) or (v8_target_arch=="ppc64" and OS=="linux")', {
'v8_enable_gdbjit%': 1,
}, {
'v8_enable_gdbjit%': 0,
}],
['(OS=="linux" or OS=="mac") and (target_arch=="ia32" or target_arch=="x64") and \
v8_target_arch!="x32"', {
'clang%': 1,
}, {
'clang%': 0,
}],
['asan==1 or lsan==1 or msan==1 or tsan==1', {
'clang%': 1,
'use_allocator%': 'none',
}],
['asan==1 and OS=="linux"', {
'use_custom_libcxx%': 1,
}],
['tsan==1', {
'use_custom_libcxx%': 1,
}],
['msan==1', {
# Use a just-built, MSan-instrumented libc++ instead of the system-wide
# libstdc++. This is required to avoid false positive reports whenever
# the C++ standard library is used.
'use_custom_libcxx%': 1,
}],
['OS=="android"', {
# Location of Android NDK.
'variables': {
'variables': {
# The Android toolchain needs to use the absolute path to the NDK
# because it is used at different levels in the GYP files.
'android_ndk_root%': '<(base_dir)/third_party/android_ndk/',
'android_host_arch%': "<!(uname -m | sed -e 's/i[3456]86/x86/')",
# Version of the NDK. Used to ensure full rebuilds on NDK rolls.
'android_ndk_version%': 'r12b',
'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
'os_folder_name%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/darwin/')",
},
# Copy conditionally-set variables out one scope.
'android_ndk_root%': '<(android_ndk_root)',
'android_ndk_version%': '<(android_ndk_version)',
'host_os%': '<(host_os)',
'os_folder_name%': '<(os_folder_name)',
'conditions': [
['target_arch == "ia32"', {
'android_toolchain%': '<(android_ndk_root)/toolchains/x86-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin',
'android_target_arch%': 'x86',
'android_target_platform%': '16',
'arm_version%': 'default',
}],
['target_arch == "x64"', {
'android_toolchain%': '<(android_ndk_root)/toolchains/x86_64-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin',
'android_target_arch%': 'x86_64',
'android_target_platform%': '21',
'arm_version%': 'default',
}],
['target_arch=="arm"', {
'android_toolchain%': '<(android_ndk_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin',
'android_target_arch%': 'arm',
'android_target_platform%': '16',
'arm_version%': 7,
}],
['target_arch == "arm64"', {
'android_toolchain%': '<(android_ndk_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin',
'android_target_arch%': 'arm64',
'android_target_platform%': '21',
'arm_version%': 'default',
}],
['target_arch == "mipsel"', {
'android_toolchain%': '<(android_ndk_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin',
'android_target_arch%': 'mips',
'android_target_platform%': '16',
'arm_version%': 'default',
}],
['target_arch == "mips64el"', {
'android_toolchain%': '<(android_ndk_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(os_folder_name)-<(android_host_arch)/bin',
'android_target_arch%': 'mips64',
'android_target_platform%': '21',
'arm_version%': 'default',
}],
],
},
# Copy conditionally-set variables out one scope.
'android_ndk_version%': '<(android_ndk_version)',
'android_target_arch%': '<(android_target_arch)',
'android_target_platform%': '<(android_target_platform)',
'android_toolchain%': '<(android_toolchain)',
'arm_version%': '<(arm_version)',
'host_os%': '<(host_os)',
# Print to stdout on Android.
'v8_android_log_stdout%': 1,
'conditions': [
['android_ndk_root==""', {
'variables': {
'android_sysroot': '<(android_toolchain)/sysroot/',
'android_stl': '<(android_toolchain)/sources/cxx-stl/',
},
'conditions': [
['target_arch=="x64"', {
'android_lib': '<(android_sysroot)/usr/lib64',
}, {
'android_lib': '<(android_sysroot)/usr/lib',
}],
],
'android_libcpp_include': '<(android_stl)/llvm-libc++/libcxx/include',
'android_libcpp_abi_include': '<(android_stl)/llvm-libc++abi/libcxxabi/include',
'android_libcpp_libs': '<(android_stl)/llvm-libc++/libs',
'android_support_include': '<(android_toolchain)/sources/android/support/include',
'android_sysroot': '<(android_sysroot)',
}, {
'variables': {
'android_sysroot': '<(android_ndk_root)/platforms/android-<(android_target_platform)/arch-<(android_target_arch)',
'android_stl': '<(android_ndk_root)/sources/cxx-stl/',
},
'conditions': [
['target_arch=="x64"', {
'android_lib': '<(android_sysroot)/usr/lib64',
}, {
'android_lib': '<(android_sysroot)/usr/lib',
}],
],
'android_libcpp_include': '<(android_stl)/llvm-libc++/libcxx/include',
'android_libcpp_abi_include': '<(android_stl)/llvm-libc++abi/libcxxabi/include',
'android_libcpp_libs': '<(android_stl)/llvm-libc++/libs',
'android_support_include': '<(android_ndk_root)/sources/android/support/include',
'android_sysroot': '<(android_sysroot)',
}],
],
'android_libcpp_library': 'c++_static',
}], # OS=="android"
['host_clang==1', {
'conditions':[
['OS=="android"', {
'host_ld': '<!(which ld)',
'host_ranlib': '<!(which ranlib)',
}],
],
'host_cc': '<(clang_dir)/bin/clang',
'host_cxx': '<(clang_dir)/bin/clang++',
}, {
'host_cc': '<!(which gcc)',
'host_cxx': '<!(which g++)',
}],
],
# Default ARM variable settings.
'arm_version%': 'default',
'arm_fpu%': 'vfpv3',
'arm_float_abi%': 'default',
'arm_thumb': 'default',
# Default MIPS variable settings.
'mips_arch_variant%': 'r2',
# Possible values fp32, fp64, fpxx.
# fp32 - 32 32-bit FPU registers are available, doubles are placed in
# register pairs.
# fp64 - 32 64-bit FPU registers are available.
# fpxx - compatibility mode, it chooses fp32 or fp64 depending on runtime
# detection
'mips_fpu_mode%': 'fp32',
},
'target_defaults': {
'variables': {
'v8_code%': '<(v8_code)',
'clang_warning_flags': [
'-Wsign-compare',
# TODO(thakis): https://crbug.com/604888
'-Wno-undefined-var-template',
# TODO(yangguo): issue 5258
'-Wno-nonportable-include-path',
'-Wno-tautological-constant-compare',
],
'conditions':[
['OS=="android"', {
'host_os%': '<(host_os)',
}],
],
},
'includes': [ 'set_clang_warning_flags.gypi', ],
'default_configuration': 'Debug',
'configurations': {
'DebugBaseCommon': {
'conditions': [
['OS=="aix"', {
'cflags': [ '-g', '-Og', '-gxcoff' ],
}, {
'cflags': [ '-g', '-O0' ],
}],
],
},
'Optdebug': {
'inherit_from': [ 'DebugBaseCommon', 'DebugBase1' ],
},
'Debug': {
# Xcode insists on this empty entry.
},
'Release': {
'cflags+': ['<@(release_extra_cflags)'],
},
'conditions': [
['OS=="win"', {
'Optdebug_x64': {
'inherit_from': ['Optdebug'],
},
'Debug_x64': {
'inherit_from': ['Debug'],
},
'Release_x64': {
'inherit_from': ['Release'],
},
}],
],
},
'conditions':[
['clang==0', {
'cflags+': [
'-Wno-uninitialized',
],
}],
['clang==1 or host_clang==1', {
# This is here so that all files get recompiled after a clang roll and
# when turning clang on or off.
# (defines are passed via the command line, and build systems rebuild
# things when their commandline changes). Nothing should ever read this
# define.
'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
}],
['clang==1 and target_arch=="ia32"', {
'cflags': ['-mstack-alignment=16', '-mstackrealign'],
}],
['fastbuild!=0', {
'conditions': [
['OS=="win" and fastbuild==1', {
'msvs_settings': {
'VCLinkerTool': {
# This tells the linker to generate .pdbs, so that
# we can get meaningful stack traces.
'GenerateDebugInformation': 'true',
},
'VCCLCompilerTool': {
# No debug info to be generated by compiler.
'DebugInformationFormat': '0',
},
},
}],
],
}], # fastbuild!=0
],
'target_conditions': [
['v8_code == 0', {
'defines!': [
'DEBUG',
],
'conditions': [
['os_posix == 1 and OS != "mac"', {
# We don't want to get warnings from third-party code,
# so remove any existing warning-enabling flags like -Wall.
'cflags!': [
'-pedantic',
'-Wall',
'-Werror',
'-Wextra',
'-Wshorten-64-to-32',
],
'cflags+': [
# Clang considers the `register` keyword as deprecated, but
# ICU uses it all over the place.
'-Wno-deprecated-register',
# ICU uses its own deprecated functions.
'-Wno-deprecated-declarations',
# ICU prefers `a && b || c` over `(a && b) || c`.
'-Wno-logical-op-parentheses',
# ICU has some `unsigned < 0` checks.
'-Wno-tautological-compare',
# uresdata.c has switch(RES_GET_TYPE(x)) code. The
# RES_GET_TYPE macro returns an UResType enum, but some switch
# statement contains case values that aren't part of that
# enum (e.g. URES_TABLE32 which is in UResInternalType). This
# is on purpose.
'-Wno-switch',
],
'cflags_cc!': [
'-Wnon-virtual-dtor',
],
}],
['OS == "mac"', {
'xcode_settings': {
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
},
}],
['OS == "win"', {
'msvs_settings': {
'VCCLCompilerTool': {
'WarnAsError': 'false',
},
},
}],
],
}],
],
},
'conditions': [
['os_posix==1 and OS!="mac"', {
'target_defaults': {
'conditions': [
# Common options for AddressSanitizer, LeakSanitizer,
# ThreadSanitizer, MemorySanitizer and CFI builds.
['asan==1 or lsan==1 or tsan==1 or msan==1 or cfi_vptr==1', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fno-omit-frame-pointer',
'-gline-tables-only',
],
'cflags!': [
'-fomit-frame-pointer',
],
}],
],
}],
['asan==1', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize=address',
],
'ldflags': [
'-fsanitize=address',
],
'defines': [
'ADDRESS_SANITIZER',
],
}],
],
}],
['lsan==1', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize=leak',
],
'ldflags': [
'-fsanitize=leak',
],
'defines': [
'LEAK_SANITIZER',
],
}],
],
}],
['tsan==1', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize=thread',
],
'ldflags': [
'-fsanitize=thread',
],
'defines': [
'THREAD_SANITIZER',
],
}],
],
}],
['msan==1', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize=memory',
'-fsanitize-memory-track-origins=<(msan_track_origins)',
'-fPIC',
],
'ldflags': [
'-fsanitize=memory',
'-pie',
],
'defines': [
'MEMORY_SANITIZER',
],
}],
],
}],
['use_prebuilt_instrumented_libraries==1', {
'dependencies': [
'<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
],
}],
['use_custom_libcxx==1', {
'dependencies': [
'<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
],
}],
['sanitizer_coverage!=0', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize-coverage=<(sanitizer_coverage)',
],
'defines': [
'SANITIZER_COVERAGE',
],
}],
],
}],
['linux_use_bundled_gold==1', {
# Put our binutils, which contains gold in the search path. We pass
# the path to gold to the compiler. gyp leaves unspecified what the
# cwd is when running the compiler, so the normal gyp path-munging
# fails us. This hack gets the right path.
'ldflags': [
# Note, Chromium allows ia32 host arch as well, we limit this to
# x64 in v8.
'-B<(base_dir)/third_party/binutils/Linux_x64/Release/bin',
],
}],
['sysroot!="" and clang==1', {
'target_conditions': [
['_toolset=="target"', {
'variables': {
'ld_paths': ['<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))'],
},
'cflags': [
'--sysroot=<(sysroot)',
],
'ldflags': [
'--sysroot=<(sysroot)',
'<!(<(base_dir)/gypfiles/sysroot_ld_flags.sh <@(ld_paths))',
],
}]]
}],
],
},
}],
['OS=="mac"', {
'target_defaults': {
'conditions': [
['asan==1', {
'xcode_settings': {
# FIXME(machenbach): This is outdated compared to common.gypi.
'OTHER_CFLAGS+': [
'-fno-omit-frame-pointer',
'-gline-tables-only',
'-fsanitize=address',
'-w', # http://crbug.com/162783
],
'OTHER_CFLAGS!': [
'-fomit-frame-pointer',
],
'defines': [
'ADDRESS_SANITIZER',
],
},
'dependencies': [
'<(DEPTH)/gypfiles/mac/asan.gyp:asan_dynamic_runtime',
],
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
}],
],
}],
['sanitizer_coverage!=0', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
'-fsanitize-coverage=<(sanitizer_coverage)',
],
'defines': [
'SANITIZER_COVERAGE',
],
}],
],
}],
],
}, # target_defaults
}], # OS=="mac"
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd" or OS=="aix"', {
'target_defaults': {
'cflags': [
'-Wall',
'<(werror)',
'-Wno-unused-parameter',
'-pthread',
'-pedantic',
'-Wno-missing-field-initializers',
'-Wno-gnu-zero-variadic-macro-arguments',
],
'cflags_cc': [
'-Wnon-virtual-dtor',
'-fno-exceptions',
'-fno-rtti',
'-std=gnu++11',
],
'ldflags': [ '-pthread', ],
'conditions': [
# Don't warn about TRACE_EVENT_* macros with zero arguments passed to
# ##__VA_ARGS__. C99 strict mode prohibits having zero variadic macro
# arguments in gcc.
[ 'clang==0', {
'cflags!' : [
'-pedantic' ,
# Don't warn about unrecognized command line option.
'-Wno-gnu-zero-variadic-macro-arguments',
],
'cflags' : [
# Disable gcc warnings for optimizations based on the assumption
# that signed overflow does not occur. Generates false positives
# (see http://crbug.com/v8/6341).
"-Wno-strict-overflow",
# Don't rely on strict aliasing; v8 does weird pointer casts all
# over the place.
'-fno-strict-aliasing',
],
}, {
'cflags' : [
# TODO(hans): https://crbug.com/767059
'-Wno-tautological-constant-compare',
],
}],
[ 'clang==1 and (v8_target_arch=="x64" or v8_target_arch=="arm64" \
or v8_target_arch=="mips64el")', {
'cflags': [ '-Wshorten-64-to-32' ],
}],
[ 'host_arch=="ppc64" and OS!="aix"', {
'cflags': [ '-mminimal-toc' ],
}],
[ 'visibility=="hidden" and v8_enable_backtrace==0', {
'cflags': [ '-fvisibility=hidden' ],
}],
[ 'component=="shared_library"', {
'cflags': [ '-fPIC', ],
}],
[ 'clang==0 and coverage==1', {
'cflags': [ '-fprofile-arcs', '-ftest-coverage'],
'ldflags': [ '-fprofile-arcs'],
}],
],
},
}],
# 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"
# or OS=="netbsd"'
['OS=="qnx"', {
'target_defaults': {
'cflags': [
'-Wall',
'<(werror)',
'-Wno-unused-parameter',
# Don't warn about the "struct foo f = {0};" initialization pattern.
'-Wno-missing-field-initializers',
'-Wno-gnu-zero-variadic-macro-arguments',
],
'cflags_cc': [
'-Wnon-virtual-dtor',
'-fno-exceptions',
'-fno-rtti',
'-std=gnu++11',
],
'conditions': [
[ 'visibility=="hidden"', {
'cflags': [ '-fvisibility=hidden' ],
}],
[ 'component=="shared_library"', {
'cflags': [ '-fPIC' ],
}],
],
'target_conditions': [
[ '_toolset=="host" and host_os=="linux"', {
'cflags': [ '-pthread' ],
'ldflags': [ '-pthread' ],
'libraries': [ '-lrt' ],
}],
[ '_toolset=="target"', {
'cflags': [ '-Wno-psabi' ],
'libraries': [ '-lbacktrace', '-lsocket', '-lm' ],
}],
],
},
}], # OS=="qnx"
['OS=="win"', {
'target_defaults': {
'defines': [
'_CRT_SECURE_NO_DEPRECATE',
'_CRT_NONSTDC_NO_DEPRECATE',
'_USING_V110_SDK71_',
],
'conditions': [
['component=="static_library"', {
'defines': [
'_HAS_EXCEPTIONS=0',
],
}],
],
'msvs_cygwin_shell': 0,
'msvs_disabled_warnings': [
# C4091: 'typedef ': ignored on left of 'X' when no variable is
# declared.
# This happens in a number of Windows headers. Dumb.
4091,
# C4127: conditional expression is constant
# This warning can in theory catch dead code and other problems, but
# triggers in far too many desirable cases where the conditional
# expression is either set by macros or corresponds some legitimate
# compile-time constant expression (due to constant template args,
# conditionals comparing the sizes of different types, etc.). Some of
# these can be worked around, but it's not worth it.
4127,
# C4351: new behavior: elements of array 'array' will be default
# initialized
# This is a silly "warning" that basically just alerts you that the
# compiler is going to actually follow the language spec like it's
# supposed to, instead of not following it like old buggy versions
# did. There's absolutely no reason to turn this on.
4351,
# C4355: 'this': used in base member initializer list
# It's commonly useful to pass |this| to objects in a class'
# initializer list. While this warning can catch real bugs, most of
# the time the constructors in question don't attempt to call methods
# on the passed-in pointer (until later), and annotating every legit
# usage of this is simply more hassle than the warning is worth.
4355,
# C4503: 'identifier': decorated name length exceeded, name was
# truncated
# This only means that some long error messages might have truncated
# identifiers in the presence of lots of templates. It has no effect
# on program correctness and there's no real reason to waste time
# trying to prevent it.
4503,
# Warning C4589 says: "Constructor of abstract class ignores
# initializer for virtual base class." Disable this warning because it
# is flaky in VS 2015 RTM. It triggers on compiler generated
# copy-constructors in some cases.
4589,
# C4611: interaction between 'function' and C++ object destruction is
# non-portable
# This warning is unavoidable when using e.g. setjmp/longjmp. MSDN
# suggests using exceptions instead of setjmp/longjmp for C++, but
# Chromium code compiles without exception support. We therefore have
# to use setjmp/longjmp for e.g. JPEG decode error handling, which
# means we have to turn off this warning (and be careful about how
# object destruction happens in such cases).
4611,
# TODO(jochen): These warnings are level 4. They will be slowly
# removed as code is fixed.
4100, # Unreferenced formal parameter
4121, # Alignment of a member was sensitive to packing
4244, # Conversion from 'type1' to 'type2', possible loss of data
4302, # Truncation from 'type 1' to 'type 2'
4309, # Truncation of constant value
4311, # Pointer truncation from 'type' to 'type'
4312, # Conversion from 'type1' to 'type2' of greater size
4505, # Unreferenced local function has been removed
4510, # Default constructor could not be generated
4512, # Assignment operator could not be generated
4610, # Object can never be instantiated
4800, # Forcing value to bool.
4838, # Narrowing conversion. Doesn't seem to be very useful.
4995, # 'X': name was marked as #pragma deprecated
4996, # 'X': was declared deprecated (for GetVersionEx).
# These are variable shadowing warnings that are new in VS2015. We
# should work through these at some point -- they may be removed from
# the RTM release in the /W4 set.
4456, 4457, 4458, 4459,
],
'msvs_settings': {
'VCCLCompilerTool': {
'MinimalRebuild': 'false',
'BufferSecurityCheck': 'true',
'EnableFunctionLevelLinking': 'true',
'RuntimeTypeInfo': 'false',
'WarningLevel': '3',
'WarnAsError': 'true',
'DebugInformationFormat': '3',
'Detect64BitPortabilityProblems': 'false',
'conditions': [
[ 'msvs_multi_core_compile', {
'AdditionalOptions': ['/MP'],
}],
['component=="shared_library"', {
'ExceptionHandling': '1', # /EHsc
}, {
'ExceptionHandling': '0',
}],
],
},
'VCLibrarianTool': {
'AdditionalOptions': ['/ignore:4221'],
'conditions': [
['v8_target_arch=="x64"', {
'TargetMachine': '17', # x64
}, {
'TargetMachine': '1', # ia32
}],
],
},
'VCLinkerTool': {
'AdditionalDependencies': [
'ws2_32.lib',
],
'GenerateDebugInformation': 'true',
'MapFileName': '$(OutDir)\\$(TargetName).map',
'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
'FixedBaseAddress': '1',
# LinkIncremental values:
# 0 == default
# 1 == /INCREMENTAL:NO
# 2 == /INCREMENTAL
'LinkIncremental': '1',
# SubSystem values:
# 0 == not set
# 1 == /SUBSYSTEM:CONSOLE
# 2 == /SUBSYSTEM:WINDOWS
'SubSystem': '1',
'conditions': [
['v8_enable_i18n_support==1', {
'AdditionalDependencies': [
'advapi32.lib',
],
}],
['v8_target_arch=="x64"', {
'MinimumRequiredVersion': '5.02', # Server 2003.
'TargetMachine': '17', # x64
}, {
'MinimumRequiredVersion': '5.01', # XP.
'TargetMachine': '1', # ia32
}],
],
},
'conditions': [
['clang==1', {
'VCCLCompilerTool': {
'AdditionalOptions': [
# Don't warn about unused function parameters.
# (This is also used on other platforms.)
'-Wno-unused-parameter',
# Don't warn about the "struct foo f = {0};" initialization
# pattern.
'-Wno-missing-field-initializers',
# TODO(hans): Make this list shorter eventually, http://crbug.com/504657
'-Qunused-arguments', # http://crbug.com/504658
'-Wno-microsoft-enum-value', # http://crbug.com/505296
'-Wno-unknown-pragmas', # http://crbug.com/505314
'-Wno-microsoft-cast', # http://crbug.com/550065
],
},
}],
['clang==1 and MSVS_VERSION == "2013"', {
'VCCLCompilerTool': {
'AdditionalOptions': [
'-fmsc-version=1800',
],
},
}],
['clang==1 and MSVS_VERSION == "2015"', {
'VCCLCompilerTool': {
'AdditionalOptions': [
'-fmsc-version=1900',
],
},
}],
],
},
},
}], # OS=="win"
['OS=="mac"', {
'xcode_settings': {
'SDKROOT': 'macosx',
'SYMROOT': '<(DEPTH)/xcodebuild',
},
'target_defaults': {
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
# (Equivalent to -fPIC)
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
# GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
# MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
'PREBINDING': 'NO', # No -Wl,-prebind
'SYMROOT': '<(DEPTH)/xcodebuild',
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
'-fno-strict-aliasing',
],
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-Wno-unused-parameter',
# Don't warn about the "struct foo f = {0};" initialization pattern.
'-Wno-missing-field-initializers',
'-Wno-gnu-zero-variadic-macro-arguments',
],
},
'conditions': [
['werror==""', {
'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO'},
}, {
'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES'},
}],
['clang==1', {
'xcode_settings': {
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
},
'conditions': [
['clang_xcode==0', {
'xcode_settings': {
'CC': '<(clang_dir)/bin/clang',
'LDPLUSPLUS': '<(clang_dir)/bin/clang++',
'CLANG_CXX_LIBRARY': 'libc++'
},
}],
['v8_target_arch=="x64" or v8_target_arch=="arm64" \
or v8_target_arch=="mips64el"', {
'xcode_settings': {'WARNING_CFLAGS': ['-Wshorten-64-to-32']},
}],
],
}],
],
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
}],
], # target_conditions
}, # target_defaults
}], # OS=="mac"
['OS=="android"', {
'target_defaults': {
'defines': [
'ANDROID',
],
'configurations': {
'Release': {
'cflags': [
'-fomit-frame-pointer',
],
}, # Release
}, # configurations
'cflags': [ '-Wno-abi', '-Wall', '-W', '-Wno-unused-parameter'],
'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti', '-fno-exceptions',
'-std=gnu++11' ],
'target_conditions': [
['_toolset=="target"', {
'cflags!': [
'-pthread', # Not supported by Android toolchain.
],
'cflags': [
'-ffunction-sections',
'-funwind-tables',
'-fstack-protector',
'-fno-short-enums',
'-finline-limit=64',
'-Wa,--noexecstack',
'--sysroot=<(android_sysroot)',
],
'cflags_cc': [
'-isystem<(android_libcpp_include)',
'-isystem<(android_libcpp_abi_include)',
'-isystem<(android_support_include)',
],
'defines': [
'ANDROID',
#'__GNU_SOURCE=1', # Necessary for clone()
'HAVE_OFF64_T',
'HAVE_SYS_UIO_H',
'ANDROID_BINSIZE_HACK', # Enable temporary hacks to reduce binsize.
'ANDROID_NDK_VERSION=<(android_ndk_version)',
],
'ldflags!': [
'-pthread', # Not supported by Android toolchain.
],
'ldflags': [
'-Wl,--no-undefined',
'--sysroot=<(android_sysroot)',
'-nostdlib',
],
'libraries!': [
'-lrt', # librt is built into Bionic.
# Not supported by Android toolchain.
# Where do these come from? Can't find references in
# any Chromium gyp or gypi file. Maybe they come from
# gyp itself?
'-lpthread', '-lnss3', '-lnssutil3', '-lsmime3', '-lplds4', '-lplc4', '-lnspr4',
],
'libraries': [
'-l<(android_libcpp_library)',
'-latomic',
# Manually link the libgcc.a that the cross compiler uses.
'<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
'-lc',
'-ldl',
'-lm',
],
'conditions': [
['target_arch == "arm"', {
'ldflags': [
# Enable identical code folding to reduce size.
'-Wl,--icf=safe',
],
}],
['target_arch=="arm" and arm_version==7', {
'cflags': [
'-march=armv7-a',
'-mtune=cortex-a8',
'-mfpu=vfp3',
],
'ldflags': [
'-L<(android_libcpp_libs)/armeabi-v7a',
],
}],
['target_arch=="arm" and arm_version < 7', {
'ldflags': [
'-L<(android_libcpp_libs)/armeabi',
],
}],
['target_arch=="x64"', {
'ldflags': [
'-L<(android_libcpp_libs)/x86_64',
],
}],
['target_arch=="arm64"', {
'ldflags': [
'-L<(android_libcpp_libs)/arm64-v8a',
],
}],
['target_arch=="ia32"', {
# The x86 toolchain currently has problems with stack-protector.
'cflags!': [
'-fstack-protector',
],
'cflags': [
'-fno-stack-protector',
],
'ldflags': [
'-L<(android_libcpp_libs)/x86',
],
}],
['target_arch=="mipsel"', {
# The mips toolchain currently has problems with stack-protector.
'cflags!': [
'-fstack-protector',
'-U__linux__'
],
'cflags': [
'-fno-stack-protector',
],
'ldflags': [
'-L<(android_libcpp_libs)/mips',
],
}],
['(target_arch=="arm" or target_arch=="arm64" or target_arch=="x64" or target_arch=="ia32") and component!="shared_library"', {
'cflags': [
'-fPIE',
],
'ldflags': [
'-pie',
],
}],
],
'target_conditions': [
['_type=="executable"', {
'conditions': [
['target_arch=="arm64" or target_arch=="x64"', {
'ldflags': [
'-Wl,-dynamic-linker,/system/bin/linker64',
],
}, {
'ldflags': [
'-Wl,-dynamic-linker,/system/bin/linker',
],
}]
],
'ldflags': [
'-Bdynamic',
'-Wl,-z,nocopyreloc',
# crtbegin_dynamic.o should be the last item in ldflags.
'<(android_lib)/crtbegin_dynamic.o',
],
'libraries': [
# crtend_android.o needs to be the last item in libraries.
# Do not add any libraries after this!
'<(android_lib)/crtend_android.o',
],
}],
['_type=="shared_library"', {
'ldflags': [
'-Wl,-shared,-Bsymbolic',
'<(android_lib)/crtbegin_so.o',
],
}],
['_type=="static_library"', {
'ldflags': [
# Don't export symbols from statically linked libraries.
'-Wl,--exclude-libs=ALL',
],
}],
],
}], # _toolset=="target"
# Settings for building host targets using the system toolchain.
['_toolset=="host"', {
'cflags': [ '-pthread' ],
'ldflags': [ '-pthread' ],
'ldflags!': [
'-Wl,-z,noexecstack',
'-Wl,--gc-sections',
'-Wl,-O1',
'-Wl,--as-needed',
],
}],
], # target_conditions
}, # target_defaults
}], # OS=="android"
['OS=="android" and clang==0', {
# Hardcode the compiler names in the Makefile so that
# it won't depend on the environment at make time.
'make_global_settings': [
['LD', '<!(/bin/echo -n <(android_toolchain)/../*/bin/ld)'],
['RANLIB', '<!(/bin/echo -n <(android_toolchain)/../*/bin/ranlib)'],
['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
['LD.host', '<(host_ld)'],
['RANLIB.host', '<(host_ranlib)'],
['CC.host', '<(host_cc)'],
['CXX.host', '<(host_cxx)'],
],
}],
['clang!=1 and host_clang==1 and target_arch!="ia32" and target_arch!="x64"', {
'make_global_settings': [
['CC.host', '<(clang_dir)/bin/clang'],
['CXX.host', '<(clang_dir)/bin/clang++'],
],
}],
['clang==0 and host_clang==1 and target_arch!="ia32" and target_arch!="x64"', {
'target_conditions': [
['_toolset=="host"', {
'cflags_cc': [ '-std=gnu++11', ],
}],
],
'target_defaults': {
'target_conditions': [
['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
],
},
}],
['clang==1 and "<(GENERATOR)"=="ninja"', {
# See http://crbug.com/110262
'target_defaults': {
'cflags': [ '-fcolor-diagnostics' ],
'xcode_settings': { 'OTHER_CFLAGS': [ '-fcolor-diagnostics' ] },
},
}],
['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
'and OS!="win" and "<(GENERATOR)"=="make"', {
'make_global_settings': [
['CC', '<(clang_dir)/bin/clang'],
['CXX', '<(clang_dir)/bin/clang++'],
['CC.host', '$(CC)'],
['CXX.host', '$(CXX)'],
],
}],
['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
'and OS!="win" and "<(GENERATOR)"=="ninja"', {
'make_global_settings': [
['CC', '<(clang_dir)/bin/clang'],
['CXX', '<(clang_dir)/bin/clang++'],
['CC.host', '$(CC)'],
['CXX.host', '$(CXX)'],
],
}],
['clang==1 and OS=="win"', {
'make_global_settings': [
# On Windows, gyp's ninja generator only looks at CC.
['CC', '<(clang_dir)/bin/clang-cl'],
],
}],
['OS=="linux" and target_arch=="arm" and host_arch!="arm" and clang==0 and "<(GENERATOR)"=="ninja"', {
# Set default ARM cross tools on linux. These can be overridden
# using CC,CXX,CC.host and CXX.host environment variables.
'make_global_settings': [
['CC', '<!(which arm-linux-gnueabihf-gcc)'],
['CXX', '<!(which arm-linux-gnueabihf-g++)'],
['CC.host', '<(host_cc)'],
['CXX.host', '<(host_cxx)'],
],
}],
# TODO(yyanagisawa): supports GENERATOR==make
# make generator doesn't support CC_wrapper without CC
# in make_global_settings yet.
['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
'conditions': [
['coverage==1', {
# Wrap goma with coverage wrapper.
'make_global_settings': [
['CC_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py <(gomadir)/gomacc'],
['CXX_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py <(gomadir)/gomacc'],
['CC.host_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py <(gomadir)/gomacc'],
['CXX.host_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py <(gomadir)/gomacc'],
],
}, {
# Use only goma wrapper.
'make_global_settings': [
['CC_wrapper', '<(gomadir)/gomacc'],
['CXX_wrapper', '<(gomadir)/gomacc'],
['CC.host_wrapper', '<(gomadir)/gomacc'],
['CXX.host_wrapper', '<(gomadir)/gomacc'],
],
}],
],
}, {
'conditions': [
['coverage==1', {
# Use only coverage wrapper.
'make_global_settings': [
['CC_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py'],
['CXX_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py'],
['CC.host_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py'],
['CXX.host_wrapper', '<(base_dir)/gypfiles/coverage_wrapper.py'],
],
}],
],
}],
],
}
#!/bin/sh
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This is for backwards-compatibility after:
# https://codereview.chromium.org/2900193003
for entry in $@; do
echo -L$entry
echo -Wl,-rpath-link=$entry
done | xargs echo
# Copyright 2013 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Shared definitions for all V8-related targets.
{
'variables': {
'msvs_use_common_release': 0,
'clang%': 0,
'asan%': 0,
'cfi_vptr%': 0,
'lsan%': 0,
'msan%': 0,
'tsan%': 0,
'ubsan%': 0,
'ubsan_vptr%': 0,
'has_valgrind%': 0,
'coverage%': 0,
'v8_target_arch%': '<(target_arch)',
'v8_host_byteorder%': '<!(python -c "import sys; print sys.byteorder")',
'force_dynamic_crt%': 0,
# Setting 'v8_can_use_vfp32dregs' to 'true' will cause V8 to use the VFP
# registers d16-d31 in the generated code, both in the snapshot and for the
# ARM target. Leaving the default value of 'false' will avoid the use of
# these registers in the snapshot and use CPU feature probing when running
# on the target.
'v8_can_use_vfp32dregs%': 'false',
'arm_test_noprobe%': 'off',
# Similar to vfp but on MIPS.
'v8_can_use_fpu_instructions%': 'true',
# Similar to the ARM hard float ABI but on MIPS.
'v8_use_mips_abi_hardfloat%': 'true',
# MIPS MSA support
'mips_use_msa%': 0,
# Print to stdout on Android.
'v8_android_log_stdout%': 0,
# Force disable libstdc++ debug mode.
'disable_glibcxx_debug%': 0,
'v8_enable_backtrace%': 0,
# Enable profiling support. Only required on Windows.
'v8_enable_prof%': 0,
# Some versions of GCC 4.5 seem to need -fno-strict-aliasing.
'v8_no_strict_aliasing%': 0,
# Chrome needs this definition unconditionally. For standalone V8 builds,
# it's handled in gypfiles/standalone.gypi.
'want_separate_host_toolset%': 1,
# Toolset the shell binary should be compiled for. Possible values are
# 'host' and 'target'.
# The setting is ignored if want_separate_host_toolset is 0.
'v8_toolset_for_shell%': 'target',
'host_os%': '<(OS)',
'werror%': '-Werror',
# For a shared library build, results in "libv8-<(soname_version).so".
'soname_version%': '',
# Allow to suppress the array bounds warning (default is no suppression).
'wno_array_bounds%': '',
# Override where to find binutils
'binutils_dir%': '',
'conditions': [
['OS=="linux" and host_arch=="x64"', {
'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
}],
['OS=="linux" and host_arch=="ia32"', {
'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
}],
# linux_use_bundled_gold: whether to use the gold linker binary checked
# into third_party/binutils. Force this off via GYP_DEFINES when you
# are using a custom toolchain and need to control -B in ldflags.
# Do not use 32-bit gold on 32-bit hosts as it runs out address space
# for component=static_library builds.
['((OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm" or (target_arch=="ia32" and host_arch=="x64"))) or (OS=="linux" and target_arch=="mipsel")', {
'linux_use_bundled_gold%': 1,
}, {
'linux_use_bundled_gold%': 0,
}],
# linux_use_bundled_binutils: whether to use the binary binutils
# checked into third_party/binutils. These are not multi-arch so cannot
# be used except on x86 and x86-64 (the only two architectures which
# are currently checke in). Force this off via GYP_DEFINES when you
# are using a custom toolchain and need to control -B in cflags.
['OS=="linux" and (target_arch=="ia32" or target_arch=="x64")', {
'linux_use_bundled_binutils%': 1,
}, {
'linux_use_bundled_binutils%': 0,
}],
# linux_use_gold_flags: whether to use build flags that rely on gold.
# On by default for x64 Linux.
['OS=="linux" and target_arch=="x64"', {
'linux_use_gold_flags%': 1,
}, {
'linux_use_gold_flags%': 0,
}],
],
# Indicates if gcmole tools are downloaded by a hook.
'gcmole%': 0,
},
'conditions': [
['host_arch=="ia32" or host_arch=="x64" or \
host_arch=="ppc" or host_arch=="ppc64" or \
host_arch=="s390" or host_arch=="s390x" or \
clang==1', {
'variables': {
'host_cxx_is_biarch%': 1,
},
}, {
'variables': {
'host_cxx_is_biarch%': 0,
},
}],
['target_arch=="ia32" or target_arch=="x64" or \
target_arch=="ppc" or target_arch=="ppc64" or target_arch=="s390" or \
target_arch=="s390x" or clang==1', {
'variables': {
'target_cxx_is_biarch%': 1,
},
}, {
'variables': {
'target_cxx_is_biarch%': 0,
},
}],
],
'target_defaults': {
'conditions': [
['v8_target_arch=="arm"', {
'defines': [
'V8_TARGET_ARCH_ARM',
],
'conditions': [
[ 'arm_version==7 or arm_version=="default"', {
'defines': [
'CAN_USE_ARMV7_INSTRUCTIONS',
],
}],
[ 'arm_fpu=="vfpv3-d16" or arm_fpu=="default"', {
'defines': [
'CAN_USE_VFP3_INSTRUCTIONS',
],
}],
[ 'arm_fpu=="vfpv3"', {
'defines': [
'CAN_USE_VFP3_INSTRUCTIONS',
'CAN_USE_VFP32DREGS',
],
}],
[ 'arm_fpu=="neon"', {
'defines': [
'CAN_USE_VFP3_INSTRUCTIONS',
'CAN_USE_VFP32DREGS',
'CAN_USE_NEON',
],
}],
[ 'arm_test_noprobe=="on"', {
'defines': [
'ARM_TEST_NO_FEATURE_PROBE',
],
}],
],
'target_conditions': [
['_toolset=="host"', {
'conditions': [
['v8_target_arch==host_arch', {
# Host built with an Arm CXX compiler.
'conditions': [
[ 'arm_version==7', {
'cflags': ['-march=armv7-a',],
}],
[ 'arm_version==7 or arm_version=="default"', {
'conditions': [
[ 'arm_fpu!="default"', {
'cflags': ['-mfpu=<(arm_fpu)',],
}],
],
}],
[ 'arm_float_abi!="default"', {
'cflags': ['-mfloat-abi=<(arm_float_abi)',],
}],
[ 'arm_thumb==1', {
'cflags': ['-mthumb',],
}],
[ 'arm_thumb==0', {
'cflags': ['-marm',],
}],
],
}, {
# 'v8_target_arch!=host_arch'
# Host not built with an Arm CXX compiler (simulator build).
'conditions': [
[ 'arm_float_abi=="hard"', {
'defines': [
'USE_EABI_HARDFLOAT=1',
],
}],
[ 'arm_float_abi=="softfp" or arm_float_abi=="default"', {
'defines': [
'USE_EABI_HARDFLOAT=0',
],
}],
],
}],
],
}], # _toolset=="host"
['_toolset=="target"', {
'conditions': [
['v8_target_arch==target_arch', {
# Target built with an Arm CXX compiler.
'conditions': [
[ 'arm_version==7', {
'cflags': ['-march=armv7-a',],
}],
[ 'arm_version==7 or arm_version=="default"', {
'conditions': [
[ 'arm_fpu!="default"', {
'cflags': ['-mfpu=<(arm_fpu)',],
}],
],
}],
[ 'arm_float_abi!="default"', {
'cflags': ['-mfloat-abi=<(arm_float_abi)',],
}],
[ 'arm_thumb==1', {
'cflags': ['-mthumb',],
}],
[ 'arm_thumb==0', {
'cflags': ['-marm',],
}],
],
}, {
# 'v8_target_arch!=target_arch'
# Target not built with an Arm CXX compiler (simulator build).
'conditions': [
[ 'arm_float_abi=="hard"', {
'defines': [
'USE_EABI_HARDFLOAT=1',
],
}],
[ 'arm_float_abi=="softfp" or arm_float_abi=="default"', {
'defines': [
'USE_EABI_HARDFLOAT=0',
],
}],
],
}],
],
}], # _toolset=="target"
],
}], # v8_target_arch=="arm"
['v8_target_arch=="arm64"', {
'defines': [
'V8_TARGET_ARCH_ARM64',
],
}],
['v8_target_arch=="s390" or v8_target_arch=="s390x"', {
'defines': [
'V8_TARGET_ARCH_S390',
],
'conditions': [
['v8_target_arch=="s390x"', {
'defines': [
'V8_TARGET_ARCH_S390X',
],
}],
['v8_host_byteorder=="little"', {
'defines': [
'V8_TARGET_ARCH_S390_LE_SIM',
],
}, {
'cflags': [ '-march=z196' ],
}],
],
}], # s390
['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
'defines': [
'V8_TARGET_ARCH_PPC',
],
'conditions': [
['v8_target_arch=="ppc64"', {
'defines': [
'V8_TARGET_ARCH_PPC64',
],
}],
['v8_host_byteorder=="little"', {
'defines': [
'V8_TARGET_ARCH_PPC_LE',
],
}],
['v8_host_byteorder=="big"', {
'defines': [
'V8_TARGET_ARCH_PPC_BE',
],
'conditions': [
['OS=="aix"', {
# Work around AIX ceil, trunc and round oddities.
'cflags': [ '-mcpu=power5+ -mfprnd' ],
}],
['OS=="aix"', {
# Work around AIX assembler popcntb bug.
'cflags': [ '-mno-popcntb' ],
}],
],
}],
],
}], # ppc
['v8_target_arch=="ia32"', {
'defines': [
'V8_TARGET_ARCH_IA32',
],
}], # v8_target_arch=="ia32"
['v8_target_arch=="mips" or v8_target_arch=="mipsel" \
or v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
'target_conditions': [
['_toolset=="target"', {
'conditions': [
['v8_target_arch==target_arch', {
# Target built with a Mips CXX compiler.
'variables': {
'ldso_path%': '<!(/bin/echo -n $LDSO_PATH)',
'ld_r_path%': '<!(/bin/echo -n $LD_R_PATH)',
},
'conditions': [
['ldso_path!=""', {
'ldflags': ['-Wl,--dynamic-linker=<(ldso_path)'],
}],
['ld_r_path!=""', {
'ldflags': ['-Wl,--rpath=<(ld_r_path)'],
}],
[ 'clang==1', {
'cflags': ['-integrated-as'],
}],
['OS!="mac"', {
'defines': ['_MIPS_TARGET_HW',],
}, {
'defines': ['_MIPS_TARGET_SIMULATOR',],
}],
],
}, {
'defines': ['_MIPS_TARGET_SIMULATOR',],
}],
],
}], #'_toolset=="target"
['_toolset=="host"', {
'conditions': [
['v8_target_arch==target_arch and OS!="mac"', {
'defines': ['_MIPS_TARGET_HW',],
}, {
'defines': ['_MIPS_TARGET_SIMULATOR',],
}],
],
}], #'_toolset=="host"
],
}],
['v8_target_arch=="mips"', {
'defines': [
'V8_TARGET_ARCH_MIPS',
],
'conditions': [
[ 'v8_can_use_fpu_instructions=="true"', {
'defines': [
'CAN_USE_FPU_INSTRUCTIONS',
],
}],
[ 'v8_use_mips_abi_hardfloat=="true"', {
'defines': [
'__mips_hard_float=1',
'CAN_USE_FPU_INSTRUCTIONS',
],
}, {
'defines': [
'__mips_soft_float=1'
]
}],
],
'target_conditions': [
['_toolset=="target"', {
'conditions': [
['v8_target_arch==target_arch', {
# Target built with a Mips CXX compiler.
'cflags': [
'-EB',
'-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
],
'ldflags': ['-EB'],
'conditions': [
[ 'v8_use_mips_abi_hardfloat=="true"', {
'cflags': ['-mhard-float'],
'ldflags': ['-mhard-float'],
}, {
'cflags': ['-msoft-float'],
'ldflags': ['-msoft-float'],
}],
['mips_arch_variant=="r6"', {
'defines': [
'_MIPS_ARCH_MIPS32R6',
'FPU_MODE_FP64',
],
'cflags!': ['-mfp32', '-mfpxx'],
'conditions': [
[ 'clang==0', {
'cflags': ['-Wa,-mips32r6'],
}],
],
'cflags': ['-mips32r6'],
'ldflags': ['-mips32r6'],
}],
['mips_arch_variant=="r6" and mips_use_msa==1', {
'defines': [ '_MIPS_MSA' ],
}],
['mips_arch_variant=="r2"', {
'conditions': [
[ 'mips_fpu_mode=="fp64"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FP64',
],
'cflags': ['-mfp64'],
}],
['mips_fpu_mode=="fpxx"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FPXX',
],
'cflags': ['-mfpxx'],
}],
['mips_fpu_mode=="fp32"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FP32',
],
'cflags': ['-mfp32'],
}],
[ 'clang==0', {
'cflags': ['-Wa,-mips32r2'],
}],
],
'cflags': ['-mips32r2'],
'ldflags': ['-mips32r2'],
}],
['mips_arch_variant=="r1"', {
'defines': [
'FPU_MODE_FP32',
],
'cflags!': ['-mfp64', '-mfpxx'],
'conditions': [
[ 'clang==0', {
'cflags': ['-Wa,-mips32'],
}],
],
'cflags': ['-mips32'],
'ldflags': ['-mips32'],
}],
['mips_arch_variant=="rx"', {
'defines': [
'_MIPS_ARCH_MIPS32RX',
'FPU_MODE_FPXX',
],
'cflags!': ['-mfp64', '-mfp32'],
'conditions': [
[ 'clang==0', {
'cflags': ['-Wa,-mips32'],
}],
],
'cflags': ['-mips32', '-mfpxx'],
'ldflags': ['-mips32'],
}],
],
}, {
# 'v8_target_arch!=target_arch'
# Target not built with an MIPS CXX compiler (simulator build).
'conditions': [
['mips_arch_variant=="r6"', {
'defines': [
'_MIPS_ARCH_MIPS32R6',
'FPU_MODE_FP64',
],
}],
['mips_arch_variant=="r6" and mips_use_msa==1', {
'defines': [ '_MIPS_MSA' ],
}],
['mips_arch_variant=="r2"', {
'conditions': [
[ 'mips_fpu_mode=="fp64"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FP64',
],
}],
['mips_fpu_mode=="fpxx"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FPXX',
],
}],
['mips_fpu_mode=="fp32"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FP32',
],
}],
],
}],
['mips_arch_variant=="r1"', {
'defines': [
'FPU_MODE_FP32',
],
}],
['mips_arch_variant=="rx"', {
'defines': [
'_MIPS_ARCH_MIPS32RX',
'FPU_MODE_FPXX',
],
}],
],
}],
],
}], #_toolset=="target"
['_toolset=="host"', {
'conditions': [
['mips_arch_variant=="rx"', {
'defines': [
'_MIPS_ARCH_MIPS32RX',
'FPU_MODE_FPXX',
],
}],
['mips_arch_variant=="r6"', {
'defines': [
'_MIPS_ARCH_MIPS32R6',
'FPU_MODE_FP64',
],
}],
['mips_arch_variant=="r6" and mips_use_msa==1', {
'defines': [ '_MIPS_MSA' ],
}],
['mips_arch_variant=="r2"', {
'conditions': [
['mips_fpu_mode=="fp64"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FP64',
],
}],
['mips_fpu_mode=="fpxx"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FPXX',
],
}],
['mips_fpu_mode=="fp32"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FP32'
],
}],
],
}],
['mips_arch_variant=="r1"', {
'defines': ['FPU_MODE_FP32',],
}],
]
}], #_toolset=="host"
],
}], # v8_target_arch=="mips"
['v8_target_arch=="mipsel"', {
'defines': [
'V8_TARGET_ARCH_MIPS',
],
'conditions': [
[ 'v8_can_use_fpu_instructions=="true"', {
'defines': [
'CAN_USE_FPU_INSTRUCTIONS',
],
}],
[ 'v8_use_mips_abi_hardfloat=="true"', {
'defines': [
'__mips_hard_float=1',
'CAN_USE_FPU_INSTRUCTIONS',
],
}, {
'defines': [
'__mips_soft_float=1'
],
}],
],
'target_conditions': [
['_toolset=="target"', {
'conditions': [
['v8_target_arch==target_arch', {
# Target built with a Mips CXX compiler.
'cflags': [
'-EL',
'-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
],
'ldflags': ['-EL'],
'conditions': [
[ 'v8_use_mips_abi_hardfloat=="true"', {
'cflags': ['-mhard-float'],
'ldflags': ['-mhard-float'],
}, {
'cflags': ['-msoft-float'],
'ldflags': ['-msoft-float'],
}],
['mips_arch_variant=="r6"', {
'defines': [
'_MIPS_ARCH_MIPS32R6',
'FPU_MODE_FP64',
],
'cflags!': ['-mfp32', '-mfpxx'],
'conditions': [
[ 'clang==0', {
'cflags': ['-Wa,-mips32r6'],
}],
],
'cflags': ['-mips32r6'],
'ldflags': ['-mips32r6'],
}],
['mips_arch_variant=="r6" and mips_use_msa==1', {
'defines': [ '_MIPS_MSA' ],
}],
['mips_arch_variant=="r2"', {
'conditions': [
[ 'mips_fpu_mode=="fp64"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FP64',
],
'cflags': ['-mfp64'],
}],
['mips_fpu_mode=="fpxx"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FPXX',
],
'cflags': ['-mfpxx'],
}],
['mips_fpu_mode=="fp32"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FP32',
],
'cflags': ['-mfp32'],
}],
[ 'clang==0', {
'cflags': ['-Wa,-mips32r2'],
}],
],
'cflags': ['-mips32r2'],
'ldflags': ['-mips32r2'],
}],
['mips_arch_variant=="r1"', {
'defines': [
'FPU_MODE_FP32',
],
'cflags!': ['-mfp64', '-mfpxx'],
'conditions': [
[ 'clang==0', {
'cflags': ['-Wa,-mips32'],
}],
],
'cflags': ['-mips32'],
'ldflags': ['-mips32'],
}],
['mips_arch_variant=="rx"', {
'defines': [
'_MIPS_ARCH_MIPS32RX',
'FPU_MODE_FPXX',
],
'cflags!': ['-mfp64', '-mfp32'],
'conditions': [
[ 'clang==0', {
'cflags': ['-Wa,-mips32'],
}],
],
'cflags': ['-mips32', '-mfpxx'],
'ldflags': ['-mips32'],
}],
['mips_arch_variant=="loongson"', {
'defines': [
'_MIPS_ARCH_LOONGSON',
'FPU_MODE_FP32',
],
'cflags!': ['-mfp64', '-mfpxx'],
'conditions': [
[ 'clang==0', {
'cflags': ['-Wa,-mips3'],
}],
],
'cflags': ['-mips3', '-mfp32'],
}],
],
}, {
# 'v8_target_arch!=target_arch'
# Target not built with an MIPS CXX compiler (simulator build).
'conditions': [
['mips_arch_variant=="r6"', {
'defines': [
'_MIPS_ARCH_MIPS32R6',
'FPU_MODE_FP64',
],
}],
['mips_arch_variant=="r6" and mips_use_msa==1', {
'defines': [ '_MIPS_MSA' ],
}],
['mips_arch_variant=="r2"', {
'conditions': [
[ 'mips_fpu_mode=="fp64"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FP64',
],
}],
['mips_fpu_mode=="fpxx"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FPXX',
],
}],
['mips_fpu_mode=="fp32"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FP32',
],
}],
],
}],
['mips_arch_variant=="r1"', {
'defines': [
'FPU_MODE_FP32',
],
}],
['mips_arch_variant=="rx"', {
'defines': [
'_MIPS_ARCH_MIPS32RX',
'FPU_MODE_FPXX',
],
}],
['mips_arch_variant=="loongson"', {
'defines': [
'_MIPS_ARCH_LOONGSON',
'FPU_MODE_FP32',
],
}],
],
}],
],
}], #_toolset=="target
['_toolset=="host"', {
'conditions': [
['mips_arch_variant=="rx"', {
'defines': [
'_MIPS_ARCH_MIPS32RX',
'FPU_MODE_FPXX',
],
}],
['mips_arch_variant=="r6"', {
'defines': [
'_MIPS_ARCH_MIPS32R6',
'FPU_MODE_FP64',
],
}],
['mips_arch_variant=="r6" and mips_use_msa==1', {
'defines': [ '_MIPS_MSA' ],
}],
['mips_arch_variant=="r2"', {
'conditions': [
['mips_fpu_mode=="fp64"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FP64',
],
}],
['mips_fpu_mode=="fpxx"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FPXX',
],
}],
['mips_fpu_mode=="fp32"', {
'defines': [
'_MIPS_ARCH_MIPS32R2',
'FPU_MODE_FP32'
],
}],
],
}],
['mips_arch_variant=="r1"', {
'defines': ['FPU_MODE_FP32',],
}],
['mips_arch_variant=="loongson"', {
'defines': [
'_MIPS_ARCH_LOONGSON',
'FPU_MODE_FP32',
],
}],
]
}],
],
}], # v8_target_arch=="mipsel"
['v8_target_arch=="mips64el" or v8_target_arch=="mips64"', {
'defines': [
'V8_TARGET_ARCH_MIPS64',
],
'conditions': [
[ 'v8_can_use_fpu_instructions=="true"', {
'defines': [
'CAN_USE_FPU_INSTRUCTIONS',
],
}],
[ 'v8_host_byteorder=="little"', {
'defines': [
'V8_TARGET_ARCH_MIPS64_LE',
],
}],
[ 'v8_host_byteorder=="big"', {
'defines': [
'V8_TARGET_ARCH_MIPS64_BE',
],
}],
[ 'v8_use_mips_abi_hardfloat=="true"', {
'defines': [
'__mips_hard_float=1',
'CAN_USE_FPU_INSTRUCTIONS',
],
}, {
'defines': [
'__mips_soft_float=1'
],
}],
],
'target_conditions': [
['_toolset=="target"', {
'conditions': [
['v8_target_arch==target_arch', {
'cflags': [
'-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
],
'conditions': [
['v8_target_arch=="mips64el"', {
'cflags': ['-EL'],
'ldflags': ['-EL'],
}],
['v8_target_arch=="mips64"', {
'cflags': ['-EB'],
'ldflags': ['-EB'],
}],
[ 'v8_use_mips_abi_hardfloat=="true"', {
'cflags': ['-mhard-float'],
'ldflags': ['-mhard-float'],
}, {
'cflags': ['-msoft-float'],
'ldflags': ['-msoft-float'],
}],
['mips_arch_variant=="r6"', {
'defines': ['_MIPS_ARCH_MIPS64R6',],
'conditions': [
[ 'clang==0', {
'cflags': ['-Wa,-mips64r6'],
}],
],
'cflags': ['-mips64r6', '-mabi=64'],
'ldflags': ['-mips64r6', '-mabi=64'],
}],
['mips_arch_variant=="r6" and mips_use_msa==1', {
'defines': [ '_MIPS_MSA' ],
}],
['mips_arch_variant=="r2"', {
'defines': ['_MIPS_ARCH_MIPS64R2',],
'conditions': [
[ 'clang==0', {
'cflags': ['-Wa,-mips64r2'],
}],
],
'cflags': ['-mips64r2', '-mabi=64'],
'ldflags': ['-mips64r2', '-mabi=64'],
}],
],
}, {
# 'v8_target_arch!=target_arch'
# Target not built with an MIPS CXX compiler (simulator build).
'conditions': [
['mips_arch_variant=="r6"', {
'defines': ['_MIPS_ARCH_MIPS64R6',],
}],
['mips_arch_variant=="r6" and mips_use_msa==1', {
'defines': [ '_MIPS_MSA' ],
}],
['mips_arch_variant=="r2"', {
'defines': ['_MIPS_ARCH_MIPS64R2',],
}],
],
}],
],
}], #'_toolset=="target"
['_toolset=="host"', {
'conditions': [
['mips_arch_variant=="r6"', {
'defines': ['_MIPS_ARCH_MIPS64R6',],
}],
['mips_arch_variant=="r6" and mips_use_msa==1', {
'defines': [ '_MIPS_MSA' ],
}],
['mips_arch_variant=="r2"', {
'defines': ['_MIPS_ARCH_MIPS64R2',],
}],
],
}], #'_toolset=="host"
],
}], # v8_target_arch=="mips64el"
['v8_target_arch=="x64"', {
'defines': [
'V8_TARGET_ARCH_X64',
],
'xcode_settings': {
'ARCHS': [ 'x86_64' ],
},
'msvs_settings': {
'VCLinkerTool': {
'StackReserveSize': '2097152',
},
},
'msvs_configuration_platform': 'x64',
}], # v8_target_arch=="x64"
['v8_target_arch=="x32"', {
'defines': [
# x32 port shares the source code with x64 port.
'V8_TARGET_ARCH_X64',
'V8_TARGET_ARCH_32_BIT',
],
'cflags': [
'-mx32',
# Inhibit warning if long long type is used.
'-Wno-long-long',
],
'ldflags': [
'-mx32',
],
}], # v8_target_arch=="x32"
['linux_use_gold_flags==1', {
# Newer gccs and clangs support -fuse-ld, use the flag to force gold
# selection.
# gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
'ldflags': [ '-fuse-ld=gold', ],
}],
['linux_use_bundled_binutils==1', {
'cflags': [
'-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
],
}],
['linux_use_bundled_gold==1', {
# Put our binutils, which contains gold in the search path. We pass
# the path to gold to the compiler. gyp leaves unspecified what the
# cwd is when running the compiler, so the normal gyp path-munging
# fails us. This hack gets the right path.
'ldflags': [
'-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
],
}],
['OS=="win"', {
'defines': [
'WIN32',
],
# 4351: VS 2005 and later are warning us that they've fixed a bug
# present in VS 2003 and earlier.
'msvs_disabled_warnings': [4351],
'msvs_configuration_attributes': {
'CharacterSet': '1',
},
}],
['OS=="win" and v8_target_arch=="ia32"', {
'msvs_settings': {
'VCCLCompilerTool': {
# Ensure no surprising artifacts from 80bit double math with x86.
'AdditionalOptions': ['/arch:SSE2'],
},
},
}],
['OS=="win" and v8_enable_prof==1', {
'msvs_settings': {
'VCLinkerTool': {
'GenerateMapFile': 'true',
},
},
}],
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
v8_target_arch=="ia32"', {
'cflags': [
'-msse2',
'-mfpmath=sse',
'-mmmx', # Allows mmintrin.h for MMX intrinsics.
],
}],
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
(v8_target_arch=="arm" or v8_target_arch=="ia32" or \
v8_target_arch=="mips" or v8_target_arch=="mipsel" or \
v8_target_arch=="ppc" or v8_target_arch=="s390")', {
'target_conditions': [
['_toolset=="host"', {
'conditions': [
['host_cxx_is_biarch==1', {
'conditions': [
['host_arch=="s390" or host_arch=="s390x"', {
'cflags': [ '-m31' ],
'ldflags': [ '-m31' ]
},{
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ]
}],
],
}],
],
'xcode_settings': {
'ARCHS': [ 'i386' ],
},
}],
['_toolset=="target"', {
'conditions': [
['target_cxx_is_biarch==1', {
'conditions': [
['host_arch=="s390" or host_arch=="s390x"', {
'cflags': [ '-m31' ],
'ldflags': [ '-m31' ]
},{
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
}],
],
}],
],
'xcode_settings': {
'ARCHS': [ 'i386' ],
},
}],
],
}],
['(OS=="linux" or OS=="android") and \
(v8_target_arch=="x64" or v8_target_arch=="arm64" or \
v8_target_arch=="ppc64" or v8_target_arch=="s390x")', {
'target_conditions': [
['_toolset=="host"', {
'conditions': [
['host_cxx_is_biarch==1', {
'cflags': [ '-m64' ],
'ldflags': [ '-m64' ]
}],
],
}],
['_toolset=="target"', {
'conditions': [
['target_cxx_is_biarch==1', {
'cflags': [ '-m64' ],
'ldflags': [ '-m64' ],
}],
]
}],
],
}],
['OS=="android" and v8_android_log_stdout==1', {
'defines': [
'V8_ANDROID_LOG_STDOUT',
],
}],
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd" or OS=="qnx" or OS=="aix"', {
'conditions': [
[ 'v8_no_strict_aliasing==1', {
'cflags': [ '-fno-strict-aliasing' ],
}],
], # conditions
}],
['OS=="solaris"', {
'defines': [ '__C99FEATURES__=1' ], # isinf() etc.
}],
['OS=="freebsd" or OS=="openbsd"', {
'cflags': [ '-I/usr/local/include' ],
}],
['OS=="netbsd"', {
'cflags': [ '-I/usr/pkg/include' ],
}],
['OS=="aix"', {
'defines': [
# Support for malloc(0)
'_LINUX_SOURCE_COMPAT=1',
'__STDC_FORMAT_MACROS',
'_ALL_SOURCE=1'],
'conditions': [
[ 'v8_target_arch=="ppc"', {
'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ],
}],
[ 'v8_target_arch=="ppc64"', {
'cflags': [ '-maix64' ],
'ldflags': [ '-maix64 -Wl,-bbigtoc' ],
}],
],
}],
], # conditions
'configurations': {
# Abstract configuration for v8_optimized_debug == 0.
'DebugBase0': {
'abstract': 1,
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': '0',
'conditions': [
['component=="shared_library" or force_dynamic_crt==1', {
'RuntimeLibrary': '3', # /MDd
}, {
'RuntimeLibrary': '1', # /MTd
}],
],
},
'VCLinkerTool': {
'LinkIncremental': '2',
},
},
'variables': {
'v8_enable_slow_dchecks%': 1,
},
'conditions': [
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
OS=="qnx" or OS=="aix"', {
'cflags!': [
'-O3',
'-O2',
'-O1',
'-Os',
],
'cflags': [
'-fdata-sections',
'-ffunction-sections',
],
}],
['OS=="mac"', {
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '0', # -O0
},
}],
['v8_enable_slow_dchecks==1', {
'defines': [
'ENABLE_SLOW_DCHECKS',
],
}],
],
}, # DebugBase0
# Abstract configuration for v8_optimized_debug == 1.
'DebugBase1': {
'abstract': 1,
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': '2',
'InlineFunctionExpansion': '2',
'EnableIntrinsicFunctions': 'true',
'FavorSizeOrSpeed': '0',
'StringPooling': 'true',
'BasicRuntimeChecks': '0',
'conditions': [
['component=="shared_library" or force_dynamic_crt==1', {
'RuntimeLibrary': '3', #/MDd
}, {
'RuntimeLibrary': '1', #/MTd
}],
],
},
'VCLinkerTool': {
'LinkIncremental': '1',
'OptimizeReferences': '2',
'EnableCOMDATFolding': '2',
},
},
'variables': {
'v8_enable_slow_dchecks%': 0,
},
'conditions': [
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
OS=="qnx" or OS=="aix"', {
'cflags!': [
'-O0',
'-O1',
'-Os',
],
'cflags': [
'-fdata-sections',
'-ffunction-sections',
],
'conditions': [
# Don't use -O3 with sanitizers.
['asan==0 and msan==0 and lsan==0 \
and tsan==0 and ubsan==0 and ubsan_vptr==0', {
'cflags': ['-O3'],
'cflags!': ['-O2'],
}, {
'cflags': ['-O2'],
'cflags!': ['-O3'],
}],
],
}],
['OS=="mac"', {
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '3', # -O3
'GCC_STRICT_ALIASING': 'YES',
},
}],
['v8_enable_slow_dchecks==1', {
'defines': [
'ENABLE_SLOW_DCHECKS',
],
}],
],
}, # DebugBase1
# Common settings for the Debug configuration.
'DebugBaseCommon': {
'abstract': 1,
'defines': [
'ENABLE_DISASSEMBLER',
'V8_ENABLE_CHECKS',
'OBJECT_PRINT',
'VERIFY_HEAP',
'DEBUG',
'V8_TRACE_MAPS',
'V8_ENABLE_ALLOCATION_TIMEOUT',
'V8_ENABLE_FORCE_SLOW_PATH',
],
'conditions': [
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
OS=="qnx" or OS=="aix"', {
'cflags': [ '-Woverloaded-virtual', '<(wno_array_bounds)', ],
}],
['OS=="linux" and v8_enable_backtrace==1', {
# Support for backtrace_symbols.
'ldflags': [ '-rdynamic' ],
}],
['OS=="linux" and disable_glibcxx_debug==0', {
# Enable libstdc++ debugging facilities to help catch problems
# early, see http://crbug.com/65151 .
'defines': ['_GLIBCXX_DEBUG=1',],
}],
['OS=="aix"', {
'ldflags': [ '-Wl,-bbigtoc' ],
'conditions': [
['v8_target_arch=="ppc64"', {
'cflags': [ '-maix64 -mcmodel=large' ],
}],
],
}],
['OS=="android"', {
'variables': {
'android_full_debug%': 1,
},
'conditions': [
['android_full_debug==0', {
# Disable full debug if we want a faster v8 in a debug build.
# TODO(2304): pass DISABLE_DEBUG_ASSERT instead of hiding DEBUG.
'defines!': [
'DEBUG',
'ENABLE_SLOW_DCHECKS',
],
}],
],
}],
['linux_use_gold_flags==1', {
'target_conditions': [
['_toolset=="target"', {
'ldflags': [
# Experimentation found that using four linking threads
# saved ~20% of link time.
# https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
# Only apply this to the target linker, since the host
# linker might not be gold, but isn't used much anyway.
'-Wl,--threads',
'-Wl,--thread-count=4',
],
}],
],
}],
],
}, # DebugBaseCommon
'Debug': {
'inherit_from': ['DebugBaseCommon'],
'conditions': [
['v8_optimized_debug==0', {
'inherit_from': ['DebugBase0'],
}, {
'inherit_from': ['DebugBase1'],
}],
],
}, # Debug
'ReleaseBase': {
'abstract': 1,
'variables': {
'v8_enable_slow_dchecks%': 0,
},
'conditions': [
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
or OS=="aix"', {
'cflags!': [
'-Os',
],
'cflags': [
'-fdata-sections',
'-ffunction-sections',
'<(wno_array_bounds)',
],
'conditions': [
# Don't use -O3 with sanitizers.
['asan==0 and msan==0 and lsan==0 \
and tsan==0 and ubsan==0 and ubsan_vptr==0', {
'cflags': ['-O3'],
'cflags!': ['-O2'],
}, {
'cflags': ['-O2'],
'cflags!': ['-O3'],
}],
],
}],
['OS=="android"', {
'cflags!': [
'-O3',
'-Os',
],
'cflags': [
'-fdata-sections',
'-ffunction-sections',
'-O2',
],
}],
['OS=="mac"', {
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '3', # -O3
# -fstrict-aliasing. Mainline gcc
# enables this at -O2 and above,
# but Apple gcc does not unless it
# is specified explicitly.
'GCC_STRICT_ALIASING': 'YES',
},
}], # OS=="mac"
['OS=="win"', {
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': '2',
'InlineFunctionExpansion': '2',
'EnableIntrinsicFunctions': 'true',
'FavorSizeOrSpeed': '0',
'StringPooling': 'true',
'conditions': [
['component=="shared_library" or force_dynamic_crt==1', {
'RuntimeLibrary': '2', #/MD
}, {
'RuntimeLibrary': '0', #/MT
}],
],
},
'VCLinkerTool': {
'LinkIncremental': '1',
'OptimizeReferences': '2',
'EnableCOMDATFolding': '2',
},
},
}], # OS=="win"
['v8_enable_slow_dchecks==1', {
'defines': [
'ENABLE_SLOW_DCHECKS',
],
}],
], # conditions
}, # Release
'Release': {
'inherit_from': ['ReleaseBase'],
}, # Debug
'conditions': [
[ 'OS=="win"', {
# TODO(bradnelson): add a gyp mechanism to make this more graceful.
'Debug_x64': {
'inherit_from': ['DebugBaseCommon'],
'conditions': [
['v8_optimized_debug==0', {
'inherit_from': ['DebugBase0'],
}, {
'inherit_from': ['DebugBase1'],
}],
],
},
'Release_x64': {
'inherit_from': ['ReleaseBase'],
},
}],
],
}, # configurations
}, # target_defaults
}
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# The sources are kept automatically in sync with BUILD.gn.
{
'variables': {
'v8_code': 1,
'unittests_sources': [
'../test/unittests/allocation-unittest.cc',
'../test/unittests/api/access-check-unittest.cc',
'../test/unittests/api/exception-unittest.cc',
'../test/unittests/api/interceptor-unittest.cc',
'../test/unittests/api/isolate-unittest.cc',
'../test/unittests/api/remote-object-unittest.cc',
'../test/unittests/api/v8-object-unittest.cc',
'../test/unittests/asmjs/asm-scanner-unittest.cc',
'../test/unittests/asmjs/asm-types-unittest.cc',
'../test/unittests/asmjs/switch-logic-unittest.cc',
'../test/unittests/base/atomic-utils-unittest.cc',
'../test/unittests/base/bits-unittest.cc',
'../test/unittests/base/cpu-unittest.cc',
'../test/unittests/base/division-by-constant-unittest.cc',
'../test/unittests/base/flags-unittest.cc',
'../test/unittests/base/functional-unittest.cc',
'../test/unittests/base/ieee754-unittest.cc',
'../test/unittests/base/logging-unittest.cc',
'../test/unittests/base/macros-unittest.cc',
'../test/unittests/base/iterator-unittest.cc',
'../test/unittests/base/ostreams-unittest.cc',
'../test/unittests/base/platform/condition-variable-unittest.cc',
'../test/unittests/base/platform/mutex-unittest.cc',
'../test/unittests/base/platform/platform-unittest.cc',
'../test/unittests/base/platform/semaphore-unittest.cc',
'../test/unittests/base/platform/time-unittest.cc',
'../test/unittests/base/sys-info-unittest.cc',
'../test/unittests/base/template-utils-unittest.cc',
'../test/unittests/base/utils/random-number-generator-unittest.cc',
'../test/unittests/bigint-unittest.cc',
'../test/unittests/cancelable-tasks-unittest.cc',
'../test/unittests/char-predicates-unittest.cc',
"../test/unittests/code-stub-assembler-unittest.cc",
"../test/unittests/code-stub-assembler-unittest.h",
'../test/unittests/compiler/branch-elimination-unittest.cc',
'../test/unittests/compiler/bytecode-analysis-unittest.cc',
'../test/unittests/compiler/checkpoint-elimination-unittest.cc',
"../test/unittests/compiler/code-assembler-unittest.cc",
"../test/unittests/compiler/code-assembler-unittest.h",
'../test/unittests/compiler/common-operator-reducer-unittest.cc',
'../test/unittests/compiler/common-operator-unittest.cc',
'../test/unittests/compiler/compiler-test-utils.h',
'../test/unittests/compiler/control-equivalence-unittest.cc',
'../test/unittests/compiler/control-flow-optimizer-unittest.cc',
'../test/unittests/compiler/dead-code-elimination-unittest.cc',
'../test/unittests/compiler/diamond-unittest.cc',
'../test/unittests/compiler/effect-control-linearizer-unittest.cc',
'../test/unittests/compiler/graph-reducer-unittest.cc',
'../test/unittests/compiler/graph-reducer-unittest.h',
'../test/unittests/compiler/graph-trimmer-unittest.cc',
'../test/unittests/compiler/graph-unittest.cc',
'../test/unittests/compiler/graph-unittest.h',
'../test/unittests/compiler/instruction-unittest.cc',
'../test/unittests/compiler/instruction-selector-unittest.cc',
'../test/unittests/compiler/instruction-selector-unittest.h',
'../test/unittests/compiler/instruction-sequence-unittest.cc',
'../test/unittests/compiler/instruction-sequence-unittest.h',
'../test/unittests/compiler/int64-lowering-unittest.cc',
'../test/unittests/compiler/js-builtin-reducer-unittest.cc',
'../test/unittests/compiler/js-create-lowering-unittest.cc',
'../test/unittests/compiler/js-intrinsic-lowering-unittest.cc',
'../test/unittests/compiler/js-operator-unittest.cc',
'../test/unittests/compiler/js-typed-lowering-unittest.cc',
'../test/unittests/compiler/linkage-tail-call-unittest.cc',
'../test/unittests/compiler/live-range-builder.h',
'../test/unittests/compiler/regalloc/live-range-unittest.cc',
'../test/unittests/compiler/load-elimination-unittest.cc',
'../test/unittests/compiler/loop-peeling-unittest.cc',
'../test/unittests/compiler/machine-operator-reducer-unittest.cc',
'../test/unittests/compiler/machine-operator-unittest.cc',
'../test/unittests/compiler/regalloc/move-optimizer-unittest.cc',
'../test/unittests/compiler/node-cache-unittest.cc',
'../test/unittests/compiler/node-matchers-unittest.cc',
'../test/unittests/compiler/node-properties-unittest.cc',
'../test/unittests/compiler/node-test-utils.cc',
'../test/unittests/compiler/node-test-utils.h',
'../test/unittests/compiler/node-unittest.cc',
'../test/unittests/compiler/opcodes-unittest.cc',
'../test/unittests/compiler/persistent-unittest.cc',
'../test/unittests/compiler/regalloc/register-allocator-unittest.cc',
'../test/unittests/compiler/schedule-unittest.cc',
'../test/unittests/compiler/scheduler-unittest.cc',
'../test/unittests/compiler/scheduler-rpo-unittest.cc',
'../test/unittests/compiler/simplified-lowering-unittest.cc',
'../test/unittests/compiler/simplified-operator-reducer-unittest.cc',
'../test/unittests/compiler/simplified-operator-unittest.cc',
'../test/unittests/compiler/state-values-utils-unittest.cc',
'../test/unittests/compiler/typed-optimization-unittest.cc',
'../test/unittests/compiler/typer-unittest.cc',
'../test/unittests/compiler/value-numbering-reducer-unittest.cc',
'../test/unittests/compiler/zone-stats-unittest.cc',
'../test/unittests/compiler-dispatcher/compiler-dispatcher-tracer-unittest.cc',
'../test/unittests/compiler-dispatcher/compiler-dispatcher-unittest.cc',
'../test/unittests/compiler-dispatcher/optimizing-compile-dispatcher-unittest.cc',
'../test/unittests/compiler-dispatcher/unoptimized-compile-job-unittest.cc',
'../test/unittests/counters-unittest.cc',
'../test/unittests/detachable-vector-unittest.cc',
'../test/unittests/eh-frame-iterator-unittest.cc',
'../test/unittests/eh-frame-writer-unittest.cc',
'../test/unittests/heap/barrier-unittest.cc',
'../test/unittests/heap/bitmap-unittest.cc',
'../test/unittests/heap/embedder-tracing-unittest.cc',
'../test/unittests/heap/gc-idle-time-handler-unittest.cc',
'../test/unittests/heap/gc-tracer-unittest.cc',
'../test/unittests/heap/item-parallel-job-unittest.cc',
'../test/unittests/heap/marking-unittest.cc',
'../test/unittests/heap/memory-reducer-unittest.cc',
'../test/unittests/heap/object-stats-unittest.cc',
'../test/unittests/heap/heap-unittest.cc',
'../test/unittests/heap/scavenge-job-unittest.cc',
'../test/unittests/heap/slot-set-unittest.cc',
'../test/unittests/heap/spaces-unittest.cc',
'../test/unittests/heap/unmapper-unittest.cc',
'../test/unittests/heap/worklist-unittest.cc',
'../test/unittests/interpreter/bytecodes-unittest.cc',
'../test/unittests/interpreter/bytecode-array-builder-unittest.cc',
'../test/unittests/interpreter/bytecode-array-iterator-unittest.cc',
'../test/unittests/interpreter/bytecode-array-random-iterator-unittest.cc',
'../test/unittests/interpreter/bytecode-array-writer-unittest.cc',
'../test/unittests/interpreter/bytecode-decoder-unittest.cc',
'../test/unittests/interpreter/bytecode-node-unittest.cc',
'../test/unittests/interpreter/bytecode-operands-unittest.cc',
'../test/unittests/interpreter/bytecode-register-allocator-unittest.cc',
'../test/unittests/interpreter/bytecode-register-optimizer-unittest.cc',
'../test/unittests/interpreter/bytecode-source-info-unittest.cc',
'../test/unittests/interpreter/bytecode-utils.h',
'../test/unittests/interpreter/constant-array-builder-unittest.cc',
'../test/unittests/interpreter/interpreter-assembler-unittest.cc',
'../test/unittests/interpreter/interpreter-assembler-unittest.h',
'../test/unittests/libplatform/default-platform-unittest.cc',
'../test/unittests/libplatform/task-queue-unittest.cc',
'../test/unittests/libplatform/worker-thread-unittest.cc',
'../test/unittests/locked-queue-unittest.cc',
'../test/unittests/object-unittest.cc',
'../test/unittests/parser/ast-value-unittest.cc',
'../test/unittests/parser/preparser-unittest.cc',
'../test/unittests/register-configuration-unittest.cc',
'../test/unittests/run-all-unittests.cc',
'../test/unittests/source-position-table-unittest.cc',
'../test/unittests/test-helpers.cc',
'../test/unittests/test-helpers.h',
'../test/unittests/test-utils.h',
'../test/unittests/test-utils.cc',
'../test/unittests/unicode-unittest.cc',
'../test/unittests/utils-unittest.cc',
'../test/unittests/value-serializer-unittest.cc',
'../test/unittests/zone/segmentpool-unittest.cc',
'../test/unittests/zone/zone-allocator-unittest.cc',
'../test/unittests/zone/zone-chunk-list-unittest.cc',
'../test/unittests/zone/zone-unittest.cc',
'../test/unittests/wasm/control-transfer-unittest.cc',
'../test/unittests/wasm/decoder-unittest.cc',
'../test/unittests/wasm/function-body-decoder-unittest.cc',
'../test/unittests/wasm/wasm-code-manager-unittest.cc',
'../test/unittests/wasm/leb-helper-unittest.cc',
'../test/unittests/wasm/loop-assignment-analysis-unittest.cc',
'../test/unittests/wasm/module-decoder-unittest.cc',
'../test/unittests/wasm/streaming-decoder-unittest.cc',
'../test/unittests/wasm/trap-handler-unittest.cc',
'../test/unittests/wasm/wasm-macro-gen-unittest.cc',
'../test/unittests/wasm/wasm-module-builder-unittest.cc',
'../test/unittests/wasm/wasm-opcodes-unittest.cc',
],
'unittests_sources_arm': [
'../test/unittests/compiler/arm/instruction-selector-arm-unittest.cc',
],
'unittests_sources_arm64': [
'../test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc',
],
'unittests_sources_ia32': [
'../test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc',
],
'unittests_sources_mips': [
'../test/unittests/compiler/mips/instruction-selector-mips-unittest.cc',
],
'unittests_sources_mips64': [
'../test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc',
],
'unittests_sources_x64': [
'../test/unittests/compiler/x64/instruction-selector-x64-unittest.cc',
],
'unittests_sources_ppc': [
'../test/unittests/compiler/ppc/instruction-selector-ppc-unittest.cc',
],
'unittests_sources_s390': [
'../test/unittests/compiler/s390/instruction-selector-s390-unittest.cc',
],
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'unittests',
'type': 'executable',
'variables': {
'optimize': 'max',
},
'dependencies': [
'gmock.gyp:gmock',
'gtest.gyp:gtest',
'v8.gyp:v8',
'v8.gyp:v8_libbase',
'v8.gyp:v8_libplatform',
'v8.gyp:v8_maybe_snapshot',
],
'include_dirs': [
'..',
],
'sources': [
'<@(unittests_sources)',
],
'conditions': [
['v8_target_arch=="arm"', {
'sources': [
'<@(unittests_sources_arm)',
],
}],
['v8_target_arch=="arm64"', {
'sources': [
'<@(unittests_sources_arm64)',
],
}],
['v8_target_arch=="ia32"', {
'sources': [
'<@(unittests_sources_ia32)',
],
}],
['v8_target_arch=="mips"', {
'sources': [
'<@(unittests_sources_mips)',
],
}],
['v8_target_arch=="mipsel"', {
'sources': [
'<@(unittests_sources_mips)',
],
}],
['v8_target_arch=="mips64"', {
'sources': [
'<@(unittests_sources_mips64)',
],
}],
['v8_target_arch=="mips64el"', {
'sources': [
'<@(unittests_sources_mips64)',
],
}],
['v8_target_arch=="x64"', {
'sources': [
'<@(unittests_sources_x64)',
],
}],
['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
'sources': [
'<@(unittests_sources_ppc)',
],
}],
['v8_target_arch=="s390" or v8_target_arch=="s390x"', {
'sources': [
'<@(unittests_sources_s390)',
],
}],
['OS=="aix"', {
'ldflags': [ '-Wl,-bbigtoc' ],
}],
['v8_enable_i18n_support==1', {
'dependencies': [
'<(icu_gyp_path):icui18n',
'<(icu_gyp_path):icuuc',
],
}],
['v8_use_snapshot=="true"', {
'dependencies': ['v8.gyp:v8_initializers'],
}],
],
},
],
}
# Copyright 2012 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'v8_code': 1,
},
'includes': ['toolchain.gypi', 'features.gypi'],
'targets': [
{
'target_name': 'v8_vtune',
'type': 'static_library',
'dependencies': [
'v8.gyp:v8',
],
'sources': [
'../src/third_party/vtune/ittnotify_config.h',
'../src/third_party/vtune/ittnotify_types.h',
'../src/third_party/vtune/jitprofiling.cc',
'../src/third_party/vtune/jitprofiling.h',
'../src/third_party/vtune/v8-vtune.h',
'../src/third_party/vtune/vtune-jit.cc',
'../src/third_party/vtune/vtune-jit.h',
],
'direct_dependent_settings': {
'defines': ['ENABLE_VTUNE_JIT_INTERFACE',],
'conditions': [
['OS != "win"', {
'libraries': ['-ldl',],
}],
],
},
},
],
}
#!/usr/bin/env python
# Copyright 2015 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Script to print potentially missing source dependencies based on the actual
.h and .cc files in the source tree and which files are included in the gyp
and gn files. The latter inclusion is overapproximated.
TODO(machenbach): If two source files with the same name exist, but only one
is referenced from a gyp/gn file, we won't necessarily detect it.
"""
import itertools
import re
import os
import subprocess
import sys
V8_BASE = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
GYP_FILES = [
os.path.join(V8_BASE, 'gypfiles', 'd8.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'v8.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'inspector.gypi'),
os.path.join(V8_BASE, 'gypfiles', 'v8vtune.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'samples.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'cctest.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'fuzzer.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'unittests.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'inspector-test.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'mkgrokdump.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'gmock.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'gtest.gyp'),
os.path.join(V8_BASE, 'gypfiles', 'parser-shell.gyp'),
]
ALL_GYP_PREFIXES = [
'..',
'common',
os.path.join('src', 'third_party', 'vtune'),
'src',
'samples',
'testing',
'tools',
os.path.join('test', 'cctest'),
os.path.join('test', 'common'),
os.path.join('test', 'fuzzer'),
os.path.join('test', 'unittests'),
os.path.join('test', 'inspector'),
os.path.join('test', 'mkgrokdump'),
]
GYP_UNSUPPORTED_FEATURES = [
'gcmole',
'setup-isolate-deserialize.cc',
'v8-version.h'
]
GN_FILES = [
os.path.join(V8_BASE, 'BUILD.gn'),
os.path.join(V8_BASE, 'build', 'secondary', 'testing', 'gmock', 'BUILD.gn'),
os.path.join(V8_BASE, 'build', 'secondary', 'testing', 'gtest', 'BUILD.gn'),
os.path.join(V8_BASE, 'src', 'inspector', 'BUILD.gn'),
os.path.join(V8_BASE, 'test', 'cctest', 'BUILD.gn'),
os.path.join(V8_BASE, 'test', 'unittests', 'BUILD.gn'),
os.path.join(V8_BASE, 'test', 'inspector', 'BUILD.gn'),
os.path.join(V8_BASE, 'test', 'mkgrokdump', 'BUILD.gn'),
os.path.join(V8_BASE, 'tools', 'BUILD.gn'),
]
GN_UNSUPPORTED_FEATURES = [
'aix',
'cygwin',
'freebsd',
'gcmole',
'openbsd',
'ppc',
'qnx',
'solaris',
'vtune',
'v8-version.h',
]
ALL_GN_PREFIXES = [
'..',
os.path.join('src', 'inspector'),
'src',
'testing',
os.path.join('test', 'cctest'),
os.path.join('test', 'unittests'),
os.path.join('test', 'inspector'),
os.path.join('test', 'mkgrokdump'),
]
def pathsplit(path):
return re.split('[/\\\\]', path)
def path_no_prefix(path, prefixes):
for prefix in prefixes:
if path.startswith(prefix + os.sep):
return path_no_prefix(path[len(prefix) + 1:], prefixes)
return path
def isources(prefixes):
cmd = ['git', 'ls-tree', '-r', 'HEAD', '--full-name', '--name-only']
for f in subprocess.check_output(cmd, universal_newlines=True).split('\n'):
if not (f.endswith('.h') or f.endswith('.cc')):
continue
yield path_no_prefix(os.path.join(*pathsplit(f)), prefixes)
def iflatten(obj):
if isinstance(obj, dict):
for value in obj.values():
for i in iflatten(value):
yield i
elif isinstance(obj, list):
for value in obj:
for i in iflatten(value):
yield i
elif isinstance(obj, basestring):
yield path_no_prefix(os.path.join(*pathsplit(obj)), ALL_GYP_PREFIXES)
def iflatten_gyp_file(gyp_file):
"""Overaproximates all values in the gyp file.
Iterates over all string values recursively. Removes '../' path prefixes.
"""
with open(gyp_file) as f:
return iflatten(eval(f.read()))
def iflatten_gn_file(gn_file):
"""Overaproximates all values in the gn file.
Iterates over all double quoted strings.
"""
with open(gn_file) as f:
for line in f.read().splitlines():
match = re.match(r'.*"([^"]*)".*', line)
if match:
yield path_no_prefix(
os.path.join(*pathsplit(match.group(1))), ALL_GN_PREFIXES)
def icheck_values(values, prefixes):
for source_file in isources(prefixes):
if source_file not in values:
yield source_file
def missing_gyp_files():
gyp_values = set(itertools.chain(
*[iflatten_gyp_file(gyp_file) for gyp_file in GYP_FILES]
))
gyp_files = sorted(icheck_values(gyp_values, ALL_GYP_PREFIXES))
return filter(
lambda x: not any(i in x for i in GYP_UNSUPPORTED_FEATURES), gyp_files)
def missing_gn_files():
gn_values = set(itertools.chain(
*[iflatten_gn_file(gn_file) for gn_file in GN_FILES]
))
gn_files = sorted(icheck_values(gn_values, ALL_GN_PREFIXES))
return filter(
lambda x: not any(i in x for i in GN_UNSUPPORTED_FEATURES), gn_files)
def main():
print "----------- Files not in gyp: ------------"
for i in missing_gyp_files():
print i
print "\n----------- Files not in gn: -------------"
for i in missing_gn_files():
print i
return 0
if '__main__' == __name__:
sys.exit(main())
#!/usr/bin/env python
# Copyright 2016 the V8 project authors. All rights reserved.
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Given the output of -t commands from a ninja build for a gyp and GN generated
build, report on differences between the command lines."""
import os
import shlex
import subprocess
import sys
# Must be in v8/.
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.chdir(BASE_DIR)
g_total_differences = 0
def FindAndRemoveArgWithValue(command_line, argname):
"""Given a command line as a list, remove and return the value of an option
that takes a value as a separate entry.
Modifies |command_line| in place.
"""
if argname not in command_line:
return ''
location = command_line.index(argname)
value = command_line[location + 1]
command_line[location:location + 2] = []
return value
def MergeSpacedArgs(command_line, argname):
"""Combine all arguments |argname| with their values, separated by a space."""
i = 0
result = []
while i < len(command_line):
arg = command_line[i]
if arg == argname:
result.append(arg + ' ' + command_line[i + 1])
i += 1
else:
result.append(arg)
i += 1
return result
def NormalizeSymbolArguments(command_line):
"""Normalize -g arguments.
If there's no -g args, it's equivalent to -g0. -g2 is equivalent to -g.
Modifies |command_line| in place.
"""
# Strip -g0 if there's no symbols.
have_some_symbols = False
for x in command_line:
if x.startswith('-g') and x != '-g0':
have_some_symbols = True
if not have_some_symbols and '-g0' in command_line:
command_line.remove('-g0')
# Rename -g2 to -g.
if '-g2' in command_line:
command_line[command_line.index('-g2')] = '-g'
def GetFlags(lines, build_dir):
"""Turn a list of command lines into a semi-structured dict."""
is_win = sys.platform == 'win32'
flags_by_output = {}
for line in lines:
command_line = shlex.split(line.strip(), posix=not is_win)[1:]
output_name = FindAndRemoveArgWithValue(command_line, '-o')
dep_name = FindAndRemoveArgWithValue(command_line, '-MF')
NormalizeSymbolArguments(command_line)
command_line = MergeSpacedArgs(command_line, '-Xclang')
cc_file = [x for x in command_line if x.endswith('.cc') or
x.endswith('.c') or
x.endswith('.cpp')]
if len(cc_file) != 1:
print 'Skipping %s' % command_line
continue
assert len(cc_file) == 1
if is_win:
rsp_file = [x for x in command_line if x.endswith('.rsp')]
assert len(rsp_file) <= 1
if rsp_file:
rsp_file = os.path.join(build_dir, rsp_file[0][1:])
with open(rsp_file, "r") as open_rsp_file:
command_line = shlex.split(open_rsp_file, posix=False)
defines = [x for x in command_line if x.startswith('-D')]
include_dirs = [x for x in command_line if x.startswith('-I')]
dash_f = [x for x in command_line if x.startswith('-f')]
warnings = \
[x for x in command_line if x.startswith('/wd' if is_win else '-W')]
others = [x for x in command_line if x not in defines and \
x not in include_dirs and \
x not in dash_f and \
x not in warnings and \
x not in cc_file]
for index, value in enumerate(include_dirs):
if value == '-Igen':
continue
path = value[2:]
if not os.path.isabs(path):
path = os.path.join(build_dir, path)
include_dirs[index] = '-I' + os.path.normpath(path)
# GYP supports paths above the source root like <(DEPTH)/../foo while such
# paths are unsupported by gn. But gn allows to use system-absolute paths
# instead (paths that start with single '/'). Normalize all paths.
cc_file = [os.path.normpath(os.path.join(build_dir, cc_file[0]))]
# Filter for libFindBadConstructs.so having a relative path in one and
# absolute path in the other.
others_filtered = []
for x in others:
if x.startswith('-Xclang ') and x.endswith('libFindBadConstructs.so'):
others_filtered.append(
'-Xclang ' +
os.path.join(os.getcwd(),
os.path.normpath(
os.path.join('out/gn_flags', x.split(' ', 1)[1]))))
elif x.startswith('-B'):
others_filtered.append(
'-B' +
os.path.join(os.getcwd(),
os.path.normpath(os.path.join('out/gn_flags', x[2:]))))
else:
others_filtered.append(x)
others = others_filtered
flags_by_output[cc_file[0]] = {
'output': output_name,
'depname': dep_name,
'defines': sorted(defines),
'include_dirs': sorted(include_dirs), # TODO(scottmg): This is wrong.
'dash_f': sorted(dash_f),
'warnings': sorted(warnings),
'other': sorted(others),
}
return flags_by_output
def CompareLists(gyp, gn, name, dont_care_gyp=None, dont_care_gn=None):
"""Return a report of any differences between gyp and gn lists, ignoring
anything in |dont_care_{gyp|gn}| respectively."""
global g_total_differences
if not dont_care_gyp:
dont_care_gyp = []
if not dont_care_gn:
dont_care_gn = []
output = ''
if gyp[name] != gn[name]:
gyp_set = set(gyp[name])
gn_set = set(gn[name])
missing_in_gyp = gyp_set - gn_set
missing_in_gn = gn_set - gyp_set
missing_in_gyp -= set(dont_care_gyp)
missing_in_gn -= set(dont_care_gn)
if missing_in_gyp or missing_in_gn:
output += ' %s differ:\n' % name
if missing_in_gyp:
output += ' In gyp, but not in GN:\n %s' % '\n '.join(
sorted(missing_in_gyp)) + '\n'
g_total_differences += len(missing_in_gyp)
if missing_in_gn:
output += ' In GN, but not in gyp:\n %s' % '\n '.join(
sorted(missing_in_gn)) + '\n\n'
g_total_differences += len(missing_in_gn)
return output
def Run(command_line):
"""Run |command_line| as a subprocess and return stdout. Raises on error."""
try:
return subprocess.check_output(command_line, shell=True)
except subprocess.CalledProcessError as e:
# Rescue the output we got until the exception happened.
print '#### Stdout: ####################################################'
print e.output
print '#################################################################'
raise
def main():
if len(sys.argv) < 4:
print ('usage: %s gn_outdir gyp_outdir gn_target '
'[gyp_target1, gyp_target2, ...]' % __file__)
return 1
if len(sys.argv) == 4:
sys.argv.append(sys.argv[3])
gn_out_dir = sys.argv[1]
print >> sys.stderr, 'Expecting gn outdir in %s...' % gn_out_dir
gn = Run('ninja -C %s -t commands %s' % (gn_out_dir, sys.argv[3]))
if sys.platform == 'win32':
# On Windows flags are stored in .rsp files which are created during build.
print >> sys.stderr, 'Building in %s...' % gn_out_dir
Run('ninja -C %s -d keeprsp %s' % (gn_out_dir, sys.argv[3]))
gyp_out_dir = sys.argv[2]
print >> sys.stderr, 'Expecting gyp outdir in %s...' % gyp_out_dir
gyp = Run('ninja -C %s -t commands %s' % (gyp_out_dir, " ".join(sys.argv[4:])))
if sys.platform == 'win32':
# On Windows flags are stored in .rsp files which are created during build.
print >> sys.stderr, 'Building in %s...' % gyp_out_dir
Run('ninja -C %s -d keeprsp %s' % (gyp_out_dir, " ".join(sys.argv[4:])))
all_gyp_flags = GetFlags(gyp.splitlines(),
os.path.join(os.getcwd(), gyp_out_dir))
all_gn_flags = GetFlags(gn.splitlines(),
os.path.join(os.getcwd(), gn_out_dir))
gyp_files = set(all_gyp_flags.keys())
gn_files = set(all_gn_flags.keys())
different_source_list = gyp_files != gn_files
if different_source_list:
print 'Different set of sources files:'
print ' In gyp, not in GN:\n %s' % '\n '.join(
sorted(gyp_files - gn_files))
print ' In GN, not in gyp:\n %s' % '\n '.join(
sorted(gn_files - gyp_files))
print '\nNote that flags will only be compared for files in both sets.\n'
file_list = gyp_files & gn_files
files_with_given_differences = {}
for filename in sorted(file_list):
gyp_flags = all_gyp_flags[filename]
gn_flags = all_gn_flags[filename]
differences = CompareLists(gyp_flags, gn_flags, 'dash_f')
differences += CompareLists(gyp_flags, gn_flags, 'defines')
differences += CompareLists(gyp_flags, gn_flags, 'include_dirs',
['-I%s' % os.path.dirname(BASE_DIR)])
differences += CompareLists(gyp_flags, gn_flags, 'warnings',
# More conservative warnings in GN we consider to be OK.
dont_care_gyp=[
'/wd4091', # 'keyword' : ignored on left of 'type' when no variable
# is declared.
'/wd4456', # Declaration hides previous local declaration.
'/wd4457', # Declaration hides function parameter.
'/wd4458', # Declaration hides class member.
'/wd4459', # Declaration hides global declaration.
'/wd4702', # Unreachable code.
'/wd4800', # Forcing value to bool 'true' or 'false'.
'/wd4838', # Conversion from 'type' to 'type' requires a narrowing
# conversion.
] if sys.platform == 'win32' else None,
dont_care_gn=[
'-Wendif-labels',
'-Wextra',
'-Wsign-compare',
] if not sys.platform == 'win32' else None)
differences += CompareLists(gyp_flags, gn_flags, 'other')
if differences:
files_with_given_differences.setdefault(differences, []).append(filename)
for diff, files in files_with_given_differences.iteritems():
print '\n'.join(sorted(files))
print diff
print 'Total differences:', g_total_differences
# TODO(scottmg): Return failure on difference once we're closer to identical.
return 0
if __name__ == '__main__':
sys.exit(main())
#!/bin/sh
# Copyright 2013 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Monkey-patch GYP.
cat > tools/gyp/gyp.mingw << EOF
#!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
# TODO(mark): sys.path manipulation is some temporary testing stuff.
try:
import gyp
except ImportError, e:
import os.path
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
import gyp
def MonkeyBuildFileTargets(target_list, build_file):
"""From a target_list, returns the subset from the specified build_file.
"""
build_file = build_file.replace('/', '\\\\')
return [p for p in target_list if gyp.common.BuildFile(p) == build_file]
gyp.common.BuildFileTargets = MonkeyBuildFileTargets
import gyp.generator.make
import os
def Monkey_ITIP(self):
"""Returns the location of the final output for an installable target."""
sep = os.path.sep
# Xcode puts shared_library results into PRODUCT_DIR, and some gyp files
# rely on this. Emulate this behavior for mac.
if (self.type == 'shared_library' and
(self.flavor != 'mac' or self.toolset != 'target')):
# Install all shared libs into a common directory (per toolset) for
# convenient access with LD_LIBRARY_PATH.
return '\$(builddir)%slib.%s%s%s' % (sep, self.toolset, sep, self.alias)
return '\$(builddir)' + sep + self.alias
gyp.generator.make.MakefileWriter._InstallableTargetInstallPath = Monkey_ITIP
if __name__ == '__main__':
sys.exit(gyp.main(sys.argv[1:]))
EOF
# Delete old generated Makefiles.
find out -name '*.mk' -or -name 'Makefile*' -exec rm {} \;
# Generate fresh Makefiles.
mv tools/gyp/gyp tools/gyp/gyp.original
mv tools/gyp/gyp.mingw tools/gyp/gyp
make out/Makefile.ia32
mv tools/gyp/gyp tools/gyp/gyp.mingw
mv tools/gyp/gyp.original tools/gyp/gyp
# Patch generated Makefiles: replace most backslashes with forward slashes,
# fix library names in linker flags.
FILES=$(find out -name '*.mk' -or -name 'Makefile*')
for F in $FILES ; do
echo "Patching $F..."
cp $F $F.orig
cat $F.orig \
| sed -e 's|\([)a-zA-Z0-9]\)\\\([a-zA-Z]\)|\1/\2|g' \
-e 's|\([)a-zA-Z0-9]\)\\\\\([a-zA-Z]\)|\1/\2|g' \
-e 's|'%s/n'|'%s\\\\n'|g' \
-e 's|-lwinmm\.lib|-lwinmm|g' \
-e 's|-lws2_32\.lib|-lws2_32|g' \
> $F
rm $F.orig
done
......@@ -54,6 +54,9 @@ ADD_TO_GITIGNORE = [ "/testing/gtest/*",
"!/third_party/jinja2",
"!/third_party/markupsafe" ]
# Node.js owns deps/v8/gypfiles in their downstream repository.
FILES_TO_KEEP = [ "gypfiles" ]
def RunGclient(path):
assert os.path.isdir(path)
print ">> Running gclient sync"
......@@ -73,7 +76,7 @@ def CommitPatch(options):
cwd=options.v8_path,
)
def UpdateTarget(repository, options):
def UpdateTarget(repository, options, files_to_keep):
source = os.path.join(options.v8_path, *repository)
target = os.path.join(options.node_path, TARGET_SUBDIR, *repository)
print ">> Updating target directory %s" % target
......@@ -83,16 +86,24 @@ def UpdateTarget(repository, options):
# Remove possible remnants of previous incomplete runs.
node_common.UninitGit(target)
git_commands = [
["git", "init"], # initialize target repo
["git", "remote", "add", "origin", source], # point to the source repo
["git", "fetch", "origin", "HEAD"], # sync to the current branch
["git", "reset", "--hard", "FETCH_HEAD"], # reset to the current branch
["git", "clean", "-fd"], # delete removed files
]
git_args = []
git_args.append(["init"]) # initialize target repo
if files_to_keep:
git_args.append(["add"] + files_to_keep) # add and commit
git_args.append(["commit", "-m", "keep files"]) # files we want to keep
git_args.append(["remote", "add", "source", source]) # point to source repo
git_args.append(["fetch", "source", "HEAD"]) # sync to current branch
git_args.append(["checkout", "-f", "FETCH_HEAD"]) # switch to that branch
git_args.append(["clean", "-fd"]) # delete removed files
if files_to_keep:
git_args.append(["cherry-pick", "master"]) # restore kept files
try:
for command in git_commands:
subprocess.check_call(command, cwd=target)
for args in git_args:
subprocess.check_call(["git"] + args, cwd=target)
except:
raise
finally:
......@@ -155,11 +166,11 @@ def Main(args):
if options.with_patch:
CommitPatch(options)
# Update main V8 repository.
UpdateTarget([""], options)
UpdateTarget([""], options, FILES_TO_KEEP)
# Patch .gitignore before updating sub-repositories.
UpdateGitIgnore(options)
for repo in SUB_REPOSITORIES:
UpdateTarget(repo, options)
UpdateTarget(repo, options, None)
if options.commit:
CreateCommit(options)
......
......@@ -281,8 +281,7 @@ class SourceProcessor(SourceFileProcessor):
Check that all files include a copyright notice and no trailing whitespaces.
"""
RELEVANT_EXTENSIONS = ['.js', '.cc', '.h', '.py', '.c',
'.status', '.gyp', '.gypi']
RELEVANT_EXTENSIONS = ['.js', '.cc', '.h', '.py', '.c', '.status']
def __init__(self):
self.runtime_function_call_pattern = self.CreateRuntimeFunctionCallMatcher()
......@@ -332,7 +331,7 @@ class SourceProcessor(SourceFileProcessor):
def IgnoreDir(self, name):
return (super(SourceProcessor, self).IgnoreDir(name) or
name in ('third_party', 'gyp', 'out', 'obj', 'DerivedSources'))
name in ('third_party', 'out', 'obj', 'DerivedSources'))
IGNORE_COPYRIGHTS = ['box2d.js',
'cpplint.py',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment