Chromium


sebt3

homebrew player (P. & C.)
Joined
Sep 9, 2008
Messages
4,886
Age
43
Location
France
Website
sebt3.openpandora.org
Hi boys,

In the last month, I tried to bring a chromium pnd (with ssl and vp8), but now I don't know what the next step to finaly manage my target.

As I hope someone will manage to get it working, I'll leave here all I can remember to help the next guy.

You'll need DJWillis toolchain. I tried with cpasjuste one, without success.

We will start by building the target installation (you can use an other directory if you want) :
Code:
mkdir /mnt/utmp/chromium
cd /tmp
wget http://www.angstrom-distribution.org/unstable/feed/armv7a/base/nspr-dev_4.7.1-r1.5_armv7a.ipk
wget http://www.angstrom-distribution.org/unstable/feed/armv7a/base/nspr_4.7.1-r1.5_armv7a.ipk
wget http://www.angstrom-distribution.org/unstable/feed/armv7a/base/nss-dev_3.12.6-r2.5_armv7a.ipk
wget http://www.angstrom-distribution.org/unstable/feed/armv7a/base/nss_3.12.6-r2.5_armv7a.ipk
cd /mnt/utmp/chromium
for i in /tmp/ns*_armv7a.ipk;do ar p $i data.tar.gz|tar xzf -;done
mv usr/include usr/lib .
rm -rf usr
Now fix /mnt/utmp/chromium/lib/pkg_config/ns*.pc (give actual paths).
This is the cheat version to get nss and nspr on board. I do have tried to build my own. But that didn't helped much so and nss is a s**t to cross-compile (nspr is very easy in comparaison).
There is some more dependency, but they all are already in the pandora. So you just need to opkg-target install these.

You'll need to setup a "few" environement stuff :
Code:
. /usr/local/angstrom/arm/environment-setup
export CXXFLAGS="-I$SDK_PATH/$TARGET_SYS/usr/include" LDFLAGS="-L$SDK_PATH/$TARGET_SYS/usr/lib -Wl,-rpath,$SDK_PATH/$TARGET_SYS/usr/lib"
export PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS/usr/lib/pkgconfig
unset PKG_CONFIG_SYSROOT_DIR
export CROSSTOOL="$SDK_PATH/bin/$TARGET_SYS"
export CXX=$CROSSTOOL-g++ CC=$CROSSTOOL-gcc AR=$CROSSTOOL-ar AS=$CROSSTOOL-as RANLIB=$CROSSTOOL-ranlib
export HOST_CC=gcc HOST_CXX=g++
export GYP_DEFINES="build_ffmpegsumo=1 javascript_engine=v8 werror= use_system_sqlite=0 no_strict_aliasing=1 gcc_version=43 target_arch=arm use_system_ssl=0 disable_nacl=1 linux_use_tcmalloc=0 armv7=1 arm_thumb=0 use_system_libxslt=1 use_system_libxml=1"
setprj() {
        PRJ=$1
        cat <<END
export PRJ=$PRJ;
export LDFLAGS="$LDFLAGS -L/mnt/utmp/$PRJ/lib" CXXFLAGS="$CXXFLAGS -I/mnt/utmp/$PRJ/include" PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/mnt/utmp/$PRJ/lib/pkgconfig"
END
}
build_verbose(){
make V=1 BUILDTYPE=Release chrome
}

build_fast() {
make -j3 BUILDTYPE=Release chrome
}

update_makefiles() {
python build/gyp_chromium --no-circular-check build/all.gyp
}
eval $(setprj chromium)
I unset PKG_CONFIG_SYSROOT_DIR because I messed with my *.pc files before even have a look on how djwillis have done his toolkit :( a few others have followed my path as I posted this somewhere else on these boards. sorry.
If you didn't then don't unset this obviously :) and a few(2) symlinks will be needed too.
I'm using function to alias the build command as I was tired to look in my history :)

