fix arm/third_party and polly

This commit is contained in:
Alexander Frick 2024-11-27 15:14:00 -06:00
parent 4897f662d8
commit 465044080f
8 changed files with 244 additions and 101 deletions

View file

@ -266,21 +266,6 @@ config("no_unresolved_symbols") {
}
}
# Emit relocations for BOLT
config("emit-relocs") {
if (!using_sanitizer && use_bolt) {
if (is_win) {
ldflags = [
"-mllvm:--emit-relocs",
]
} else {
ldflags = [
"-Wl,--emit-relocs",
]
}
}
}
# compiler ---------------------------------------------------------------------
#
# Base compiler configuration.
@ -2642,16 +2627,6 @@ if (is_win) {
]
}
if (use_polly == true) {
common_optimize_on_ldflags += [
"-mllvm:-polly",
"-mllvm:-polly-detect-profitability-min-per-loop-insts=40",
#"-mllvm:-polly-invariant-load-hoisting",
"-mllvm:-polly-run-dce",
"-mllvm:-polly-vectorizer=stripmine",
]
}
# /OPT:ICF is not desirable in Debug builds, since code-folding can result in
# misleading symbols in stack traces.
if (!is_debug && !is_component_build) {
@ -2785,16 +2760,6 @@ if (is_win) {
]
}
if (use_polly == true) {
common_optimize_on_ldflags += [
"-Wl,-mllvm,-polly",
"-Wl,-mllvm,-polly-detect-profitability-min-per-loop-insts=40",
#"-Wl,-mllvm,-polly-invariant-load-hoisting",
"-Wl,-mllvm,-polly-run-dce",
"-Wl,-mllvm,-polly-vectorizer=stripmine",
]
}
if (is_android) {
# TODO(jdduke) Re-enable on mips after resolving linking
# issues with libc++ (crbug.com/456380).
@ -3032,6 +2997,45 @@ config("no_optimize") {
}
}
# Emit relocs for BOLT
config("emit-relocs") {
if (!using_sanitizer && use_bolt) {
if (is_win) {
ldflags = [
"-mllvm:--emit-relocs",
]
} else {
ldflags = [
"-Wl,--emit-relocs",
]
}
}
}
# Use LLVM's Polly optimizer
config("polly") {
if (use_polly == true) {
ldflags = common_optimize_on_ldflags
if (is_win) {
ldflags += [
"-mllvm:-polly",
"-mllvm:-polly-detect-profitability-min-per-loop-insts=40",
#"-mllvm:-polly-invariant-load-hoisting",
"-mllvm:-polly-run-dce",
"-mllvm:-polly-vectorizer=stripmine",
]
} else {
ldflags += [
"-Wl,-mllvm,-polly",
"-Wl,-mllvm,-polly-detect-profitability-min-per-loop-insts=40",
#"-Wl,-mllvm,-polly-invariant-load-hoisting",
"-Wl,-mllvm,-polly-run-dce",
"-Wl,-mllvm,-polly-vectorizer=stripmine",
]
}
}
}
# Turns up the optimization level. Used to explicitly enable -O2 instead of
# -Os for select targets on platforms that use optimize_for_size. No-op
# elsewhere.
@ -3062,6 +3066,7 @@ config("optimize_max") {
}
rustflags = [ "-Copt-level=3", ]
}
configs = [ ":polly" ]
}
# This config can be used to override the default settings for per-component
@ -3098,6 +3103,7 @@ config("optimize_speed") {
}
rustflags = [ "-Copt-level=3", ]
}
configs = [ ":polly" ]
}
config("optimize_fuzzing") {

View file

@ -97,6 +97,11 @@ if (current_cpu == "x86" || (current_cpu == "x64" && !is_msan)) {
}
defines = [ "CHROMIUM" ]
include_dirs = libaom_include_dirs
inputs = [
"$platform_include_dir/config/aom_config.asm",
"source/libaom/aom_ports/x86_abi_support.asm",
"source/libaom/third_party/x86inc/x86inc.asm",
]
}
# The following targets are deliberately source_set rather than
@ -147,7 +152,6 @@ if (current_cpu == "x86" || (current_cpu == "x64" && !is_msan)) {
cflags = [ "-mssse3" ]
}
sources = aom_av1_common_intrin_ssse3
sources += aom_av1_encoder_intrin_ssse3
sources += aom_dsp_common_intrin_ssse3
sources += aom_dsp_encoder_intrin_ssse3
if (current_cpu == "x86") {

View file

@ -101,7 +101,6 @@ EOF
# $1 - File to modify.
function convert_to_windows() {
sed -i.bak \
-e 's/\(#define[[:space:]]INLINE[[:space:]]*\)inline/\1 __inline/' \
-e 's/\(#define[[:space:]]HAVE_PTHREAD_H[[:space:]]*\)1/\1 0/' \
-e 's/\(#define[[:space:]]HAVE_UNISTD_H[[:space:]]*\)1/\1 0/' \
-e 's/\(#define[[:space:]]CONFIG_GCC[[:space:]]*\)1/\1 0/' \
@ -181,7 +180,7 @@ gen_config_files linux/arm \
reset_dirs linux/arm-neon
gen_config_files linux/arm-neon \
"${toolchain}/armv7-linux-gcc.cmake -DCONFIG_RUNTIME_CPU_DETECT=0 -DENABLE_ARM_CRC32=0 -DENABLE_NEON_DOTPROD=0 -DENABLE_NEON_I8MM=0 \
"${toolchain}/armv7-linux-gcc.cmake -DENABLE_ARM_CRC32=0 -DENABLE_NEON_DOTPROD=0 -DENABLE_NEON_I8MM=0 \
${all_platforms}"
reset_dirs linux/arm-neon-cpu-detect

View file

@ -121,30 +121,6 @@ source_set("libvpx_test_generic_headers") {
sources = libvpx_test_srcs_generic_headers
}
config("gtest_config") {
include_dirs = [
"source/libvpx/third_party/googletest/src/include/",
"source/libvpx/third_party/googletest/src/",
]
}
source_set("gtest") {
sources = [ "source/libvpx/third_party/googletest/src/src/gtest-all.cc" ]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":gtest_config" ]
# gtest-death-test dependency on fdio for fuchsia builds
if (is_fuchsia) {
deps = [
"//third_party/fuchsia-sdk/sdk/pkg/fdio",
"//third_party/fuchsia-sdk/sdk/pkg/zx",
]
}
}
executable("decode_encode_profile_test") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
@ -166,9 +142,9 @@ executable("decode_encode_profile_test") {
"tests/pgo/decode_encode_profile_test.cc",
]
deps = [
":gtest",
":libvpx",
":libvpx_test_generic_headers",
"//testing/gtest",
]
}
@ -179,7 +155,12 @@ if (current_cpu == "x86" || (current_cpu == "x64" && !is_msan)) {
} else if (current_cpu == "x64") {
sources = libvpx_srcs_x86_64_assembly
}
inputs = [
"$platform_include_dir/vpx_config.asm",
"source/libvpx/third_party/x86inc/x86inc.asm",
"source/libvpx/vpx_dsp/x86/bitdepth_conversion_sse2.asm",
"source/libvpx/vpx_ports/x86_abi_support.asm",
]
defines = [ "CHROMIUM" ]
if (is_android) {
# On Android, define __ANDROID__ to use alternative standard library
@ -693,9 +674,9 @@ test("test_libvpx") {
include_dirs = [ "source/libvpx/third_party/libwebm/" ]
deps = [
":gtest",
":libvpx",
":libvpx_test_generic_headers",
"//testing/gtest",
]
if (is_android) {

View file

@ -190,6 +190,18 @@ index fe2ce670da340..82bbda21a16e5 100644
// Used by LOG_IS_ON to lazy-evaluate stream arguments.
BASE_EXPORT bool ShouldCreateLogMessage(int severity);
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index c9a3ce41465b3..9203ec5c7c75c 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -348,6 +348,7 @@ default_compiler_configs = [
"//build/config/compiler:default_optimization",
"//build/config/compiler:default_stack_frames",
"//build/config/compiler:default_symbols",
+ "//build/config/compiler:emit-relocs",
"//build/config/compiler:libcxx_hardening",
"//build/config/compiler:libcxx_module",
"//build/config/compiler:no_exceptions",
diff --git a/chrome/browser/extensions/api/messaging/launch_context_win.cc b/chrome/browser/extensions/api/messaging/launch_context_win.cc
index b103bbe61303d..469611cb36e7a 100644
--- a/chrome/browser/extensions/api/messaging/launch_context_win.cc

View file

@ -266,21 +266,6 @@ config("no_unresolved_symbols") {
}
}
# Emit relocations for BOLT
config("emit-relocs") {
if (!using_sanitizer && use_bolt) {
if (is_win) {
ldflags = [
"-mllvm:--emit-relocs",
]
} else {
ldflags = [
"-Wl,--emit-relocs",
]
}
}
}
# compiler ---------------------------------------------------------------------
#
# Base compiler configuration.
@ -2642,16 +2627,6 @@ if (is_win) {
]
}
if (use_polly == true) {
common_optimize_on_ldflags += [
"-mllvm:-polly",
"-mllvm:-polly-detect-profitability-min-per-loop-insts=40",
#"-mllvm:-polly-invariant-load-hoisting",
"-mllvm:-polly-run-dce",
"-mllvm:-polly-vectorizer=stripmine",
]
}
# /OPT:ICF is not desirable in Debug builds, since code-folding can result in
# misleading symbols in stack traces.
if (!is_debug && !is_component_build) {
@ -2785,16 +2760,6 @@ if (is_win) {
]
}
if (use_polly == true) {
common_optimize_on_ldflags += [
"-Wl,-mllvm,-polly",
"-Wl,-mllvm,-polly-detect-profitability-min-per-loop-insts=40",
#"-Wl,-mllvm,-polly-invariant-load-hoisting",
"-Wl,-mllvm,-polly-run-dce",
"-Wl,-mllvm,-polly-vectorizer=stripmine",
]
}
if (is_android) {
# TODO(jdduke) Re-enable on mips after resolving linking
# issues with libc++ (crbug.com/456380).
@ -3032,6 +2997,45 @@ config("no_optimize") {
}
}
# Emit relocs for BOLT
config("emit-relocs") {
if (!using_sanitizer && use_bolt) {
if (is_win) {
ldflags = [
"-mllvm:--emit-relocs",
]
} else {
ldflags = [
"-Wl,--emit-relocs",
]
}
}
}
# Use LLVM's Polly optimizer
config("polly") {
if (use_polly == true) {
ldflags = common_optimize_on_ldflags
if (is_win) {
ldflags += [
"-mllvm:-polly",
"-mllvm:-polly-detect-profitability-min-per-loop-insts=40",
#"-mllvm:-polly-invariant-load-hoisting",
"-mllvm:-polly-run-dce",
"-mllvm:-polly-vectorizer=stripmine",
]
} else {
ldflags += [
"-Wl,-mllvm,-polly",
"-Wl,-mllvm,-polly-detect-profitability-min-per-loop-insts=40",
#"-Wl,-mllvm,-polly-invariant-load-hoisting",
"-Wl,-mllvm,-polly-run-dce",
"-Wl,-mllvm,-polly-vectorizer=stripmine",
]
}
}
}
# Turns up the optimization level. Used to explicitly enable -O2 instead of
# -Os for select targets on platforms that use optimize_for_size. No-op
# elsewhere.
@ -3062,6 +3066,7 @@ config("optimize_max") {
}
rustflags = [ "-Copt-level=3", ]
}
configs = [ ":polly" ]
}
# This config can be used to override the default settings for per-component
@ -3098,6 +3103,7 @@ config("optimize_speed") {
}
rustflags = [ "-Copt-level=3", ]
}
configs = [ ":polly" ]
}
config("optimize_fuzzing") {

View file

@ -755,7 +755,7 @@ BASE_FEATURE(kVaapiVideoDecodeLinux,
BASE_FEATURE(kVaapiVideoDecodeLinuxGL,
"VaapiVideoDecodeLinuxGL",
base::FEATURE_ENABLED_BY_DEFAULT);
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kVaapiVideoEncodeLinux,
"VaapiVideoEncoder",

135
tatus Normal file
View file

@ -0,0 +1,135 @@
diff --git a/src/build/config/compiler/BUILD.gn b/src/build/config/compiler/BUILD.gn
index 2e0cfdf6..f933f6cc 100644
--- a/src/build/config/compiler/BUILD.gn
+++ b/src/build/config/compiler/BUILD.gn
@@ -266,21 +266,6 @@ config("no_unresolved_symbols") {
}
}

-# Emit relocations for BOLT
-config("emit-relocs") {
- if (!using_sanitizer && use_bolt) {
- if (is_win) {
- ldflags = [
- "-mllvm:--emit-relocs",
- ]
- } else {
- ldflags = [
- "-Wl,--emit-relocs",
- ]
- }
- }
-}
-
# compiler ---------------------------------------------------------------------
#
# Base compiler configuration.
@@ -2642,16 +2627,6 @@ if (is_win) {
]
}

- if (use_polly == true) {
- common_optimize_on_ldflags += [
- "-mllvm:-polly",
- "-mllvm:-polly-detect-profitability-min-per-loop-insts=40",
- #"-mllvm:-polly-invariant-load-hoisting",
- "-mllvm:-polly-run-dce",
- "-mllvm:-polly-vectorizer=stripmine",
- ]
- }
-
# /OPT:ICF is not desirable in Debug builds, since code-folding can result in
# misleading symbols in stack traces.
if (!is_debug && !is_component_build) {
@@ -2785,16 +2760,6 @@ if (is_win) {
]
}

- if (use_polly == true) {
- common_optimize_on_ldflags += [
- "-Wl,-mllvm,-polly",
- "-Wl,-mllvm,-polly-detect-profitability-min-per-loop-insts=40",
- #"-Wl,-mllvm,-polly-invariant-load-hoisting",
- "-Wl,-mllvm,-polly-run-dce",
- "-Wl,-mllvm,-polly-vectorizer=stripmine",
- ]
- }
-
if (is_android) {
# TODO(jdduke) Re-enable on mips after resolving linking
# issues with libc++ (crbug.com/456380).
@@ -3032,6 +2997,45 @@ config("no_optimize") {
}
}

+# Emit relocs for BOLT
+config("emit-relocs") {
+ if (!using_sanitizer && use_bolt) {
+ if (is_win) {
+ ldflags = [
+ "-mllvm:--emit-relocs",
+ ]
+ } else {
+ ldflags = [
+ "-Wl,--emit-relocs",
+ ]
+ }
+ }
+}
+
+# Use LLVM's Polly optimizer
+config("polly") {
+ if (use_polly == true) {
+ ldflags = common_optimize_on_ldflags
+ if (is_win) {
+ ldflags += [
+ "-mllvm:-polly",
+ "-mllvm:-polly-detect-profitability-min-per-loop-insts=40",
+ #"-mllvm:-polly-invariant-load-hoisting",
+ "-mllvm:-polly-run-dce",
+ "-mllvm:-polly-vectorizer=stripmine",
+ ]
+ } else {
+ ldflags += [
+ "-Wl,-mllvm,-polly",
+ "-Wl,-mllvm,-polly-detect-profitability-min-per-loop-insts=40",
+ #"-Wl,-mllvm,-polly-invariant-load-hoisting",
+ "-Wl,-mllvm,-polly-run-dce",
+ "-Wl,-mllvm,-polly-vectorizer=stripmine",
+ ]
+ }
+ }
+}
+
# Turns up the optimization level. Used to explicitly enable -O2 instead of
# -Os for select targets on platforms that use optimize_for_size. No-op
# elsewhere.
@@ -3062,6 +3066,7 @@ config("optimize_max") {
}
rustflags = [ "-Copt-level=3", ]
}
+ configs = [ ":polly" ]
}

# This config can be used to override the default settings for per-component
@@ -3098,6 +3103,7 @@ config("optimize_speed") {
}
rustflags = [ "-Copt-level=3", ]
}
+ configs = [ ":polly" ]
}

config("optimize_fuzzing") {
diff --git a/src/media/base/media_switches.cc b/src/media/base/media_switches.cc
index d2f8bec3..0f528844 100644
--- a/src/media/base/media_switches.cc
+++ b/src/media/base/media_switches.cc
@@ -755,7 +755,7 @@ BASE_FEATURE(kVaapiVideoDecodeLinux,

BASE_FEATURE(kVaapiVideoDecodeLinuxGL,
"VaapiVideoDecodeLinuxGL",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kVaapiVideoEncodeLinux,
"VaapiVideoEncoder",