Skip to content
This repository was archived by the owner on Dec 16, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ build:clang-msan --copt -fsanitize-memory-track-origins=2
# TODO(cmluciano) fix and re-enable _LIBCPP_VERSION testing for TCMALLOC in Envoy::Stats::TestUtil::hasDeterministicMallocStats
# and update stats_integration_test with appropriate m_per_cluster value
build:libc++ --action_env=CXXFLAGS=-stdlib=libc++
build:libc++ --action_env=LDFLAGS=-stdlib=libc++
build:libc++ --action_env=BAZEL_CXXOPTS=-stdlib=libc++
build:libc++ --action_env=BAZEL_LINKLIBS=-l%:libc++.a:-l%:libc++abi.a:-lm
build:libc++ --host_linkopt=-fuse-ld=lld
Expand Down
38 changes: 37 additions & 1 deletion bazel/external/wee8.genrule_cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,44 @@ pushd $$ROOT/wee8
# Clean after previous build.
rm -rf out/wee8

# Export compiler configuration.
if [[ ( `uname` == "Darwin" && $${CXX-} == "" ) || $${CXX-} == *"clang"* ]]; then
export IS_CLANG=true
export CC=$${CC:-clang}
export CXX=$${CXX:-clang++}
else
export IS_CLANG=false
export CC=$${CC:-gcc}
export CXX=$${CXX:-g++}
fi

export AR=$${AR:-ar}
export NM=$${NM:-nm}

# Release build.
WEE8_BUILD_ARGS+=" is_debug=false"
# Clang or not Clang, that is the question.
WEE8_BUILD_ARGS+=" is_clang=$$IS_CLANG"
# Disable custom compiler plugins.
WEE8_BUILD_ARGS+=" clang_use_chrome_plugins=false"
# Use local toolchain.
WEE8_BUILD_ARGS+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
# Use local stdlibc++ / libc++.
WEE8_BUILD_ARGS+=" use_custom_libcxx=false"
# Use local sysroot.
WEE8_BUILD_ARGS+=" use_sysroot=false"
# Disable unused GLib2 dependency.
WEE8_BUILD_ARGS+=" use_glib=false"
# Expose debug symbols.
WEE8_BUILD_ARGS+=" v8_expose_symbols=true"
# Build monolithic library.
WEE8_BUILD_ARGS+=" is_component_build=false"
WEE8_BUILD_ARGS+=" v8_enable_i18n_support=false"
WEE8_BUILD_ARGS+=" v8_enable_gdbjit=false"
WEE8_BUILD_ARGS+=" v8_use_external_startup_data=false"

# Build wee8.
AR=ar NM=nm third_party/depot_tools/gn gen out/wee8 --args='v8_use_external_startup_data=false v8_enable_i18n_support=false v8_enable_gdbjit=false v8_expose_symbols=true is_component_build=false is_debug=false clang_use_chrome_plugins=false use_sysroot=false use_custom_libcxx=false use_glib=false custom_toolchain="//build/toolchain/linux/unbundle:default"'
third_party/depot_tools/gn gen out/wee8 --args="$$WEE8_BUILD_ARGS"
third_party/depot_tools/ninja -C out/wee8 wee8

# Move compiled library to the expected destinations.
Expand Down