From c6db88b0cf3938a66e27750cc4de02fe82729e76 Mon Sep 17 00:00:00 2001 From: "solenberg@webrtc.org" Date: Wed, 4 Jun 2014 17:15:42 +0000 Subject: [PATCH] Make it possible to build webrtc for arm64. - Bump revision of protobuf lib - Remove -Wextra for arm64 gcc targets (warnings in stlport) - Add MemoryBarrier implementation in single_rw_fifo.cc. - [pending 15619004]: Bump revision of /deps/tools/android to get md5sum_bin for arm64. BUG=chromium:354405,chromium:354539 R=andrew@webrtc.org, fischman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/15629004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6330 4adac7df-926f-26a2-2b94-8c16560cd09d --- DEPS | 4 ++-- webrtc/build/common.gypi | 24 +++++++++++++------ .../audio_device/android/single_rw_fifo.cc | 16 +++++++------ 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/DEPS b/DEPS index f1b0cad57..f10a5dd93 100644 --- a/DEPS +++ b/DEPS @@ -108,7 +108,7 @@ deps = { Var("chromium_trunk") + "/deps/third_party/opus@256783", "third_party/protobuf": - Var("chromium_trunk") + "/src/third_party/protobuf@251211", + Var("chromium_trunk") + "/src/third_party/protobuf@" + Var("chromium_revision"), "third_party/sqlite/": Var("chromium_trunk") + "/src/third_party/sqlite@" + Var("chromium_revision"), @@ -205,7 +205,7 @@ deps_os = { # Precompiled tools needed for Android test execution. Needed since we can't # compile them from source in WebRTC since they depend on Chromium's base. "tools/android": - (Var("googlecode_url") % "webrtc") + "/deps/tools/android@4258", + (Var("googlecode_url") % "webrtc") + "/deps/tools/android@6306", "third_party/android_tools": From("chromium_deps", "src/third_party/android_tools"), diff --git a/webrtc/build/common.gypi b/webrtc/build/common.gypi index 233b1b8c0..da96c1d3c 100644 --- a/webrtc/build/common.gypi +++ b/webrtc/build/common.gypi @@ -189,13 +189,23 @@ }, { 'conditions': [ ['os_posix==1', { - 'cflags': [ - '-Wextra', - # We need to repeat some flags from Chromium's common.gypi here - # that get overridden by -Wextra. - '-Wno-unused-parameter', - '-Wno-missing-field-initializers', - '-Wno-strict-overflow', + 'conditions': [ + # -Wextra is currently disabled in Chromium's common.gypi. Enable + # for targets that can handle it. For Android/arm64 right now + # there will be an 'enumeral and non-enumeral type in conditional + # expression' warning in android_tools/ndk_experimental's version + # of stlport. + # See: https://code.google.com/p/chromium/issues/detail?id=379699 + ['target_arch!="arm64" or OS!="android"', { + 'cflags': [ + '-Wextra', + # We need to repeat some flags from Chromium's common.gypi + # here that get overridden by -Wextra. + '-Wno-unused-parameter', + '-Wno-missing-field-initializers', + '-Wno-strict-overflow', + ], + }], ], 'cflags_cc': [ '-Wnon-virtual-dtor', diff --git a/webrtc/modules/audio_device/android/single_rw_fifo.cc b/webrtc/modules/audio_device/android/single_rw_fifo.cc index 3eb993c04..73d4d61dd 100644 --- a/webrtc/modules/audio_device/android/single_rw_fifo.cc +++ b/webrtc/modules/audio_device/android/single_rw_fifo.cc @@ -20,14 +20,16 @@ namespace webrtc { namespace subtle { -#if defined(__ARMEL__) -// From http://src.chromium.org/viewvc/chrome/trunk/src/base/atomicops_internals_arm_gcc.h -// Note that it is only the MemoryBarrier function that makes this class arm -// specific. Borrowing other MemoryBarrier implementations, this class could -// be extended to more platforms. +#if defined(__aarch64__) +// From http://http://src.chromium.org/viewvc/chrome/trunk/src/base/atomicops_internals_arm64_gcc.h inline void MemoryBarrier() { - // Note: This is a function call, which is also an implicit compiler - // barrier. + __asm__ __volatile__ ("dmb ish" ::: "memory"); +} + +#elif defined(__ARMEL__) +// From http://src.chromium.org/viewvc/chrome/trunk/src/base/atomicops_internals_arm_gcc.h +inline void MemoryBarrier() { + // Note: This is a function call, which is also an implicit compiler barrier. typedef void (*KernelMemoryBarrierFunc)(); ((KernelMemoryBarrierFunc)0xffff0fa0)(); }