New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add arm64 build support #10219

Merged
merged 4 commits into from Aug 22, 2017

Conversation

Projects
None yet
3 participants
@HAMIDx9
Copy link
Contributor

HAMIDx9 commented Aug 8, 2017

This PR has patches to build arm64 electron package successfully.
I've also provided unofficial packages for download until official releases prepared for the community.
This build has been tested successfully on Odroid C2 (arm64). Unfortunately support for electron-packager is not provided here.
You may just copy your resources to the electron-v1.7.5-linux-arm64.zip and run electron there.

libcromiumcontent build instructions:

$ git clone https://chromium.googlesource.com/chromium/src.git
$ cd libcromiumcontent
$ ./script/bootstrap
$ ./script/update -t arm64
$ ./script/build -t arm64
$ ./script/create-dist -t arm64
$ mkdir -p linux/arm64/7a9d4a1c9c265468dd54005f6c1920b2cc2c8ec3 # HACK for using later for electron build process
$ mv libchromiumcontent* linux/arm64/7a9d4a1c9c265468dd54005f6c1920b2cc2c8ec3

electron + arm64 support build instruction:

$ git clone https://github.com/HAMIDx9/electron.git
$ cd electron
$ ./script/bootstrap.py -v --target_arch=arm64 -u file:///home/hamidx9/dev/electron/libchromiumcontent/
$ ./script/build.py -c R
$ ./script/create-dist.py
$ ls ./dist/electron-v1.7.5-linux-arm64.zip

Unofficial Builds:
electron-v1.7.5-linux-arm64-symbols.zip
electron-v1.7.5-linux-arm64.zip
ffmpeg-v1.7.5-linux-arm64.zip
libchromiumcontent/libchromiumcontent-static.zip
libchromiumcontent/libchromiumcontent.zip

sha256sum:

2d3fe036b4fa1efdb99b8fa15e03f11b9829428529640fa9db4794c8cd2babf7  electron-v1.7.5-linux-arm64-symbols.zip
2df42153e59d40ca03bc281cc515db3331d4facd9d2cdc7fe66aa660b76d43a2  electron-v1.7.5-linux-arm64.zip
4528e28412e5d1074b35e6bcb6198e07f0e4b6ef3434565b4d294124f9e01dbd  ffmpeg-v1.7.5-linux-arm64.zip
b4e8d028d34ce5a9010d4900140466e1f55c835ad7e64c0c7403d82ea41c44bf  libchromiumcontent/libchromiumcontent-static.zip
afa2486256ce561fd3a815e08a0dfee4841a7cbe467f3e518a4712aae48e25fe  libchromiumcontent/libchromiumcontent.zip

@HAMIDx9 HAMIDx9 referenced this pull request Aug 8, 2017

Closed

Add arm64 build support #10205

@zcbenz

This comment has been minimized.

Copy link
Contributor

zcbenz commented Aug 8, 2017

The arm and ia32 builds are failing for this change, do you have an idea of it? It seems that linux_syscall_support.h is just updated to latest.

