1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-05 17:30:16 +00:00

GN: Fix cross ARM64 and cross MIPS builds.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2643583002 .
This commit is contained in:
Ryan Macnak 2017-01-20 15:44:24 -08:00
parent 7bf5d87017
commit 4f598c584d
3 changed files with 18 additions and 8 deletions

View File

@ -226,6 +226,10 @@ config("compiler") {
]
}
} else if (current_cpu == "mipsel") {
# Some toolchains default to big-endian.
cflags += [ "-EL" ]
ldflags += [ "-EL" ]
# We have to explicitly request exceptions to get good heap profiles from
# tcmalloc.
if (is_debug || is_release) {

View File

@ -248,6 +248,9 @@ typedef simd_value_t fpu_register_t;
#define ARCH_IS_32_BIT 1
#define kFpuRegisterSize 8
typedef double fpu_register_t;
#elif defined(__MIPSEB__)
#error Big-endian MIPS is not supported by Dart. Try passing -EL to your \
compiler.
#elif defined(__aarch64__)
#define HOST_ARCH_ARM64 1
#define ARCH_IS_64_BIT 1

View File

@ -140,14 +140,17 @@ def to_gn_args(args, mode, arch, target_os):
and not args.msan
and not args.tsan)
# Force -mfloat-abi=hard and -mfpu=neon on Linux as we're specifying
# a gnueabihf compiler in //build/toolchain/linux BUILD.gn.
# TODO(zra): This will likely need some adjustment to build for armv6 etc.
hard_float = (gn_args['target_cpu'].startswith('arm') and
(gn_args['target_os'] == 'linux'))
if hard_float:
gn_args['arm_float_abi'] = 'hard'
gn_args['arm_use_neon'] = True
if gn_args['target_os'] == 'linux':
if gn_args['target_cpu'] == 'arm':
# Force -mfloat-abi=hard and -mfpu=neon for arm on Linux as we're
# specifying a gnueabihf compiler in //build/toolchain/linux BUILD.gn.
gn_args['arm_arch'] = 'armv7'
gn_args['arm_float_abi'] = 'hard'
gn_args['arm_use_neon'] = True
elif gn_args['target_cpu'] == 'armv6':
raise Exception("GN support for armv6 unimplemented")
elif gn_args['target_cpu'] == 'armv5te':
raise Exception("GN support for armv5te unimplemented")
gn_args['is_debug'] = mode == 'debug'
gn_args['is_release'] = mode == 'release'