Page 1 of 1

TAZ distro with palemoon on musl: almost there

Posted: 2018-06-08, 11:10
by Peregrine
As mentioned on earlier posts, me and VCTLabs are building the TAZ distro that is also going to include palemoon as the main browser. The entire distro (thus including palemoon) is going to run on musl. There have been a few attemps in the past to make palemoon run on musl, but so far nothing has been successful (to my knowledge). VCTLabs however has gotten us so far that it already runs on musl. However, at the moment there are still a few issues:
* jemalloc doesn't work (see https://github.com/jemalloc/jemalloc/issues/1238 ) -issue currently avoided turning jemalloc off-
* palemoon crashes on the first run (see images) but gets far enough to create its profile directory.
* once the profile is created it does not crash on startup, but font rendering is all messed up (see images)

Note that we intent to work with deu to implement the musl build option (hence allowing to build with either glibc or musl).
Deu mentioned that he is probably going to upload the v28 ebuild to gentoo packages, so when that happens (and he implements the musl build option) we'll have the ability to build with musl, for version 28 and probably all later versions too.

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-06-08, 21:41
by terranigma
I ported the Pale Moon to musl couple months ago. It runs just fine on Alpine Linux with musl-libc (gcc-6.4) except some rare cases. I didn't make it public at first because I was a bit reluctant about it. Since you're also working on it, my work may be helpful to solve your problems.

Check out: https://github.com/tanertas/aports/tree ... g/palemoon

Good luck.

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-06-11, 11:29
by Peregrine
The patch you used stopped the crash on first startup:
https://github.com/tanertas/aports/blob ... 4732.patch

Fonts still don't work.

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-06-11, 12:27
by terranigma
Peregrine wrote:The patch you used stopped the crash on first startup:
https://github.com/tanertas/aports/blob ... 4732.patch

Fonts still don't work.
That patch fixes hard stack size limitation of musl for Pale Moon. Until providing enough info for your build (build environment, mozconfig, compiler flags etc) it's hard to determine real cause of the problem. Did you check my APKBUILD file for build options?

My abuid.conf (make.conf in Gentoo) as follows:

Code: Select all

export JOBS=5
export MAKEFLAGS=-j$JOBS

export CFLAGS="-Os -fomit-frame-pointer"
export CXXFLAGS="$CFLAGS"
export CPPFLAGS="$CFLAGS
export LDFLAGS="-Wl,--as-needed"
What about other Gtk-2 applications? Are fonts rendering properly?

Note: External malloc implementations don't supported by musl as far as I know. So, just disable jemalloc by now.

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-06-12, 10:08
by Peregrine
terranigma wrote: What about other Gtk-2 applications? Are fonts rendering properly?
Yes - geany, claws, and some lxde stuff were all compiled against it, and all those others can render fonts.
HOWEVER, those were all compiled with a newer toolchain, whereas we switched to gcc-4.9 when building palemoon per Deu's recommendation. The tanertas build uses the gcc-6.4 toolchain since that is the only available toolchain on Alpine currently.
So perhaps running palemoon on gcc-6.4 might help.
terranigma wrote: Until providing enough info for your build (build environment, mozconfig, compiler flags etc) it's hard to determine real cause of the problem.
We'll pastebin the mozconfig and environment file soon.

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-06-13, 07:36
by Peregrine
Here they are:

environment file (/var/tmp/portage/www-client/palemoon-27.9.2/temp/environment ):
http://termbin.com/iq41

.mozconfig file:
http://termbin.com/wcc2

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-06-13, 08:32
by Walter Dnes
terranigma wrote:My abuid.conf (make.conf in Gentoo) as follows:

Code: Select all

export JOBS=5
export MAKEFLAGS=-j$JOBS

export CFLAGS="-Os -fomit-frame-pointer"
export CXXFLAGS="$CFLAGS"
export CPPFLAGS="$CFLAGS
export LDFLAGS="-Wl,--as-needed"
"-Os" reduces binary size, but slows down the executable that you build. I recommend
"-O2 -fno-unwind-tables -fno-asynchronous-unwind-tables -fomit-frame-pointer" instead. "-O2" optimizes for speed. The GCC flags "-fno-asynchronous-unwind-tables -fomit-frame-pointer" get rid of DWARF2 tables, which knocks 15% off the size of the compiled binary. This speeds up loading time (less to load) and uses corespondingly less ram. See 2 posts from the busybox mailing list http://lists.busybox.net/pipermail/busybox/2012-September/078326.html and http://lists.busybox.net/pipermail/busybox/2012-September/078331.html. These guys are busybox developers, not "Gentoo Ricers". I've been using these options on Gentoo linux for approximately 5 years. If they caused problems, I would've found out by now, because almost everything on Gentoo is built from source.

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-06-13, 08:48
by Walter Dnes
Peregrine wrote:Here they are:

