Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

MIPS64EL: Add support for build libchromiumcontent. #364

Merged
merged 23 commits into from Nov 21, 2017

Conversation

ClarkWang-2013
Copy link
Contributor

I recently completed the libchromiumcontent build on Loongson(MIPS64EL) platform.

Build libchromiumcontent follow the steps below:
$ ./script/bootstrap
$ ./script/update -t mips64el
$ ./script/build -t mips64el
$ ./script/create-dist -t mips64el

And generate files as follows:
libchromiumcontent-static.zip libchromiumcontent.zip dist/main/

@zcbenz
Copy link
Member

zcbenz commented Sep 27, 2017

@ClarkWang-2013 I noticed that you have already upstreamed some of the patches, are you going to upstream the rest of the patches?

@ClarkWang-2013
Copy link
Contributor Author

@zcbenz
what's do you mean? why you think it's part of patches?
The patches I upstreamed is all patches, Use this patches I build success on mips64el.

From 12c1704063ff6f2b1e599b58a7937f8c20a59264 Mon Sep 17 00:00:00 2001
From: Wang Qing <wangqing-hf@loongson.cn>
Date: Thu, 14 Sep 2017 19:07:25 +0800
Subject: [PATCH] Fix build_ffmpeg.py and automatic gernerate ffmpeg mips64el
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the 002-Fix-build_ffmpeg.py-and-automatic-gernerate-ffmpeg-m.patch, it seems that most changes are actually automatically generated? I think we should auto-generate the files in the update script, otherwise this patch would be impossible to maintain when we do Chrome upgrades.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

script/update Outdated
if target_arch == 'mips64el':
args += ' google_api_key="AIzaSyDxKL42zsPjbke5O8_rPVpVrLrJ8aeE9rQ"'
args += ' google_default_client_id="595013732528-llk8trb03f0ldpqq6nprjp1s79596646.apps.googleusercontent.com"'
args += ' google_default_client_secret="5ntt6GbbkjnTVXx-MSxbmx5e"'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Google API keys are not needed in libchromiumcontent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@zcbenz
Copy link
Member

zcbenz commented Sep 27, 2017

what's do you mean? why you think it's part of patches?

For example 045-Fix-node_modules-uglifyjs-to-uglify-js.patch and patches/047-Set-kernal-page-size-to-16K-on-loongson-MIPS-archtec.patch, I can not find those changes in the master branch of Chromium.

And do you mind writing down the upstream Chromium commits of the patches? It would make our work much easier when doing Chrome upgrades. For example:

046-Add-support-for-using-seccomp_bpf-on-mips64el.patch is https://chromium.googlesource.com/chromium/src/+/534d7ce2af699715acfc4fe516ef3c2ffee65bc5

@ClarkWang-2013
Copy link
Contributor Author

@zcbenz
The patch I have modified。
Please put forward other advices if there are any other problems.

Thanks.

@zeke
Copy link
Contributor

zeke commented Sep 27, 2017

@ClarkWang-2013 just curious, what kind of devices use Loongson (MIPS64EL) processors? Laptops? Phones? Servers? Something else?

@ClarkWang-2013
Copy link
Contributor Author

@zeke laptops、desktop and servers

@zeke
Copy link
Contributor

zeke commented Sep 27, 2017

@ClarkWang-2013 is it very popular in China?

@zcbenz
Copy link
Member

zcbenz commented Sep 27, 2017

@ClarkWang-2013 Are you compiling libchromiumcontent on a loongson platform? If so is it possible to cross compile for loongson on a x64 host machine?

@ClarkWang-2013
Copy link
Contributor Author

@zcbenz
Yes。
Cross compile for loongson on a x64 host machine should be possible, but I not to try it. Some of patches I already pushed into chromium master branch, and tested by chromium is no problem.

@zcbenz
Copy link
Member

zcbenz commented Sep 27, 2017

@ClarkWang-2013 I don't think Chromium team actually tests mips build, they just let patches in and let contributors maintain the code path.

In Electron and libchromiumcontent the binaries are built on our CI machines and we provide prebuilt binaries to end users, but our Linux CI machines are all x64 and we do cross-compilation for arm/arm64/x86 builds. If we have to compile libchromiumcontent on a loongson platform then it would be a blocker for us, because we would have to host a powerful loongson server ourselves, which is not likely to be an option for us.

So it would be great if you can get cross-compilation work with x64 host.

@ClarkWang-2013
Copy link
Contributor Author

How do you cross-compilation for arm/arm64/x86 builds?

@zcbenz
Copy link
Member

zcbenz commented Sep 27, 2017

Just run script/update -t arm and it would pass target_cpu=arm to gn, which would trigger the cross-compilation settings in Chromium.

@ClarkWang-2013
Copy link
Contributor Author