The current svn is working, but I'll describe how to build a given revision known to work : 50986
Install depot_tools :
Code:
mkdir prj_root; cd prj_root
svn co http://src.chromium.org/svn/trunk/tools/depot_tools
export PATH=`pwd`/depot_tools:"$PATH"
Then get this build :
Code:
gclient sync -r 50986
cd src/third_party/ffmpeg/
svn up -r 51511
Apply (manually :) ) this patch : (to work around the fact gg use a deprecated API)
Code:
--- a/libavformat/avio.h        2010-07-02 03:58:03.000000000 -0600
+++ b/libavformat/avio.h        2010-07-08 09:44:45.000000000 -0600
@@ -277,7 +277,7 @@
 /**
  * @deprecated Use av_register_protocol2() instead.
  */
-attribute_deprecated int av_register_protocol(URLProtocol *protocol);
+/*attribute_deprecated*/ int av_register_protocol(URLProtocol *protocol);
 #endif
 
 /**

If the gclient scync succeded, then you're ready to build :
Code:
cd ../.. # to : prj_root/src
update_makefiles&&build_fast||build_verbose

About one hour later (if every thing have gone right) the build is done and you can finish the PND :
Code:
DEST=/mnt/utmp/chromium
for i in chrome chrome.pak chrome-wrapper ffmpegsumo_nolink genmacro genmodule genstring genperf genversion libffmpegsumo.so gfx_unittests lib.target locales obj obj.target product_logo_48.png protoc pyproto re2c resources resources.pak xdg-settings yasm;do
        cp -Rapf src/out/Release/$i $DEST
done

find $DEST -name "*.d" -delete
find $DEST -name "*.o" -delete
find $DEST -name "*.a" -delete
find $DEST -name "*.cpp" -delete
find $DEST -name "*.h" -delete
find $DEST -name "*.cc" -delete
#cp $DEST/product_logo_48.png icon.png

Create the PXML file and package. you're done.

Here is my version.
As you can see it don't render things well :(
If some one point me out why, I'll gladly finish this.

This PND don't write on the nand, but I did cheat as the config files finish in /tmp as a socket and a symlink get creating in this directory.
The last thing to do is to patch this (should be easy as it's in "src/app/app_paths.cc" or in "src/chrome/common/chrome_paths_linux.cc")

:D
 
Hmm so you were trying to compile Chrome too? You got more far than me, my compilation never ended, having hang in "mksnapshot", which may be related to this bug:

http://code.google.com/p/v8/issues/detail?id=347

But the solution pointed didn't worked for me, wondering if you got this problem? Maybe the parameter "gcc_version=43" you put is to solve this?

I will try to compile with your parameters to see if it changes anything.

Also I patched some 4-5 source codes using the latest SVN, because of compile errors.
 
I successfully compiled Chrome, but my executable always give an error when loading any page:

"aw, snap, something went wrong while displaying this webpage"

No matter what I try to open, I get this error.

Using sebt3 pnd I get the same problem, maybe the ipkg dependencies (which I installed on the cross-compilter only, not on the device) have some more needed files than just the .so libraries?

I looked all around for a fix for this but found nothing, did you get this problem also?
 
Hitnrun said:
Using sebt3 pnd I get the same problem, maybe the ipkg dependencies (which I installed on the cross-compilter only, not on the device) have some more needed files than just the .so libraries?

I looked all around for a fix for this but found nothing, did you get this problem also?
Yes :( sadly.
About dependencies on NAND, then why ED chromium PND does render ? (might worth looking what's in)


Pickle said:
sebt3 said:
And please update your toolkit : 2007q3 start to be old no ?
Tried 2010q1 and it seems to lock up in the gles driver.

This made me think that it might also worth trying the 2007q3 toolchain.
 
Last edited by a moderator:
sebt3 said:
Hitnrun said:
Using sebt3 pnd I get the same problem, maybe the ipkg dependencies (which I installed on the cross-compilter only, not on the device) have some more needed files than just the .so libraries?

I looked all around for a fix for this but found nothing, did you get this problem also?
Yes :( sadly.
About dependencies on NAND, then why ED chromium PND does render ? (might worth looking what's in)

I tried various things with Ed's version, I mounted it and copied to a folder, then replaced the executable and the 2 pak files, and I got the exact same problem, so it should be a problem with the source. Ed's version is 4.0, ours is 6!

I guess I'll need to compile in debug mode, more wasted hours! :rolleyes:
 
Last edited by a moderator:
Did anybody have success running the chromium nightly builds from http://build.chromium.org/buildbot/snapshots/chromium-rel-arm/ ? The one I tried complained about missing something, might have been nss, but I didn't spend any more time in trying to getting it to run, but might be an avenue worth trying?
 
laurens said:
Did anybody have success running the chromium nightly builds from http://build.chromium.org/buildbot/snapshots/chromium-rel-arm/ ? The one I tried complained about missing something, might have been nss, but I didn't spend any more time in trying to getting it to run, but might be an avenue worth trying?

Yes I tried, it is compiled with a newer version of glibc, which is incompatible with the one on Pandora.
 
Last edited by a moderator:
We need more "eyes" to help porting these complicated things, maybe when more developers receive their Pandoras :)
 
Okay, was working on this for the last 7 hours....
It's really annoying, Chromium for ARM is pretty unstable at the moment it seems.

1. Grabbed the current Debian version (5.0), including all needed libraries. It runs, but it freezes while browsing and crashes easily. Damn.

2. Grabbed the current snapshot from today from the buildserver mentioned above. Included all the needed libraries. It runs fine, you can browse, it's fast, etc. However, as soon as you enter an URL manually, it crashes. Boom.
So it works as long as you only follow bookmarks and links... damn. So close, but not really useful.

3. Grabbed the Ubuntu-Version. Doesn't even start (segfault). Dang.

I could upload what I did so far, but it seems like there is no working compiled version out there - and I can't compile.
Looks like Poky Linux has a better version, but I didn't find the recipe for that.

If anyone wants to look for other ARM compiled versions, I'm eager to continue trying.
 
milkshake said:
does anyone know if/when it will work with pandora?

EvilDragon said:
Okay, was working on this for the last 7 hours....
It's really annoying, Chromium for ARM is pretty unstable at the moment it seems.

1. Grabbed the current Debian version (5.0), including all needed libraries. It runs, but it freezes while browsing and crashes easily. Damn.

2. Grabbed the current snapshot from today from the buildserver mentioned above. Included all the needed libraries. It runs fine, you can browse, it's fast, etc. However, as soon as you enter an URL manually, it crashes. Boom.
So it works as long as you only follow bookmarks and links... damn. So close, but not really useful.

3. Grabbed the Ubuntu-Version. Doesn't even start (segfault). Dang.

I could upload what I did so far, but it seems like there is no working compiled version out there - and I can't compile.
Looks like Poky Linux has a better version, but I didn't find the recipe for that.

If anyone wants to look for other ARM compiled versions, I'm eager to continue trying.

Neuvoo 0.3.0 is using Chromium 5.0.375.127, link below.
http://neuvoo.org/neuvoo/packages/armv7a/touchbook/www-client/chromium-5.0.375.127.tbz2

This was compiled with the following toolchain armv7a-unknown-linux-gnueabi;
gcc-4.3.4
glibc-2.10.1-r1
binutils-2.19.1-r1
linux-headers-2.6.30-r1

Works with no noticeable issues. Hope it helps.

Cheers!
 
Last edited by a moderator:
thanks a bunch!

This one works fine. However, no SSL yet.

Some stuff I found out: It uses NSS for SSL.
While I copied over the libraries, is looks NSS doesn't have a database created yet.

On startup of Chrome, I get the following error messages:

Code:
[13990:13998:43518212188:ERROR:base/nss_util.cc(122)] Error initializing NSS with a persistent database (sql:/home/evild/.pki/nssdb): NSS error code -5977
[13990:13998:43518213775:ERROR:base/nss_util.cc(132)] Error initializing NSS without a persistent database: NSS error code -5925

And whenever I try to open an SSL page:
Code:
[13990:13998:43518217956:ERROR:net/socket/ssl_client_socket_nss.cc(1298)] handshake failed; NSS error code -12268, net_error -107

Anyone here who knows more about NSS and how we could fix it?
The NSS error also appeared on every URL I typed in with the most recent snapshot of chromium before it crashed - so maybe the missing NSS was the cause for the crash here?

Once we figure out how to setup nss, I should be able to package a Chromium5 and Chromium-Most-Recent-Snapshot-Version :)
 
As soon as you compiled it, send me the archive (or upload it here).
I got everything setup for PND'ing already (scripts that config and cache are saved on SD Card and not in NAND).
I'll package it up if you want :)
 
Back
Top