Merge pull request #11281 from electron/mips64el

Enable mips64el CI job
This commit is contained in:
Cheng Zhao
2018-01-29 17:08:19 +09:00
committed by GitHub
11 changed files with 58 additions and 31 deletions

View File

@@ -339,3 +339,6 @@ workflows:
build-x64:
jobs:
- electron-linux-x64
build-mips64el:
jobs:
- electron-linux-mips64el

3
.gitignore vendored
View File

@@ -28,6 +28,7 @@
/external_binaries/
/out/
/vendor/.gclient
/vendor/cross-gcc-4.9.3-n64-loongson-rc5.4
/vendor/debian_jessie_amd64-sysroot/
/vendor/debian_jessie_arm-sysroot/
/vendor/debian_jessie_arm64-sysroot/
@@ -36,8 +37,6 @@
/vendor/debian_wheezy_amd64-sysroot/
/vendor/debian_wheezy_arm-sysroot/
/vendor/debian_wheezy_i386-sysroot/
/vendor/gcc-4.8.3-d197-n64-loongson/
/vendor/readme-gcc483-loongson.txt
/vendor/download/
/vendor/llvm-build/
/vendor/llvm/

View File

@@ -62,6 +62,9 @@ v8::Local<v8::Value> Converter<const net::AuthChallengeInfo*>::ToV8(
// static
v8::Local<v8::Value> Converter<scoped_refptr<net::X509Certificate>>::ToV8(
v8::Isolate* isolate, const scoped_refptr<net::X509Certificate>& val) {
#if defined(ARCH_CPU_MIPS64EL)
return v8::Undefined(isolate);
#else
mate::Dictionary dict(isolate, v8::Object::New(isolate));
std::string encoded_data;
net::X509Certificate::GetPEMEncoded(
@@ -92,11 +95,15 @@ v8::Local<v8::Value> Converter<scoped_refptr<net::X509Certificate>>::ToV8(
}
return dict.GetHandle();
#endif
}
bool Converter<scoped_refptr<net::X509Certificate>>::FromV8(
v8::Isolate* isolate, v8::Local<v8::Value> val,
scoped_refptr<net::X509Certificate>* out) {
#if defined(ARCH_CPU_MIPS64EL)
return false;
#else
mate::Dictionary dict;
if (!ConvertFromV8(isolate, val, &dict))
return false;
@@ -123,6 +130,7 @@ bool Converter<scoped_refptr<net::X509Certificate>>::FromV8(
}
return true;
#endif
}
// static

View File

@@ -1,10 +1,12 @@
{
'variables': {
# The libraries brightray will be compiled to.
'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 x11-xcb xcb xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss',
'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 x11-xcb xcb xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0',
'conditions': [
['target_arch=="mips64el"', {
'linux_system_libraries': '<(linux_system_libraries) libpulse',
}, {
'linux_system_libraries': '<(linux_system_libraries) nss',
}],
],
},

View File

@@ -118,16 +118,10 @@
'defines': [
'USE_OPENSSL',
],
}, {
'defines': [
'USE_X11',
# "use_nss_certs" is set to 1 in libchromiumcontent.
'USE_NSS_CERTS',
'USE_NSS', # deprecated after Chrome 45.
],
}],
['OS=="linux"', {
'defines': [
'USE_X11',
'_LARGEFILE_SOURCE',
'_LARGEFILE64_SOURCE',
'_FILE_OFFSET_BITS=64',
@@ -137,6 +131,11 @@
'-fno-rtti',
],
}], # OS=="linux"
['OS=="linux" and target_arch!="mips64el"', {
'defines': [
'USE_NSS_CERTS',
],
}], # OS=="linux" and target_arch!="mips64el"
['OS=="mac"', {
'defines': [
# The usage of "webrtc/modules/desktop_capture/desktop_capture_options.h"

View File

@@ -17,15 +17,27 @@ Please note, the `ARM` version of Windows is not supported for now.
### Linux
The prebuilt `ia32` (`i686`) and `x64` (`amd64`) binaries of Electron are built on
Ubuntu 12.04, the `arm` binary is built against ARM v7 with hard-float ABI and
NEON for Debian Wheezy.
Whether the prebuilt binary can run on a distribution depends on whether the
distribution includes the libraries that Electron is linked to on the building
platform, so only Ubuntu 12.04 is guaranteed to work, but following platforms
are also verified to be able to run the prebuilt binaries of Electron:
The prebuilt binaries of Electron are built for Debian Jessie, but whether the
prebuilt binary can run on a distribution depends on whether the distribution
includes the libraries that Electron is linked to on the building platform, so
only Debian Jessie is guaranteed to work, but following platforms are also
verified to be able to run the prebuilt binaries of Electron:
* Ubuntu 12.04 and later
* Fedora 21
* Debian 8
* Debian 8 and later
Electorn provides prebuilt binaries for following CPU architectures:
* `ia32` (`i686`)
* `x64` (`amd64`)
* `armv7l`
* `arm64`
* `mips64el`
The `arm` binary is built against ARM v7 with hard-float ABI and NEON, and it is
not guaranteed to run on all ARM platforms.
The `mips64el` binary is built with toolchains provided by Loongson, and it is
not guaranteed to run on all MIPS64 platforms. And currently all certificate
related APIs are not working on `mips64el` builds.

View File

@@ -343,7 +343,6 @@
['OS=="linux"', {
'sources': [
'<@(lib_sources_linux)',
'<@(lib_sources_nss)',
],
'link_settings': {
'ldflags': [
@@ -366,6 +365,11 @@
'vendor/breakpad/breakpad.gyp:breakpad_client',
],
}], # OS=="linux"
['OS=="linux" and target_arch!="mips64el"', {
'sources': [
'<@(lib_sources_nss)',
],
}], # OS=="linux" and target_arch!="mips64el"
['OS=="linux" and clang==1', {
# Required settings of using breakpad.
'cflags_cc': [

View File

@@ -215,7 +215,7 @@ def strip_binary(binary_path):
elif get_target_arch() == 'arm64':
strip = 'aarch64-linux-gnu-strip'
elif get_target_arch() == 'mips64el':
strip = 'mips64el-redhat-linux-strip'
strip = 'mips64el-loongson-linux-strip'
else:
strip = 'strip'
execute([strip, binary_path], env=build_env())

View File

@@ -8,8 +8,8 @@ import sys
# URL to the mips64el sysroot image.
MIPS64EL_SYSROOT_URL = 'https://github.com/electron/debian-sysroot-image-creator/releases/download/v0.5.0/debian_jessie_mips64-sysroot.tar.bz2'
# URL to the mips64el toolchain.
MIPS64EL_GCC = 'gcc-4.8.3-d197-n64-loongson'
MIPS64EL_GCC_URL = 'http://ftp.loongnix.org/toolchain/gcc/release/' + MIPS64EL_GCC + '.tar.gz'
MIPS64EL_GCC = 'cross-gcc-4.9.3-n64-loongson-rc5.4'
MIPS64EL_GCC_URL = 'https://github.com/electron/debian-sysroot-image-creator/releases/download/v0.5.0/' + MIPS64EL_GCC + '.tar.gz'
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'
@@ -93,11 +93,11 @@ def build_env():
VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
gcc_dir = os.path.join(VENDOR_DIR, MIPS64EL_GCC)
ldlib_dirs = [
gcc_dir + '/usr/x86_64-unknown-linux-gnu/mips64el-redhat-linux/lib',
gcc_dir + '/usr/x86_64-unknown-linux-gnu/mips64el-loongson-linux/lib',
gcc_dir + '/usr/lib64',
gcc_dir + '/usr/mips64el-redhat-linux/lib64',
gcc_dir + '/usr/mips64el-redhat-linux/sysroot/lib64',
gcc_dir + '/usr/mips64el-redhat-linux/sysroot/usr/lib64',
gcc_dir + '/usr/mips64el-loongson-linux/lib64',
gcc_dir + '/usr/mips64el-loongson-linux/sysroot/lib64',
gcc_dir + '/usr/mips64el-loongson-linux/sysroot/usr/lib64',
]
env['LD_LIBRARY_PATH'] = os.pathsep.join(ldlib_dirs)
env['PATH'] = os.pathsep.join([gcc_dir + '/usr/bin', env['PATH']])

View File

@@ -6,7 +6,7 @@
'clang%': 1,
# Path to mips64el toolchain.
'make_mips64_dir%': 'vendor/gcc-4.8.3-d197-n64-loongson/usr',
'make_mips64_dir%': 'vendor/cross-gcc-4.9.3-n64-loongson-rc5.4/usr',
'variables': {
# The minimum macOS SDK version to use.
@@ -138,8 +138,8 @@
['target_arch=="mips64el"', {
'make_global_settings': [
['CC', '<(make_mips64_dir)/bin/mips64el-redhat-linux-gcc'],
['CXX', '<(make_mips64_dir)/bin/mips64el-redhat-linux-g++'],
['CC', '<(make_mips64_dir)/bin/mips64el-loongson-linux-gcc'],
['CXX', '<(make_mips64_dir)/bin/mips64el-loongson-linux-g++'],
['CC.host', '$(CC)'],
['CXX.host', '$(CXX)'],
],