FAILED: ../../vendor/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/vendor/breakpad/src/client/linux/handler/breakpad_client.exception_handler.o.d -DNDEBUG -DV8_USE_EXTERNAL_STARTUP_DATA -DSK_SUPPORT_LEGACY_GETTOPDEVICE -DSK_SUPPORT_LEGACY_BITMAP_CONFIG -DSK_SUPPORT_LEGACY_DEVICE_VIRTUAL_ISOPAQUE -DSK_SUPPORT_LEGACY_N32_NAME -DSK_SUPPORT_LEGACY_SETCONFIG -DSK_IGNORE_ETC1_SUPPORT -DSK_IGNORE_GPU_DITHER -DDISABLE_NACL -DTOOLKIT_VIEWS -DUSE_AURA -DUSE_X11 -DUSE_NSS_CERTS -DUSE_NSS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DDEBUG -DCOMPONENT_BUILD -DGURL_DLL -DSKIA_DLL -DUSING_V8_SHARED -DWEBKIT_DLL -I../../vendor/breakpad/src -I../../vendor/breakpad/src/client -I../../vendor/breakpad/src/third_party/linux/include -I../../vendor -I../../vendor/breakpad -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-empty-body --sysroot=/home/travis/build/electron/electron/vendor/debian_wheezy_arm-sysroot -target arm-linux-gnueabihf -march=armv7-a -mtune=generic-armv7-a -mfpu=neon -mfloat-abi=hard -mthumb -std=c++11 -D__STRICT_ANSI__ -fno-rtti  -c ../../vendor/breakpad/src/client/linux/handler/exception_handler.cc -o obj/vendor/breakpad/src/client/linux/handler/breakpad_client.exception_handler.o
In file included from ../../vendor/breakpad/src/client/linux/handler/exception_handler.cc:66:
In file included from ../../vendor/breakpad/src/client/linux/handler/exception_handler.h:42:
In file included from ../../vendor/breakpad/src/client/linux/minidump_writer/minidump_writer.h:41:
In file included from ../../vendor/breakpad/src/client/linux/minidump_writer/linux_dumper.h:51:
In file included from ../../vendor/breakpad/src/client/linux/dump_writer_common/thread_info.h:37:
../../vendor/breakpad/src/common/memory.h:125:15: error: use of undeclared identifier 'sys_mmap2'
    void *a = sys_mmap2(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
              ^
@HAMIDx9

This comment has been minimized.

Copy link
Contributor

HAMIDx9 commented Aug 8, 2017

Yes, just an updated version. let me check the issue .

@HAMIDx9

This comment has been minimized.

Copy link
Contributor

HAMIDx9 commented Aug 8, 2017

Ok, following changes on linux_syscall_support.h we should use sys_mmap instead of sys_mmap2 for arm and i386.
following files need to be fixed:

vendor/breakpad/src/common/linux/memory_mapped_file.cc
vendor/breakpad/src/common/memory.h

arm and i386 pass the build process now.

Note: After checking master branch of breakpad on chromium they also fixed this and we cant see any sys_mmap2 usage there which make sense. Any chance to update breakpad as well? What's your opinion @zcbenz ?

@HAMIDx9

This comment has been minimized.

Copy link
Contributor

HAMIDx9 commented Aug 8, 2017

diff with HEAD of breakpad master chromium for eg:

diff --git a/vendor/breakpad/src/common/memory.h b/tmp/src/common/memory.h
index 16a612b..9158b50 100644
--- a/vendor/breakpad/src/common/memory.h
+++ b/tmp/src/common/memory.h
@@ -44,7 +44,6 @@
 
 #ifdef __APPLE__
 #define sys_mmap mmap
-#define sys_mmap2 mmap
 #define sys_munmap munmap
 #define MAP_ANONYMOUS MAP_ANON
 #else
@@ -117,14 +116,8 @@ class PageAllocator {
 
  private:
   uint8_t *GetNPages(size_t num_pages) {
-#if defined(__x86_64__) || defined(__aarch64__) || defined(__aarch64__) || \
-    ((defined(__mips__) && _MIPS_SIM == _ABI64))
     void *a = sys_mmap(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
                        MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-#else
-    void *a = sys_mmap2(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
-                        MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-#endif
     if (a == MAP_FAILED)
       return NULL;
@zcbenz

This comment has been minimized.

Copy link
Contributor

zcbenz commented Aug 8, 2017

@HAMIDx9 Thanks for looking into it, I'll apply the change on our fork of breakpad and then update this PR.

@zcbenz

This comment has been minimized.

Copy link
Contributor

zcbenz commented Aug 8, 2017

@groundwater @jkleinsc The arm64 target built successfully on CI. I have created a job for electron-linux-arm64 on our internal CI, but currently it is failing because of lack of some dependencies, if we can fix it we can probably include arm64 in next release.

@zcbenz

This comment has been minimized.

Copy link
Contributor

zcbenz commented Aug 8, 2017

@groundwater I'm seeing this on janky, do you remember how you solved this?

[827/1325] LINK openssl-cli
FAILED: ../../vendor/llvm-build/Release+Asserts/bin/clang --sysroot=/var/lib/jenkins/workspace/electron-linux-arm64/vendor/debian_jessie_arm64-sysroot -L/var/lib/jenkins/workspace/electron-linux-arm64/vendor/debian_jessie_arm64-sysroot/lib/aarch64-linux-gnu -Wl,-rpath-link=/var/lib/jenkins/workspace/electron-linux-arm64/vendor/debian_jessie_arm64-sysroot/lib/aarch64-linux-gnu -L/var/lib/jenkins/workspace/electron-linux-arm64/vendor/debian_jessie_arm64-sysroot/usr/lib/aarch64-linux-gnu -Wl,-rpath-link=/var/lib/jenkins/workspace/electron-linux-arm64/vendor/debian_jessie_arm64-sysroot/usr/lib/aarch64-linux-gnu -target  aarch64-linux-gnu -o openssl-cli -Wl,--start-group obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.app_rand.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.apps.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.asn1pars.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.ca.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.ciphers.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.cms.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.crl.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.crl2p7.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.dgst.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.dh.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.dhparam.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.dsa.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.dsaparam.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.ec.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.ecparam.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.enc.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.engine.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.errstr.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.gendh.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.gendsa.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.genpkey.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.genrsa.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.nseq.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.ocsp.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.openssl.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.passwd.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.pkcs12.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.pkcs7.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.pkcs8.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.pkey.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.pkeyparam.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.pkeyutl.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.prime.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.rand.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.req.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.rsa.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.rsautl.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.s_cb.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.s_client.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.s_server.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.s_socket.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.s_time.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.sess_id.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.smime.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.speed.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.spkac.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.srp.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.ts.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.verify.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.version.o obj/vendor/node/deps/openssl/openssl/apps/openssl-cli.x509.o obj/vendor/node/deps/openssl/libopenssl.a -Wl,--end-group  -ldl
/usr/bin/ld: unrecognised emulation mode: aarch64linux
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@groundwater

This comment has been minimized.

Copy link
Member

groundwater commented Aug 8, 2017

@zcbenz on Ubuntu I installed g++-aarch64-linux-gnu and I think it worked after that.

@zcbenz

This comment has been minimized.

Copy link
Contributor

zcbenz commented Aug 10, 2017

We are going to marge this after merging the chrome59 branch, e.g. arm64 would be part of the 1.8.x releases.

This is because building arm64 target requires system arm64 toolchains, which unfortunately are not available on the old distribution used by our internal Linux build machines. Fixing this requires using docker, which has been done as part of the Chrome 59 upgrade.

@HAMIDx9

This comment has been minimized.

Copy link
Contributor

HAMIDx9 commented Aug 10, 2017

Glad to hear that. Let me know if i can help in the process.

@zcbenz zcbenz force-pushed the HAMIDx9:master branch from b3950e8 to de67e42 Aug 22, 2017

@zcbenz zcbenz merged commit 1f604c0 into electron:master Aug 22, 2017

6 of 9 checks passed

electron-linux-arm Build #7720019 failed in 152s
Details
electron-linux-x64 Build #7719338 failed in 197s
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
electron-linux-arm64 Build #7720738 succeeded in 162s
Details
electron-linux-ia32 Build #7719337 succeeded in 103s
Details
electron-mas-x64 Build #4912 succeeded in 16 min
Details
electron-osx-x64 Build #4900 succeeded in 17 min
Details
electron-win-ia32 Build #3927 succeeded in 16 min
Details
@welcome

This comment has been minimized.

Copy link

welcome bot commented Aug 22, 2017

Congrats on merging your first pull request! 🎉🎉🎉

malept added a commit to electron-userland/electron-packager that referenced this pull request Aug 23, 2017

Add ARM64 support
With electron/electron#10219 merged, ARM64
support is likely to be official starting with the Electron 1.8 release
series. This adds basic official support for the arch, plus adds it to
the platform/arch combinations when `all` is true or `platform=linux`
and `arch=all`, and the specified version of Electron is 1.8.0 or above.

@malept malept referenced this pull request Aug 23, 2017

Merged

Add ARM64 support #711

5 of 5 tasks complete

malept added a commit to electron-userland/electron-packager that referenced this pull request Aug 23, 2017

Add ARM64 support (#711)
With electron/electron#10219 merged, ARM64
support is likely to be official starting with the Electron 1.8 release
series. This adds basic official support for the arch, plus adds it to
the platform/arch combinations when `all` is true or `platform=linux`
and `arch=all` is set, and the specified version of Electron is 1.8.0
or above.

@vielmetti vielmetti referenced this pull request Sep 4, 2017

Closed

Electron port to arm64 #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment