mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 12:57:42 +00:00
Fix ARMv6 Linux cross-build
related #29676 R=rmacnak@google.com Review-Url: https://codereview.chromium.org/2892413002 .
This commit is contained in:
parent
5139a1f85c
commit
34f601a8db
|
@ -556,6 +556,12 @@ if (is_win) {
|
|||
default_warning_flags += [ "-Wno-psabi" ]
|
||||
}
|
||||
|
||||
# The Raspberry Pi 1 toolchain enables this warning, but Dart doesn't build
|
||||
# cleanly with it.
|
||||
if (is_linux && !is_clang && current_cpu == "arm" && arm_version == 6) {
|
||||
default_warning_flags += [ "-Wno-type-limits" ]
|
||||
}
|
||||
|
||||
if (is_android) {
|
||||
# Disable any additional warnings enabled by the Android build system but
|
||||
# which chromium does not build cleanly with (when treating warning as
|
||||
|
|
|
@ -10,6 +10,7 @@ import("//build/toolchain/goma.gni")
|
|||
|
||||
declare_args() {
|
||||
toolchain_prefix = ""
|
||||
# TODO(zra): Add an argument for overriding the host toolchain.
|
||||
}
|
||||
|
||||
if (use_goma) {
|
||||
|
@ -64,9 +65,6 @@ gcc_toolchain("arm64") {
|
|||
gcc_toolchain("clang_x86") {
|
||||
prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-linux/bin",
|
||||
root_build_dir)
|
||||
if (toolchain_prefix != "") {
|
||||
prefix = toolchain_prefix
|
||||
}
|
||||
cc = "${compiler_prefix}${prefix}/clang"
|
||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||
readelf = "readelf"
|
||||
|
@ -82,9 +80,6 @@ gcc_toolchain("clang_x86") {
|
|||
|
||||
gcc_toolchain("x86") {
|
||||
prefix = ""
|
||||
if (toolchain_prefix != "") {
|
||||
prefix = toolchain_prefix
|
||||
}
|
||||
cc = "${compiler_prefix}${prefix}gcc"
|
||||
cxx = "${compiler_prefix}${prefix}g++"
|
||||
|
||||
|
@ -102,9 +97,6 @@ gcc_toolchain("x86") {
|
|||
gcc_toolchain("clang_x64") {
|
||||
prefix = rebase_path("//buildtools/toolchain/clang+llvm-x86_64-linux/bin",
|
||||
root_build_dir)
|
||||
if (toolchain_prefix != "") {
|
||||
prefix = toolchain_prefix
|
||||
}
|
||||
cc = "${compiler_prefix}${prefix}/clang"
|
||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||
|
||||
|
@ -121,9 +113,6 @@ gcc_toolchain("clang_x64") {
|
|||
|
||||
gcc_toolchain("x64") {
|
||||
prefix = ""
|
||||
if (toolchain_prefix != "") {
|
||||
prefix = toolchain_prefix
|
||||
}
|
||||
cc = "${compiler_prefix}${prefix}gcc"
|
||||
cxx = "${compiler_prefix}${prefix}g++"
|
||||
|
||||
|
|
|
@ -474,7 +474,8 @@ RawError* Compiler::CompileClass(const Class& cls) {
|
|||
parse_class.reset_is_marked_for_parsing();
|
||||
}
|
||||
}
|
||||
Error& error = Error::Handle(zone.GetZone());
|
||||
Thread* thread = Thread::Current();
|
||||
Error& error = Error::Handle(thread->zone());
|
||||
error = thread->sticky_error();
|
||||
thread->clear_sticky_error();
|
||||
return error.raw();
|
||||
|
|
|
@ -380,7 +380,7 @@ intptr_t CheckClassInstr::ComputeCidMask() const {
|
|||
for (intptr_t i = 0; i < cids_.length(); ++i) {
|
||||
intptr_t run;
|
||||
uintptr_t range = 1ul + cids_[i].Extent();
|
||||
if (range >= kBitsPerWord) {
|
||||
if (range >= static_cast<uintptr_t>(kBitsPerWord)) {
|
||||
run = -1;
|
||||
} else {
|
||||
run = (1 << range) - 1;
|
||||
|
|
3
third_party/tcmalloc/BUILD.gn
vendored
3
third_party/tcmalloc/BUILD.gn
vendored
|
@ -32,6 +32,9 @@ config("internal_config") {
|
|||
if (is_clang) {
|
||||
cflags += [ "-Wno-unused-const-variable" ]
|
||||
}
|
||||
if (current_cpu == "arm" && !is_clang) {
|
||||
cflags += [ "-Wno-psabi" ]
|
||||
}
|
||||
}
|
||||
|
||||
config("link_config") {
|
||||
|
|
24
tools/gn.py
24
tools/gn.py
|
@ -68,6 +68,8 @@ def ToCommandLine(gn_args):
|
|||
def merge(key, value):
|
||||
if type(value) is bool:
|
||||
return '%s=%s' % (key, 'true' if value else 'false')
|
||||
elif type(value) is int:
|
||||
return '%s=%d' % (key, value)
|
||||
return '%s="%s"' % (key, value)
|
||||
return [merge(x, y) for x, y in gn_args.iteritems()]
|
||||
|
||||
|
@ -174,13 +176,17 @@ def ToGnArgs(args, mode, arch, target_os):
|
|||
|
||||
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'
|
||||
# Default to -mfloat-abi=hard and -mfpu=neon for arm on Linux as we're
|
||||
# specifying a gnueabihf compiler in //build/toolchain/linux/BUILD.gn.
|
||||
floatabi = 'hard' if args.arm_float_abi == '' else args.arm_float_abi
|
||||
gn_args['arm_version'] = 7
|
||||
gn_args['arm_float_abi'] = floatabi
|
||||
gn_args['arm_use_neon'] = True
|
||||
elif gn_args['target_cpu'] == 'armv6':
|
||||
raise Exception("GN support for armv6 unimplemented")
|
||||
floatabi = 'softfp' if args.arm_float_abi == '' else args.arm_float_abi
|
||||
gn_args['target_cpu'] = 'arm'
|
||||
gn_args['arm_version'] = 6
|
||||
gn_args['arm_float_abi'] = floatabi
|
||||
elif gn_args['target_cpu'] == 'armv5te':
|
||||
raise Exception("GN support for armv5te unimplemented")
|
||||
|
||||
|
@ -323,8 +329,14 @@ def parse_args(args):
|
|||
default='host')
|
||||
common_group.add_argument("-v", "--verbose",
|
||||
help='Verbose output.',
|
||||
default=False, action="store_true")
|
||||
default=False,
|
||||
action="store_true")
|
||||
|
||||
other_group.add_argument('--arm-float-abi',
|
||||
type=str,
|
||||
help='The ARM float ABI (soft, softfp, hard)',
|
||||
metavar='[soft,softfp,hard]',
|
||||
default='')
|
||||
other_group.add_argument('--asan',
|
||||
help='Build with ASAN',
|
||||
default=UseASAN(),
|
||||
|
|
Loading…
Reference in a new issue