Skip to content

Commit

Permalink
merge mozilla-central to autoland. r=merge a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Archaeopteryx committed Oct 29, 2017
2 parents 0786d08 + a6ee127 commit 794abc6
Show file tree
Hide file tree
Showing 33 changed files with 393 additions and 312 deletions.
2 changes: 1 addition & 1 deletion CLOBBER
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.

Bug 1408789, Windows compiler change
Bug 1163171, Android compiler change
13 changes: 11 additions & 2 deletions build/autoconf/android.m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ AC_DEFUN([MOZ_ANDROID_NDK],
case "$target" in
*-android*|*-linuxandroid*)
dnl $android_platform will be set for us by Python configure.
CPPFLAGS="-idirafter $android_platform/usr/include $CPPFLAGS"
directory_include_args="-isystem $android_platform/usr/include"
# clang will do any number of interesting things with host tools unless we tell
# it to use the NDK tools.
extra_opts="-gcc-toolchain $(dirname $(dirname $TOOLCHAIN_PREFIX))"
CPPFLAGS="$extra_opts $CPPFLAGS"
ASFLAGS="$extra_opts $ASFLAGS"
LDFLAGS="$extra_opts $LDFLAGS"
CPPFLAGS="$directory_include_args $CPPFLAGS"
CFLAGS="-fno-short-enums -fno-exceptions $CFLAGS"
CXXFLAGS="-fno-short-enums -fno-exceptions $CXXFLAGS $stlport_cppflags"
ASFLAGS="-idirafter $android_platform/usr/include -DANDROID $ASFLAGS"
ASFLAGS="$directory_include_args -DANDROID $ASFLAGS"
dnl Add --allow-shlib-undefined, because libGLESv2 links to an
dnl undefined symbol (present on the hardware, just not in the
Expand Down
32 changes: 21 additions & 11 deletions build/autoconf/toolchain.m4
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,31 @@ AC_LANG_CPLUSPLUS
if test "$GNU_CXX"; then
AC_CACHE_CHECK([whether 64-bits std::atomic requires -latomic],
ac_cv_needs_atomic,
AC_TRY_LINK(
[#include <cstdint>
#include <atomic>],
[ std::atomic<uint64_t> foo; foo = 1; ],
ac_cv_needs_atomic=no,
_SAVE_LIBS="$LIBS"
LIBS="$LIBS -latomic"
dnl x86 with clang is a little peculiar. std::atomic does not require
dnl linking with libatomic, but using atomic intrinsics does, so we
dnl force the setting on for such systems. (This setting is probably
dnl applicable to all x86 systems using clang, but Android is currently
dnl the one we care most about, and nobody has reported problems on
dnl other platforms before this point.)
if test "$CC_TYPE" = "clang" -a "$CPU_ARCH" = "x86" -a "$OS_TARGET" = "Android"; then
ac_cv_needs_atomic=yes
else
AC_TRY_LINK(
[#include <cstdint>
#include <atomic>],
[ std::atomic<uint64_t> foo; foo = 1; ],
ac_cv_needs_atomic=yes,
ac_cv_needs_atomic="do not know; assuming no")
LIBS="$_SAVE_LIBS"
)
ac_cv_needs_atomic=no,
_SAVE_LIBS="$LIBS"
LIBS="$LIBS -latomic"
AC_TRY_LINK(
[#include <cstdint>
#include <atomic>],
[ std::atomic<uint64_t> foo; foo = 1; ],
ac_cv_needs_atomic=yes,
ac_cv_needs_atomic="do not know; assuming no")
LIBS="$_SAVE_LIBS"
)
fi
)
if test "$ac_cv_needs_atomic" = yes; then
MOZ_NEEDS_LIBATOMIC=1
Expand Down
47 changes: 38 additions & 9 deletions build/moz.configure/android-ndk.configure
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,6 @@ def android_platform(target, android_version, ndk, _):
add_old_configure_assignment('android_platform', android_platform)


@depends(android_platform)
def extra_toolchain_flags(platform_dir):
if not platform_dir:
return []
return ['-idirafter',
os.path.join(platform_dir, 'usr', 'include')]


@depends(target, host, ndk, '--with-android-toolchain', '--help')
@checking('for the Android toolchain directory', lambda x: x or 'not found')
@imports(_from='os.path', _import='isdir')
Expand Down Expand Up @@ -203,6 +195,16 @@ def android_toolchain_prefix_base(target):
return target.toolchain


@depends(android_platform, android_toolchain)
def extra_toolchain_flags(platform_dir, toolchain_dir):
if not platform_dir:
return []
return ['-isystem',
os.path.join(platform_dir, 'usr', 'include'),
'-gcc-toolchain',
toolchain_dir]


@depends(android_toolchain_prefix_base, android_toolchain)
def android_toolchain_prefix(prefix_base, toolchain):
if toolchain:
Expand Down Expand Up @@ -257,17 +259,44 @@ add_old_configure_assignment('stlport_cppflags', stlport_cppflags)

@depends(stlport_cppflags, android_platform, android_toolchain,
android_toolchain_prefix_base, '--help')
@imports(_from='os.path', _import='isdir')
def bindgen_cflags_defaults(stlport_cppflags, android_platform, toolchain,
toolchain_prefix, _):
if not stlport_cppflags:
return

gcc_include = os.path.join(
toolchain, 'lib', 'gcc', toolchain_prefix, '4.9')
toolchain, 'lib', 'gcc', toolchain_prefix, '4.9.x')
if not isdir(gcc_include):
gcc_include = os.path.join(
toolchain, 'lib', 'gcc', toolchain_prefix, '4.9')

cflags_format = "%s -isystem %s -gcc-toolchain %s -I%s -I%s"
return cflags_format % (stlport_cppflags,
os.path.join(android_platform, 'usr', 'include'),
toolchain,
os.path.join(gcc_include, 'include'),
os.path.join(gcc_include, 'include-fixed'))


@depends(host, ndk)
@imports(_from='os.path', _import='exists')
@imports(_from='os.path', _import='isdir')
def android_clang_compiler(host, ndk):
if not ndk:
return

llvm_path = '%s/toolchains/llvm/prebuilt/%s-%s/bin' % (ndk,
host.kernel.lower(),
host.cpu)
if not isdir(llvm_path) and host.cpu == 'x86_64':
llvm_path = toolchain_format % (ndk, host.kernel.lower(), 'x86')

if not isdir(llvm_path):
die("Couldn't find path to LLVM toolchain at %s" % llvm_path)

clang = '%s/clang' % llvm_path
if not exists(clang):
die("Couln't find clang in LLVM toolchain at %s" % clang)

return clang
13 changes: 11 additions & 2 deletions build/moz.configure/toolchain.configure
Original file line number Diff line number Diff line change
Expand Up @@ -647,11 +647,16 @@ def default_c_compilers(host_or_target):
'''
assert host_or_target in (host, target)

@depends(host_or_target, target, toolchain_prefix)
def default_c_compilers(host_or_target, target, toolchain_prefix):
@depends(host_or_target, target, toolchain_prefix, android_clang_compiler)
def default_c_compilers(host_or_target, target, toolchain_prefix, android_clang_compiler):
gcc = ('gcc',)
if toolchain_prefix and host_or_target is target:
gcc = tuple('%sgcc' % p for p in toolchain_prefix) + gcc
# Android sets toolchain_prefix and android_clang_compiler, but
# we want the latter to take precedence, because the latter can
# point at clang, which is what we want to use.
if android_clang_compiler and host_or_target is target:
gcc = (android_clang_compiler,) + gcc

if host_or_target.kernel == 'WINNT':
return ('cl', 'clang-cl') + gcc + ('clang',)
Expand Down Expand Up @@ -876,6 +881,10 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
'Only GCC 4.9 or newer is supported (found version %s).'
% info.version)

if info.type == 'gcc' and host_or_target.os == 'Android':
raise FatalCheckError('GCC is not supported on Android.\n'
'Please use clang from the Android NDK instead.')

# If you want to bump the version check here search for
# cxx_alignof above, and see the associated comment.
if info.type == 'clang' and not info.version:
Expand Down
4 changes: 2 additions & 2 deletions build/unix/elfhack/inject/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ for v in ('OS_CPPFLAGS', 'OS_CFLAGS', 'DEBUG', 'CLANG_PLUGIN', 'OPTIMIZE',
flags = []
idx = 0
for flag in COMPILE_FLAGS[v]:
if flag == '-idirafter':
if flag == '-isystem':
flags.append(''.join(COMPILE_FLAGS[v][idx:idx + 2]))
elif flag.startswith(('-m', '-I', '-idirafter')):
elif flag.startswith(('-m', '-I', '-isystem')):
flags.append(flag)
idx += 1
COMPILE_FLAGS[v] = flags
Expand Down
8 changes: 4 additions & 4 deletions gfx/webrender_bindings/Moz2DImageRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ static MOZ_THREAD_LOCAL(FT_Library) sFTLibrary;
#endif

struct FontTemplate {
void *mData;
const uint8_t *mData;
size_t mSize;
int mIndex;
uint32_t mIndex;
const VecU8 *mVec;
RefPtr<UnscaledFont> mUnscaledFont;
};
Expand All @@ -55,7 +55,7 @@ std::unordered_map<FontKey, FontTemplate> sFontDataTable;

extern "C" {
void
AddFontData(wr::FontKey aKey, void *aData, size_t aSize, int aIndex, ArcVecU8 *aVec) {
AddFontData(WrFontKey aKey, const uint8_t *aData, size_t aSize, uint32_t aIndex, const ArcVecU8 *aVec) {
auto i = sFontDataTable.find(aKey);
if (i == sFontDataTable.end()) {
FontTemplate font;
Expand All @@ -68,7 +68,7 @@ AddFontData(wr::FontKey aKey, void *aData, size_t aSize, int aIndex, ArcVecU8 *a
}

void
DeleteFontData(wr::FontKey aKey) {
DeleteFontData(WrFontKey aKey) {
auto i = sFontDataTable.find(aKey);
if (i != sFontDataTable.end()) {
sFontDataTable.erase(i);
Expand Down
4 changes: 2 additions & 2 deletions gfx/webrender_bindings/src/moz2d_renderer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(improper_ctypes)] // this is needed so that rustc doesn't complain about passing the &Arc<Vec> to an extern function
use webrender_api::*;
use bindings::{ByteSlice, MutByteSlice, wr_moz2d_render_cb};
use bindings::{ByteSlice, MutByteSlice, wr_moz2d_render_cb, ArcVecU8};
use rayon::ThreadPool;

use std::collections::hash_map::{HashMap, Entry};
Expand Down Expand Up @@ -198,7 +198,7 @@ impl BlobImageRenderer for Moz2dImageRenderer {
use bindings::WrFontKey;
extern "C" {
#[allow(improper_ctypes)]
fn AddFontData(key: WrFontKey, data: *const u8, size: usize, index: u32, vec: &Arc<Vec<u8>>);
fn AddFontData(key: WrFontKey, data: *const u8, size: usize, index: u32, vec: &ArcVecU8);
fn DeleteFontData(key: WrFontKey);
}

Expand Down
68 changes: 38 additions & 30 deletions gfx/webrender_bindings/webrender_ffi_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,39 @@ struct WrState;

struct WrThreadPool;

typedef Vec_u8 VecU8;
struct IdNamespace {
uint32_t mHandle;

bool operator==(const IdNamespace& aOther) const {
return mHandle == aOther.mHandle;
}
bool operator!=(const IdNamespace& aOther) const {
return mHandle != aOther.mHandle;
}
bool operator<(const IdNamespace& aOther) const {
return mHandle < aOther.mHandle;
}
bool operator<=(const IdNamespace& aOther) const {
return mHandle <= aOther.mHandle;
}
};

struct FontKey {
IdNamespace mNamespace;
uint32_t mHandle;

bool operator==(const FontKey& aOther) const {
return mNamespace == aOther.mNamespace &&
mHandle == aOther.mHandle;
}
};

typedef FontKey WrFontKey;

typedef Arc_VecU8 ArcVecU8;

typedef Vec_u8 VecU8;

struct Epoch {
uint32_t mHandle;

Expand Down Expand Up @@ -375,23 +404,6 @@ struct WrTransformProperty {
LayoutTransform transform;
};

struct IdNamespace {
uint32_t mHandle;

bool operator==(const IdNamespace& aOther) const {
return mHandle == aOther.mHandle;
}
bool operator!=(const IdNamespace& aOther) const {
return mHandle != aOther.mHandle;
}
bool operator<(const IdNamespace& aOther) const {
return mHandle < aOther.mHandle;
}
bool operator<=(const IdNamespace& aOther) const {
return mHandle <= aOther.mHandle;
}
};

typedef IdNamespace WrIdNamespace;

// Represents RGBA screen colors with floating point numbers.
Expand Down Expand Up @@ -772,18 +784,6 @@ struct WrImageDescriptor {

typedef ExternalImageType WrExternalImageBufferType;

struct FontKey {
IdNamespace mNamespace;
uint32_t mHandle;

bool operator==(const FontKey& aOther) const {
return mNamespace == aOther.mNamespace &&
mHandle == aOther.mHandle;
}
};

typedef FontKey WrFontKey;

struct FontInstanceOptions {
FontRenderMode render_mode;
SubpixelDirection subpx_dir;
Expand Down Expand Up @@ -873,6 +873,14 @@ typedef TypedRect_u32__DevicePixel DeviceUintRect;
* 2. Run `rustup run nightly cbindgen toolkit/library/rust/ --crate webrender_bindings -o gfx/webrender_bindings/webrender_ffi_generated.h`
*/

extern void AddFontData(WrFontKey aKey,
const uint8_t *aData,
size_t aSize,
uint32_t aIndex,
const ArcVecU8 *aVec);

extern void DeleteFontData(WrFontKey aKey);

extern void gfx_critical_note(const char *aMsg);

extern bool gfx_use_wrench();
Expand Down
3 changes: 3 additions & 0 deletions js/src/jsapi-tests/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ USE_LIBS += [
'static:js',
]

if CONFIG['MOZ_NEEDS_LIBATOMIC']:
OS_LIBS += ['atomic']

OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']

if CONFIG['GNU_CXX']:
Expand Down
2 changes: 1 addition & 1 deletion layout/generic/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ load 944909-1.html
load 946167-1.html
load 947158.html
load 949932.html
asserts-if(Android,0-1) load 964078.html # bug 989718
load 964078.html
load 970710.html
load 973701-1.xhtml
load 973701-2.xhtml
Expand Down
4 changes: 2 additions & 2 deletions layout/reftests/counters/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
== text-boundaries-subpixel.html text-boundaries-subpixel-ref.html
== counter-hebrew-test.html counter-hebrew-reference.html
== counters-hebrew-test.html counters-hebrew-reference.html
fails-if(xulRuntime.XPCOMABI.match(/arm/)) == counter-reset-integer-range.html counter-reset-integer-range-ref.html # bug 989718
== counter-reset-integer-range.html counter-reset-integer-range-ref.html
== counter-ua-limits-00.html counter-ua-limits-00-ref.html
== counter-ua-limits-01.html counter-ua-limits-01-ref.html
fails-if(xulRuntime.XPCOMABI.match(/arm/)) == counter-ua-limits-02.html counter-ua-limits-02-ref.html # bug 989718
== counter-ua-limits-02.html counter-ua-limits-02-ref.html
== counter-ua-limits-03.html counter-ua-limits-03-ref.html
== counter-ua-limits-list-00.html counter-ua-limits-list-00-ref.html
== counter-ua-limits-list-01.html counter-ua-limits-list-01-ref.html
Expand Down
4 changes: 4 additions & 0 deletions mobile/android/config/mozconfigs/common
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ if [ "x$IS_NIGHTLY" = "xyes" ]; then
MOZ_AUTOMATION_UPLOAD_SYMBOLS=${MOZ_AUTOMATION_UPLOAD_SYMBOLS-1}
fi

if [ -z "$NO_NDK" ]; then
. "$topsrcdir/build/mozconfig.stylo"
fi

MOZ_AUTOMATION_L10N_CHECK=0
. "$topsrcdir/build/mozconfig.common"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
{
"version": "Android NDK r11c",
"size": 299040511,
"version": "Android NDK r15c + LLVM",
"size": 403602514,
"visibility": "internal",
"digest": "0f9ba6efbc5379225ebe13b956b9f19d055654f9b0ae999b1eb18ca836e1665be820bcc05193ba24c9a328a1bfea63fe814c1f364b28ae29266effaa04eedbee",
"digest": "8515b8f615935e9ee81c1ada55ec46a9ebd46ca095b33bf2bf34d794b7737ffa8f32b4e3f410d3f63e2f2510fef7a5836a72c34b942a0687af8ca5a5d50efdb6",
"algorithm": "sha512",
"filename": "android-ndk.tar.bz2",
"unpack": true
Expand Down
Loading

0 comments on commit 794abc6

Please sign in to comment.