Commit b6e93fc6 authored by Milko Leporis's avatar Milko Leporis Committed by Commit Bot

[MIPS64] Add support for building Chromium Linux for mips64r2

This change adds missing parts of mips64r2 support.

Bug: 800754
Change-Id: If37183b7c996effe28b7f687ca86ec7f11d90514
Reviewed-on: https://chromium-review.googlesource.com/860058
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531691}
parent 9330d613
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")
# Temporarily disable tcmalloc on arm64 linux to get rid of compilation errors. # Temporarily disable tcmalloc on arm64 linux to get rid of compilation errors.
if (is_android || current_cpu == "mipsel" || is_mac || is_ios || is_asan || if (is_android || current_cpu == "mipsel" || current_cpu == "mips64el" ||
is_lsan || is_tsan || is_msan || is_win || is_syzyasan || is_fuchsia || is_mac || is_ios || is_asan || is_lsan || is_tsan || is_msan || is_win ||
(is_linux && target_cpu == "arm64")) { is_syzyasan || is_fuchsia || (is_linux && target_cpu == "arm64")) {
_default_allocator = "none" _default_allocator = "none"
} else { } else {
_default_allocator = "tcmalloc" _default_allocator = "tcmalloc"
......
...@@ -834,11 +834,18 @@ config("compiler_cpu_abi") { ...@@ -834,11 +834,18 @@ config("compiler_cpu_abi") {
] ]
} }
} else if (mips_arch_variant == "r2") { } else if (mips_arch_variant == "r2") {
cflags += [
"-mips64r2",
"-Wa,-mips64r2",
]
ldflags += [ "-mips64r2" ] ldflags += [ "-mips64r2" ]
if (is_clang) {
cflags += [
"-march=mips64el",
"-mcpu=mips64r2",
]
} else {
cflags += [
"-mips64r2",
"-Wa,-mips64r2",
]
}
} else if (mips_arch_variant == "loongson3") { } else if (mips_arch_variant == "loongson3") {
defines += [ "_MIPS_ARCH_LOONGSON" ] defines += [ "_MIPS_ARCH_LOONGSON" ]
cflags += [ cflags += [
......
...@@ -169,8 +169,9 @@ declare_args() { ...@@ -169,8 +169,9 @@ declare_args() {
use_gold = use_gold =
(!use_lld && !(is_chromecast && is_linux && (!use_lld && !(is_chromecast && is_linux &&
(current_cpu == "arm" || current_cpu == "mipsel")) && (current_cpu == "arm" || current_cpu == "mipsel")) &&
(is_linux && (current_cpu == "x64" || current_cpu == "x86" || (is_linux &&
current_cpu == "arm" || current_cpu == "mipsel"))) || (current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm" ||
current_cpu == "mipsel" || current_cpu == "mips64el"))) ||
(is_android && (current_cpu == "x86" || current_cpu == "x64" || (is_android && (current_cpu == "x86" || current_cpu == "x64" ||
current_cpu == "arm" || current_cpu == "arm64")) current_cpu == "arm" || current_cpu == "arm64"))
} }
......
...@@ -15,9 +15,9 @@ declare_args() { ...@@ -15,9 +15,9 @@ declare_args() {
# The absolute path to directory containing linux sysroot images # The absolute path to directory containing linux sysroot images
target_sysroot_dir = "//build/linux" target_sysroot_dir = "//build/linux"
use_sysroot = use_sysroot = current_cpu == "x86" || current_cpu == "x64" ||
current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" || current_cpu == "arm" || current_cpu == "arm64" ||
current_cpu == "arm64" || current_cpu == "mipsel" current_cpu == "mipsel" || current_cpu == "mips64el"
} }
if (current_os == target_os && current_cpu == target_cpu && if (current_os == target_os && current_cpu == target_cpu &&
...@@ -37,6 +37,8 @@ if (current_os == target_os && current_cpu == target_cpu && ...@@ -37,6 +37,8 @@ if (current_os == target_os && current_cpu == target_cpu &&
sysroot = "$target_sysroot_dir/debian_stretch_i386-sysroot" sysroot = "$target_sysroot_dir/debian_stretch_i386-sysroot"
} else if (current_cpu == "mipsel") { } else if (current_cpu == "mipsel") {
sysroot = "$target_sysroot_dir/debian_stretch_mips-sysroot" sysroot = "$target_sysroot_dir/debian_stretch_mips-sysroot"
} else if (current_cpu == "mips64el") {
sysroot = "$target_sysroot_dir/debian_stretch_mips64el-sysroot"
} else if (current_cpu == "arm") { } else if (current_cpu == "arm") {
sysroot = "$target_sysroot_dir/debian_stretch_arm-sysroot" sysroot = "$target_sysroot_dir/debian_stretch_arm-sysroot"
} else if (current_cpu == "arm64") { } else if (current_cpu == "arm64") {
......
...@@ -406,6 +406,8 @@ template("linux_package") { ...@@ -406,6 +406,8 @@ template("linux_package") {
deb_arch = "arm" deb_arch = "arm"
} else if (current_cpu == "mipsel") { } else if (current_cpu == "mipsel") {
deb_arch = "mipsel" deb_arch = "mipsel"
} else if (current_cpu == "mips64el") {
deb_arch = "mips64el"
} else { } else {
assert(false, "Linux installer not configured for this architecture.") assert(false, "Linux installer not configured for this architecture.")
} }
...@@ -460,6 +462,8 @@ template("linux_package") { ...@@ -460,6 +462,8 @@ template("linux_package") {
rpm_arch = "arm" rpm_arch = "arm"
} else if (current_cpu == "mipsel") { } else if (current_cpu == "mipsel") {
rpm_arch = "mipsel" rpm_arch = "mipsel"
} else if (current_cpu == "mips64el") {
rpm_arch = "mips64el"
} else { } else {
assert(false, "Linux installer not configured for this architecture.") assert(false, "Linux installer not configured for this architecture.")
} }
......
...@@ -285,6 +285,9 @@ case "$TARGETARCH" in ...@@ -285,6 +285,9 @@ case "$TARGETARCH" in
mipsel ) mipsel )
export ARCHITECTURE="mipsel" export ARCHITECTURE="mipsel"
;; ;;
mips64el )
export ARCHITECTURE="mips64el"
;;
* ) * )
echo echo
echo "ERROR: Don't know how to build DEBs for '$TARGETARCH'." echo "ERROR: Don't know how to build DEBs for '$TARGETARCH'."
......
...@@ -44,6 +44,9 @@ elif arch == 'arm': ...@@ -44,6 +44,9 @@ elif arch == 'arm':
elif arch == 'mipsel': elif arch == 'mipsel':
cmd.extend(['-l%s/usr/lib/mipsel-linux-gnu' % sysroot, cmd.extend(['-l%s/usr/lib/mipsel-linux-gnu' % sysroot,
'-l%s/lib/mipsel-linux-gnu' % sysroot]) '-l%s/lib/mipsel-linux-gnu' % sysroot])
elif arch == 'mips64el':
cmd.extend(['-l%s/usr/lib/mips64el-linux-gnuabi64' % sysroot,
'-l%s/lib/mips64el-linux-gnuabi64' % sysroot])
else: else:
print 'Unsupported architecture ' + arch print 'Unsupported architecture ' + arch
sys.exit(1) sys.exit(1)
......
...@@ -265,6 +265,10 @@ case "$TARGETARCH" in ...@@ -265,6 +265,10 @@ case "$TARGETARCH" in
export ARCHITECTURE="mipsel" export ARCHITECTURE="mipsel"
stage_install_rpm stage_install_rpm
;; ;;
mips64el )
export ARCHITECTURE="mips64el"
stage_install_rpm
;;
* ) * )
echo echo
echo "ERROR: Don't know how to build RPMs for '$TARGETARCH'." echo "ERROR: Don't know how to build RPMs for '$TARGETARCH'."
......
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