Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux arm64 support (sans Widevine) #15349

Merged
merged 11 commits into from
Oct 12, 2022
35 changes: 7 additions & 28 deletions app/linux/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import("//brave/build/config.gni")
import("//build/linux/extract_symbols.gni")

if (should_generate_breakpad_symbols) {
action("generate_breakpad_symbols") {
Expand Down Expand Up @@ -35,45 +36,23 @@ if (should_generate_breakpad_symbols) {

group("symbol_dist_resources") {
public_deps = [
":brave_symbols",
":generate_breakpad_symbols",
":strip_and_dump_symbols",
]
}

group("dist_resources") {
}

action("strip_and_dump_symbols") {
script = "//build/linux/dump_app_syms.py"
extract_symbols("brave_symbols") {
binary = "$brave_dist_dir/brave"

dump_syms_label = "//third_party/breakpad:dump_syms($host_toolchain)"
dump_syms_binary =
get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms"

deps = [
# TODO(bridiver) - resolve duplicate symbol generation
":generate_breakpad_symbols",
"//brave:brave_dist_resources",
dump_syms_label,
]
brave_binary = "$brave_dist_dir/brave"
if (current_cpu == "x86") {
# Use "ia32" instead of "x86" for GYP compat.
brave_symbol_file = "$root_out_dir/brave.breakpad.ia32"
symbol_file = "$root_out_dir/brave.breakpad.ia32"
} else {
brave_symbol_file = "$root_out_dir/brave.breakpad.$current_cpu"
symbol_file = "$root_out_dir/brave.breakpad.$current_cpu"
}

inputs = [
brave_binary,
dump_syms_binary,
]
outputs = [ brave_symbol_file ]

args = [
"./" + rebase_path(dump_syms_binary, root_build_dir),
"1", # strip_binary = true
rebase_path(brave_binary, root_build_dir),
rebase_path(brave_symbol_file, root_build_dir),
]
deps = [ "//brave:brave_dist_resources" ]
}
16 changes: 13 additions & 3 deletions build/commands/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,19 @@ Config.prototype.buildArgs = function () {
args.use_system_xcode = false
}

if (this.getTargetOS() === 'linux' && this.targetArch === 'x64') {
// Include vaapi support
args.use_vaapi = true
if (this.getTargetOS() === 'linux') {
if (this.targetArch !== 'x86') {
// Include vaapi support
// TODO: Consider setting use_vaapi_x11 instead of use_vaapi. Also
// consider enabling it for x86 builds. See
// https://github.com/brave/brave-browser/issues/1024#issuecomment-1175397914
args.use_vaapi = true
mherrmann marked this conversation as resolved.
Show resolved Hide resolved

}
if (this.targetArch === 'arm64') {
// We don't yet support Widevine on Arm64 Linux.
args.enable_widevine = false
}
}

// Enable Page Graph only in desktop builds.
Expand Down
13 changes: 8 additions & 5 deletions build/rust/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ if (use_lld) {

# https://bugzilla.mozilla.org/show_bug.cgi?id=1188030#c14
# Supposedly this bug was fixed, but it's still happening for us.
too_many_personality_profiles_workaround = is_apple && use_lld && !is_component_build
too_many_personality_profiles_workaround =
is_apple && use_lld && !is_component_build

enable_rust_lto = too_many_personality_profiles_workaround

Expand Down Expand Up @@ -95,10 +96,12 @@ if (is_win) {
} else if (is_linux) {
if (current_cpu == "x64") {
rustc_target = "x86_64-unknown-linux-gnu"
if (use_sysroot) {
default_rustflags += [ "-C link-arg=--sysroot=$target_sysroot" ]
default_rustflags += [ "-C link-arg=-Wl,-rpath=\$ORIGIN" ]
}
} else if (current_cpu == "arm64") {
rustc_target = "aarch64-unknown-linux-gnu"
}
if (use_sysroot) {
default_rustflags += [ "-C link-arg=--sysroot=$target_sysroot" ]
default_rustflags += [ "-C link-arg=-Wl,-rpath=\$ORIGIN" ]
}
} else if (is_android) {
if (current_cpu == "arm") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@
#include "base/feature_list.h"
#include "base/memory/raw_ptr.h"
#include "brave/components/constants/url_constants.h"
#include "brave/components/constants/webui_url_constants.h"
#include "brave/components/l10n/common/locale_util.h"
#include "brave/components/permissions/permission_lifetime_utils.h"
#include "brave/grit/brave_generated_resources.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
mherrmann marked this conversation as resolved.
Show resolved Hide resolved
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "components/grit/brave_components_strings.h"
#include "components/permissions/features.h"
#include "components/permissions/permission_prompt.h"
#include "components/permissions/permission_request.h"
#include "components/permissions/request_type.h"
#include "components/strings/grit/components_strings.h"
#include "third_party/widevine/cdm/buildflags.h"
#include "ui/base/models/combobox_model.h"
#include "ui/gfx/text_constants.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
#include "ui/views/controls/button/checkbox.h"
#include "ui/views/controls/combobox/combobox.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/style/typography.h"
#include "ui/views/window/dialog_delegate.h"

#if BUILDFLAG(ENABLE_WIDEVINE)
#include "brave/browser/widevine/widevine_permission_request.h"
#include "brave/components/constants/webui_url_constants.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "components/permissions/request_type.h"
#include "ui/gfx/text_constants.h"
#include "ui/views/controls/button/checkbox.h"
#include "ui/views/controls/label.h"
#include "ui/views/style/typography.h"
#endif

namespace {
Expand Down