Created attachment 467628 [details, diff] chromium-57.0.2987.98 ebuild patch for PowerPC / PowerPC64 support As no recent browser actually compiles and runs fine on PowerPC / PowerPC64, I started trying porting www-client/chromium for those architectures: * www-client/epiphany-3.20.3 display is broken * www-client/firefox-45.8.0 crashes on PowerPC * www-client/firefox-51.0.1 won't even compile due to skia dependency Here's a patchset that would be considered as a first attempt to actually make www-client/chromium available to PowerPC / PowerPC64. It's divided in 3 parts: * chromium-57.0.2987.98.ebuild.patch This is the changes to the ebuild so that PowerPC / PowerPC64 architectures are recognized. Note that I don't apply any patch to the code, thus one would have to apply the following patches "by hand" after the prepare ebuild phase in order to actually compile for PowerPC / PowerPC64 Also note that this patch actually fixes a bug, removing dev-lang/yasm dependency for arm64 (yasm is for x86 / amd64 only, if I'm not wrong...). * chromium-ppc-good-57.0.2987.98.patch This patch add support for the PowerPC / PowerPC64 architectures to the chromium browser code. It is safe to apply this patch and it does not break any other architecture. * chromium-ppc-bad-57.0.2987.98.patch This patch is actually work-in-progress. It removes endianness checks, hardcode some values and add place-holders (openmax_dl API) in order to make chromium compile without actually fixing the code. This patch is likely not to break anything for other architectures. This has been checked on amd64 architecture. How to use those patches: * apply chromium-57.0.2987.98.ebuild.patch ie: # patch -p0 -i chromium-57.0.2987.98.ebuild.patch in www-client/chromium directory * unpack / prepare the sources: # ebuild chromium-57.0.2987.98.ebuild manifest # ebuild chromium-57.0.2987.98.ebuild prepare * apply the PowerPC / PowerPC64 patches: # cd /var/tmp/portage/www-client/chromium-57.0.2987.98/work/chromium-57.0.2987.98 # patch -p1 -i chromium-ppc-good-57.0.2987.98.patch # patch -p1 -i chromium-ppc-bad-57.0.2987.98.patch * compile / install: # ebuild chromium-57.0.2987.98.ebuild compile # ebuild chromium-57.0.2987.98.ebuild install * try to run chrome... What it actually does on my machines (ie PowerBook G4 for PowerPC & Imac G5 for PowerPC64): * it makes one able to compile the whole www-client/chromium project for the PowerPC / PowerPC64 architectures * it makes one able to check the browser's version, ie: # chromium --version Chromium 57.0.2987.98 actually runs and displays the browser's version. * it makes one able to try to run the chromium browser. It actually start, load it's ressources (ie DataPack API is OK), probes the GPU then crashes with a segmentation fault. The reason for the segmentation fault is not clear; there are many directions to investigate: * one is to test on recent machines. The PowerBook G4 / Imac G5 might have too old GPUs for the browser to run. * another is to actually port openmax_dl for PowerPC / PowerPC64; the current patch only adds placeholders that would return an error when called (see chromium-ppc-bad-57.0.2987.98.patch) * another is to actually fix Skia for PowerPC / PowerPC64, as the chromium-ppc-bad-57.0.2987.98.patch only removes endianness checks and hardcodes some values to make it compile but is not actually a proper port of the API to those architectures. Please consider applying chromium-57.0.2987.98.ebuild and chromium-ppc-good-57.0.2987.98.patch to future releases.
Created attachment 467630 [details, diff] patch to chromium 57.0.2987.98 porting some APIs to PowerPC / PowerPC64
Created attachment 467632 [details, diff] Patch to disable some compilation checks (mostly endianness checks) in order to compile on PowerPC / PowerPC64
Update: I actually did port the openmax_dl API to PowerPC, starting with Mips code, ie generic code without any assembly optimization. This, unfortunately, does not fix the segmentation fault when launching the browser but is another step on the way to get a runable browser on PowerPC / PowerPC64. This patch set has been checked not to break amd64 compilation / run. As the openmax_dl API port is quite large, it is given as another patch to be applied to the sources and it reduces the chromium-ppc-bad-57.0.2987.98.patch, renamed chromium-ppc-bad-57.0.2987.98-r2.patch.
Created attachment 467634 [details, diff] patch to port of openmax_dl API to PowerPC
Created attachment 467636 [details, diff] Patch to disable some compilation checks (mostly endianness checks) in order to compile on PowerPC / PowerPC64 to be used with the openmax_dl PowerPC port
Does upstream support these patches? Did you offer them upstream?
thanks for your interest. This patch set has _not_ been submitted upstream for different reasons: - it is not against the latest chromium browser version / tag - it is work in progress patches, not full functionality - as far as I know, there is no upstream effort for PowerPC / PowerPC64 support or any other big-endian target at this time - I have not been able to compile a browser from chromium git repository (even on amd64) due to many reason (scripts hardcoded for python2 while my main python interpreter is 3.4, errors while using some tools, ...) - I don't have an account @chromium.org My first goal is to go on porting the code for latest available version in Gentoo repository, ie version 58.0.3029.19 (currently work in progress). Then, update to the latest chromium repository tag (ie 59.0.3046.4 at this time). Then, I have to go on porting the code, mostly fixing skia library. Then... I guess the chromium gentoo developers are in a best place than I am to submit the correct patches upstream... (ie chromium-ppc-good-57.0.2987.98.patch and chromium-ppc-openmax_dl-57.0.2987.98.patch at this time).
(In reply to Jocelyn Mayer from comment #7) > thanks for your interest. Nice work! > This patch set has _not_ been submitted upstream for different reasons: > - it is not against the latest chromium browser version / tag Why not? > - it is work in progress patches, not full functionality That's fine. > - as far as I know, there is no upstream effort for PowerPC / PowerPC64 > support or any other big-endian target at this time With this reasoning nothing would ever happen. > - I have not been able to compile a browser from chromium git repository > (even on amd64) due to many reason (scripts hardcoded for python2 while my > main python interpreter is 3.4, errors while using some tools, ...) I'd be happy to help. Feel free to post questions on https://groups.google.com/a/chromium.org/d/forum/chromium-dev and report back here if you don't get any answers. > - I don't have an account @chromium.org That's not required, and you could get one with enough accepted patches, see https://www.chromium.org/developers/contributing-code and https://www.chromium.org/getting-involved/become-a-committer . > My first goal is to go on porting the code for latest available version in > Gentoo repository, ie version 58.0.3029.19 (currently work in progress). > Then, update to the latest chromium repository tag (ie 59.0.3046.4 at this > time). > Then, I have to go on porting the code, mostly fixing skia library. > Then... I strongly recommend you use upstream as the starting point. It's not feasible for us to carry such large patches for such a fast-changing package. > I guess the chromium gentoo developers are in a best place than I am to > submit the correct patches upstream... (ie > chromium-ppc-good-57.0.2987.98.patch and > chromium-ppc-openmax_dl-57.0.2987.98.patch at this time). As I don't have ppc hardware, I'm not comfortable doing that. On the other hand, I am also an upstream developer (same email as Gentoo, just @chromium.org), and I'd encourage you to attempt working with upstream. Looking forward to your contributions!
I've got good and bad news. First for the good news: * I did update the patch set against version 58.0.3029.19 and this patch set also applies to version 59.0.3043.0 and git repository (updated yesterday). * I've also been able to test versions 58.0.3029.19, 59.0.3043.0 and git browsers with patches applied on an amd64 machine, checking with a website using HTML5, CSS3, JS, DOM, dynamic HTML, dynamic CSS, XMHTTP requests, onpenstreet map, images, pop-ups, ... and I can not see any regression. Now for the bad news: * I'm not able to test git repository on PowerPC / PowerPC64 as the google tools won't even run. As an example, gclient needs patches in order to run on PowerPC but complains that there is local changes if I actually do apply the needed patches. As a consequence, I've not been able to test git sources build on PowerPC / PowerPC64. I wish I could cross-compile from my amd64 machine... still trying... I guess I will have to do a copy of the repository I fetched on my amd64 machine in order to test on PowerPC / PowerPC64 (work-in-progress). * another bad new is the dependency on net-libs/nodejs for new versions 58.0.3029.19 and 59.0.3043.0 and git as this library is bugged and does not work properly on PowerPC / PowerPC64. Then, I have to copy the output of /usr/bin/node generated on amd64 to the target machine in order to make my build successful. * it take _days_ in order to compile chromium on PowerPC G4 / PowerPC64 G5, then this patch set has not yet been tested on PowerPC architecture. * I also tried to make a chromium-9999.ebuild, I succeeded preparing the sources but fails to configure; guess I would have to fetch sources from different URIs but I don't figure how to do this. It would be great to have such an ebuild... As a conclusion, here's a set of updated patches, tested on amd64 against gentoo 58.0.3029.19, 59.0.3043.0 and git versions.
Created attachment 468012 [details, diff] chromium-58.0.3029.19.ebuild.patch: patch against chromium-58.0.3029.19.ebuild in order to recognize ppc / ppc64 architectures chromium-58.0.3029.19.ebuild.patch: This patch does not apply the needed patches to the sources in order to compile a PowerPC / PowerPC64 browser. It just make the architectures recognized. It also fixes a bug: dev-lang/yasm should be in dependencies only for x86 / amd64 architectures.
Created attachment 468014 [details, diff] chromium-59.0.3043.0.ebuild.patch: patch against chromium-59.0.3043.0.ebuild in order to recognize ppc / ppc64 architectures Same comments as for chromium-58.0.3029.19.ebuild.patch
Created attachment 468016 [details, diff] chromium-ppc-good-58.0.3029.19.patch: ppc / ppc64 main port patch chromium-ppc-good-58.0.3029.19.patch: This patch also applies to 59.0.3043.0 version and git repository. It is safe to apply as all modifications are under PowerPC / PowerPC64 conditionnals, thus won't change the browser's behavior for other architectures.
Created attachment 468018 [details, diff] chromium-ppc-wav-58.0.3029.19.patch: add support for big-endian architectures to WavReader / WavWriter APIs chromium-ppc-wav-58.0.3029.19.patch: This patch also applies to 59.0.3043.0 version and git repository. It is safe to apply for little-endian targets, as it does not change any code for those platforms. It is likely to be safe for big-endian targets too.
Created attachment 468020 [details, diff] chromium-ppc-datapack-58.0.3029.19.patch: this patch fixes DataPack API for big-endian architectures chromium-ppc-datapack-58.0.3029.19.patch: This patch also applies to 59.0.3043.0 version and git repository. It has been tested on little-endian (amd64) and big-endian architectures (PowerPC / PowerPC64) and seems safe to apply.
Created attachment 468022 [details, diff] chromium-ppc-openmax_dl-58.0.3029.19.patch: port of openmax_dl API to PowerPC / PowerPC64 chromium-ppc-openmax_dl-58.0.3029.19.patch: This patch also applies to 59.0.3043.0 version and git repository. It is safe to apply, as it only add code for PowerPC / PowerPC64 support, not doing any changes to any other code.
Created attachment 468024 [details, diff] chromium-ppc-bad-58.0.3029.19.patch: quick hacks to make PowerPC / PowerPC64 targets compile chromium-ppc-bad-58.0.3029.19.patch: This patch also applies to 59.0.3043.0 version and git repository. This patch removes endianness-checks and hardcode defines for the skia library. It does not change anything for litlle-endian targets but is not safe to apply as it is only work-in-progress hacks.
Created attachment 468128 [details] tcmalloc compilation failure on 32 bits architectures I did trigger a bug in the tcmalloc library, which is unable to compile on 32 bits architecture due to an attempt of casting Atomic64* into const volatile Atomic32*. Then I guess tcmalloc USE flag should be masked for 32 bits archs.
(In reply to Jocelyn Mayer from comment #9) > * I'm not able to test git repository on PowerPC / PowerPC64 as the google > tools won't even run. As an example, gclient needs patches in order to run > on PowerPC but complains that there is local changes if I actually do apply > the needed patches. Did you work with upstream to get this resolved? To make it very clear: I will NOT apply patches attached to this bug in Gentoo. Please take this work upstream. I could help you with that. Feel free to post to https://groups.google.com/a/chromium.org/d/forum/chromium-dev . For gclient and other scripts from depot_tools, use https://groups.google.com/a/chromium.org/d/forum/infra-dev .
I understand your point of view and I'll try to post upstream as soon as I can. However, imho, you should consider the patch against the ebuild and fix two gentoo specific bugs: * the dependency against dev-lang/yasm should be, as far as I know, x86 / amd64 dependant, not arm * the tcmalloc USE flag should be not be available for 32 bits architectures, as it won't compile I also think the definitions for PowerPC / PowerPC64 in the ebuild could also be applied as it can not break anything for other architecture and might be useful for upstream PowerPC / PowerPC64 testing .
(In reply to Jocelyn Mayer from comment #19) > I understand your point of view and I'll try to post upstream as soon as I > can. > > However, imho, you should consider the patch against the ebuild and fix two > gentoo specific bugs: > * the dependency against dev-lang/yasm should be, as far as I know, x86 / > amd64 dependant, not arm Indeed. For a long time, the chromium ebuild only supported amd64, arm, and x86, so !arm is basically equivalent. I do see that an arm64 keyword was added; the ebuild should have been adjusted at that point. > * the tcmalloc USE flag should be not be available for 32 bits > architectures, as it won't compile As far as I know, tcmalloc works fine on x86, which is a 32-bit architecture. > I also think the definitions for PowerPC / PowerPC64 in the ebuild could > also be applied as it can not break anything for other architecture and > might be useful for upstream PowerPC / PowerPC64 testing . Yeah, I think The ebuild changes seem ok to apply, so long as we don't put ppc[64] in KEYWORDS.