environment file

.mozconfig file
One minor change. I am not aware of any cpu that has SSE2, but does not have SSE. See https://gcc.gnu.org/onlinedocs/gcc-6.4.0/gcc/x86-Options.html#x86-Options In your environment file, you can replace

"if use cpu_flags_x86_sse && use cpu_flags_x86_sse2; then"

...with...

"if use cpu_flags_x86_sse2; then"

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-06-13, 12:53
by terranigma
Peregrine wrote:Here they are:

environment file (/var/tmp/portage/www-client/palemoon-27.9.2/temp/environment ):
http://termbin.com/iq41

.mozconfig file:
http://termbin.com/wcc2
Hi,
I managed to fix the issue by help of Alpine developers.

At first, I repeated the problem on x86 Pale Moon build on Alpine too. I noticed that Firefox on x86 repo has similar issue.
I asked @ncopa from Alpine then he confirmed that the issue is known and suggested to check out these:
* https://bugs.alpinelinux.org/issues/4248
* https://bugzilla.mozilla.org/show_bug.c ... id=1284293

By his direction, I modified the jsnum.cpp and voila!

Check out this patch:
https://github.com/tanertas/aports/blob ... -fix.patch

Good luck.

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-06-14, 11:11
by Peregrine
That worked.
We'll roll out the needed changes into the palemoon overlay next.

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-06-14, 15:09
by Moonchild
When you do, please make sure you disable official branding. I looked once again over the build config and patches used in aports and they are too far removed from our official config to be accepted with official branding.

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-06-14, 21:12
by terranigma
Moonchild wrote:When you do, please make sure you disable official branding. I looked once again over the build config and patches used in aports and they are too far removed from our official config to be accepted with official branding.
In this case, can we publicly expose build options below?
Is disabling official branding just enough or we must rename package and executable names too?

Code: Select all

#ac_add_options --with-system-nspr
#ac_add_options --with-system-nss
#ac_add_options --with-system-jpeg
#ac_add_options --with-system-libevent
#ac_add_options --with-system-libvpx
#ac_add_options --with-system-icu
#ac_add_options --with-system-webp
#ac_add_options --enable-system-hunspell
#ac_add_options --enable-system-sqlite

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-06-14, 22:25
by Moonchild
If you don't use official branding, you can use whichever build configuration you like most.
You can either continue using the "New Moon" branding which is unofficial and can be used accordingly (see redist point 13 at http://www.palemoon.org/redist.shtml) or you can re-brand it to something you prefer (name+visual marks) like e.g. iceweasel does. The latter has our preference if you intend to maintain your specific fork for a longer time.

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-07-11, 07:24
by Peregrine
Peregrine wrote:We'll roll out the needed changes into the palemoon overlay next.
The needed changes for palemoon were bundled in VCTLabs' pull request of 16 june 2018
see here: https://github.com/deu/palemoon-overlay/pull/66

We're currently continuing on the distro (TAZ) itself.
Since future versions of the distro would incorporate newer versions of palemoon, it would be useful that these changes are pulled in, in order to reduce our workload in future versions, but also to give all other gentoo distro's the ability to build palemoon with musl.

Re: TAZ distro with palemoon on musl: almost there

Posted: 2018-09-19, 15:22
by Peregrine
VCTLabs' pull request of 16 june 2018 was dismissed by deu at 18 August (https://github.com/deu/palemoon-overlay/pull/66 ).
Deu mentioned then that the pull request could instead be done upstream (we'll look into this option).
In either case, the pull request would already need an update as we need it to run under gcc 6.4 rather than 7.3.
Reason is that this way, we are on the same toolchain as the alpine builds, which Taner Tas has had good results with.
In the distro, SJLC solved this gcc issue in palemoon/newmoon by switching the gcc in the seed stage to the older version.