@zcbenz cross compiling have done.
8c485bc

cross compiler you can download from:
http://ftp.loongnix.org/toolchain/gcc/release/gcc-4.8.3-d197-n64-loongson.tar.gz

setup as follows:
tar -xvf gcc-4.8.3-d197-n64-loongson.tar.gz -C /opt
export PATH=/opt/gcc-4.8.3-d197-n64-loongson/usr/bin/:$PATH
export LD_LIBRARY_PATH=/opt/gcc-4.8.3-d197-n64-loongson/usr/x86_64-unknown-linux-gnu/mips64el-redhat-linux/lib:/opt/gcc-4.8.3-d197-o32-loongson/usr/lib64:/opt/gcc-4.8.3-d197-n64-loongson/usr/mips64el-redhat-linux/lib64:/opt/gcc-4.8.3-d197-n64-loongson/usr/mips64el-redhat-linux/sysroot/lib64:/opt/gcc-4.8.3-d197-n64-loongson/usr/mips64el-redhat-linux/sysroot/usr/lib64:$LD_LIBRARY_PATH

@zcbenz
Copy link
Member

zcbenz commented Oct 27, 2017

This basically looks good to me, I'm now doing some modifications to make our CI generate binaries for mips64el, and I'll do some force pushes to your forked repo.

@zcbenz
Copy link
Member

zcbenz commented Oct 27, 2017

I have moved mips64el related patches to the patches-mips64el folder, so future Chrome upgrades would be easier.

@zcbenz
Copy link
Member

zcbenz commented Oct 27, 2017

@jkleinsc I have added a new CI job for mips64el here.

@alexeykuzmin We are getting a new set of patches in this PR, fortunately most of them have already been upstreamed.

@alexeykuzmin
Copy link
Contributor

@zcbenz Can we postpone a merge of this PR until the Chromium 61 upgrade is merged?
I'm afraid that if this one is merged first it could delay the Chromium 61 merge by several day or maybe even a week.

@zcbenz
Copy link
Member

zcbenz commented Oct 30, 2017

@alexeykuzmin I have separated the patches of mips64el from the others, so it won't affect the normal upgrade of Chrome 61. You can simply remove the mips64el CI jobs in the chrome61 branch after the merge, and we will add it back in future.

@zcbenz zcbenz force-pushed the master branch 6 times, most recently from 66be635 to c2e03be Compare October 30, 2017 13:31
@zcbenz
Copy link
Member

zcbenz commented Nov 1, 2017

I'm facing a problem that gcc uses too much RAM that running 8 jobs at the same time would use up all RAM and end up with OOM error, while limiting to 4 jobs would take too much time that circle ci would terminate with timeout error.

@ClarkWang-2013
Copy link
Contributor Author

@zcbenz you can try with setup swap

ClarkWang-2013 and others added 22 commits November 21, 2017 14:50
This patch is specialed for mips64.
The cross-compilation way now does not run runhooks-mips64el, so we need
to ensure the ffmpeg config is generated.
@zcbenz
Copy link
Member

zcbenz commented Nov 21, 2017

Since we can already build mips64el, I'm merging this PR. I have disabled the CI job for mips64 and separated the mips64el patches from the others, so it won't affect the build of other targets.

Once we have solved the issue of Circle CI, I'll create a new pull request to re-enable CI for mips64el.

@zcbenz
Copy link
Member

zcbenz commented Nov 21, 2017

@ClarkWang-2013 I have some problems with the sysroot image,

Some libraries lack corresponding symbol links, for example libfontconfig.so exists but there is no libfontconfig.so.1:

  • libfontconfig.so.1
  • libfreetype.so.6
  • libexpat.so.1
  • libEGL.so.1
  • libglapi.so.0

The sysroot image also lacks some necessary dependencies of Electron:

  • libselinux.so.1
  • libdbus-glib-1.so.2
  • libgnutls.so.28
  • libavahi-common.so.3
  • libavahi-client.so.3
  • libgraphite2.so.3
  • libxshmfence.so.1
  • libwayland-server.so.0
  • libkeyutils.so.1
  • libfreebl3.so

And we also need following development headers to exist in the sysroot image:

  • libnotify

Can you update the sysroot image and upload it somewhere?

@zcbenz zcbenz merged commit 1f25411 into electron:master Nov 21, 2017
@ClarkWang-2013
Copy link
Contributor Author

@zcbenz ok

@ClarkWang-2013
Copy link
Contributor Author

@zcbenz update the sysroot image complete。
I push into https://github.com/ClarkWang-2013/Sysroot
You can upload by git clone this.
If the sysroot still lack something,I will update by the repository。

@zcbenz
Copy link
Member

zcbenz commented Nov 22, 2017

@ClarkWang-2013 Can you take a look at electron/electron#11208?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants