Fix ARM Linux ANGLE compiler compatibility
This commit is contained in:
1 parent
3f7c30ec29
commit
7c18ae44c2
2 files changed
+31
-59
No files matched your search
+26
-5
@@ -2,7 +2,8 @@ diff --git a/DEPS b/DEPS
|
||||
index 8ba99a6..1a5e1a5 100644
|
||||
--- a/DEPS
|
||||
+++ b/DEPS
|
||||
@@ -769,7 +769,2 @@ deps = {
|
||||
@@ -768,9 +768,4 @@ deps = {
|
||||
},
|
||||
|
||||
- 'third_party/catapult': {
|
||||
- 'url': Var('chromium_git') + '/catapult.git' + '@' + Var('catapult_revision'),
|
||||
@@ -10,7 +11,9 @@ index 8ba99a6..1a5e1a5 100644
|
||||
- },
|
||||
-
|
||||
# Cherry is a dEQP/VK-GL-CTS management GUI written in Go. We use it for viewing test results.
|
||||
@@ -796,7 +791,2 @@ deps = {
|
||||
'third_party/cherry': {
|
||||
@@ -795,9 +790,4 @@ deps = {
|
||||
|
||||
|
||||
- 'third_party/dawn': {
|
||||
- 'url': Var('dawn_git') + '/dawn.git' + '@' + Var('dawn_revision'),
|
||||
@@ -18,7 +21,9 @@ index 8ba99a6..1a5e1a5 100644
|
||||
- },
|
||||
-
|
||||
'third_party/depot_tools': {
|
||||
@@ -876,7 +866,2 @@ deps = {
|
||||
'url': Var('chromium_git') + '/chromium/tools/depot_tools.git@94e89b10b92cc9d6e58fc8d1b6474b7d29e8a114',
|
||||
@@ -875,9 +865,4 @@ deps = {
|
||||
},
|
||||
|
||||
- 'third_party/llvm/src': {
|
||||
- 'url': Var('chromium_git') + '/external/github.com/llvm/llvm-project@67790d3fb06b184b7be9c4d3e36ab01f0ac4198e',
|
||||
@@ -26,7 +31,9 @@ index 8ba99a6..1a5e1a5 100644
|
||||
- },
|
||||
-
|
||||
'third_party/llvm-build/Release+Asserts': {
|
||||
@@ -1218,7 +1203,2 @@ deps = {
|
||||
'dep_type': 'gcs',
|
||||
@@ -1217,9 +1202,4 @@ deps = {
|
||||
},
|
||||
|
||||
- 'third_party/SwiftShader': {
|
||||
- 'url': Var('swiftshader_git') + '/SwiftShader@f3e464b1e56795940f826a972b39e19bd9f6ac6c',
|
||||
@@ -34,10 +41,24 @@ index 8ba99a6..1a5e1a5 100644
|
||||
- },
|
||||
-
|
||||
'third_party/turbine/cipd': {
|
||||
@@ -1234,6 +1214,2 @@ deps = {
|
||||
'packages': [
|
||||
@@ -1233,8 +1213,4 @@ deps = {
|
||||
},
|
||||
|
||||
- 'third_party/VK-GL-CTS/src': {
|
||||
- 'url': Var('chromium_git') + '/external/github.com/KhronosGroup/VK-GL-CTS' + '@' + Var('vk_gl_cts_revision'),
|
||||
- },
|
||||
-
|
||||
'third_party/vulkan-deps': {
|
||||
'url': Var('chromium_git') + '/vulkan-deps@f2b9fece7c6772c09379b3a6938dbcd2573f2a3e',
|
||||
diff --git a/src/compiler/translator/IntermNode.cpp b/src/compiler/translator/IntermNode.cpp
|
||||
index 710bba9..33d4a64 100644
|
||||
--- a/src/compiler/translator/IntermNode.cpp
|
||||
+++ b/src/compiler/translator/IntermNode.cpp
|
||||
@@ -881,5 +881,5 @@ const TConstantUnion *TIntermAggregate::getConstantValue() const
|
||||
angle::base::CheckedNumeric<size_t> checkedArraySize = elementSize;
|
||||
checkedArraySize *= getOutermostArraySize();
|
||||
- constArray = new TConstantUnion[checkedArraySize.ValueOrDie()];
|
||||
+ constArray = new TConstantUnion[static_cast<size_t>(checkedArraySize.ValueOrDie())];
|
||||
|
||||
size_t elementOffset = 0u;
|
||||
@@ -274,18 +274,21 @@ build_angle() {
|
||||
prepend_python_module_path six
|
||||
prepare_angle_gcs_artifacts "$src"
|
||||
fi
|
||||
prepare_arm64_clang_runtime
|
||||
prepare_musl_libstdcxx_headers
|
||||
gclient sync -f -D -R
|
||||
|
||||
local out_dir="$src/out/linux-static-$TARGET_CPU"
|
||||
local angle_is_clang="true"
|
||||
if [[ "$TARGET_CPU" == "arm64" ]]; then
|
||||
angle_is_clang="false"
|
||||
fi
|
||||
mkdir -p "$out_dir"
|
||||
cat >"$out_dir/args.gn" <<EOF_ARGS
|
||||
target_os = "linux"
|
||||
target_cpu = "$TARGET_CPU"
|
||||
is_debug = false
|
||||
is_component_build = false
|
||||
is_clang = true
|
||||
is_clang = $angle_is_clang
|
||||
treat_warnings_as_errors = false
|
||||
use_custom_libcxx = false
|
||||
use_sysroot = false
|
||||
@@ -298,8 +301,6 @@ angle_enable_swiftshader = false
|
||||
angle_enable_vulkan = false
|
||||
angle_enable_wgpu = false
|
||||
EOF_ARGS
|
||||
append_angle_arm64_gn_args "$out_dir/args.gn"
|
||||
|
||||
gn gen "$out_dir"
|
||||
ninja -C "$out_dir" -j "$BUILD_JOBS" libANGLE_static libGLESv2_static
|
||||
|
||||
@@ -382,56 +383,6 @@ download_angle_gcs_artifact() {
|
||||
fi
|
||||
}
|
||||
|
||||
append_angle_arm64_gn_args() {
|
||||
local args_file="$1"
|
||||
|
||||
if [[ "$TARGET_CPU" == "arm64" ]]; then
|
||||
local clang_version
|
||||
clang_version="$(clang -dumpversion | cut -d. -f1)"
|
||||
cat >>"$args_file" <<EOF_ARGS
|
||||
clang_base_path = "/usr"
|
||||
clang_use_chrome_plugins = false
|
||||
clang_version = "$clang_version"
|
||||
EOF_ARGS
|
||||
fi
|
||||
}
|
||||
|
||||
prepare_arm64_clang_runtime() {
|
||||
if [[ "$TARGET_CPU" != "arm64" ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
local arch
|
||||
local gnu_triple
|
||||
case "$TARGET_CPU" in
|
||||
x64)
|
||||
arch="x86_64"
|
||||
gnu_triple="x86_64-unknown-linux-gnu"
|
||||
;;
|
||||
arm64)
|
||||
arch="aarch64"
|
||||
gnu_triple="aarch64-unknown-linux-gnu"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported musl ANGLE target_cpu for clang runtime: $TARGET_CPU" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
local src
|
||||
src="$(find /usr/lib/llvm* /usr/lib/clang -path "*${arch}*" -name 'libclang_rt.builtins*.a' -print -quit 2>/dev/null || true)"
|
||||
if [[ -z "$src" ]]; then
|
||||
echo "Could not find Alpine compiler-rt builtins for $arch" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
local clang_version
|
||||
clang_version="$(clang -print-resource-dir | awk -F/ '{print $NF}')"
|
||||
local dest_dir="/usr/lib/clang/$clang_version/lib/$gnu_triple"
|
||||
mkdir -p "$dest_dir"
|
||||
ln -sf "$src" "$dest_dir/libclang_rt.builtins.a"
|
||||
}
|
||||
|
||||
prepare_musl_libstdcxx_headers() {
|
||||
if ! is_musl_rid; then
|
||||
return 0
|
||||
|
||||
Reference in new issue
Block a user