Skip to main content
Topic: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux (Read 10572 times)

Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

I have read in this thread https://dndsanctuary.eu/index.php?topic=1505.0 that Otter Browser can be compiled for older processors too which lack of SSE2 instruction set. Temporarily I have to use such an old PC. Its performance is not so low, quite acceptable in fact with 2 GB of RAM, but unfortunately I am unable to install any of my mostly used and favourite browsers (Opera, Chromium, Vivaldi, etc) because all of them need the SSE2 instruction set.

As far as I understanded the thread states that "libqt5webkit5" package should be recompiled from source by adding some compile rules:

Code: [Select]
5. Edit your_build_dir/qtwebkit-opensource-src-version/debian/rules:

Find the "disabled_jit_architectures" variable and add "i386" arch to it.
Code: [Select]
disabled_jit_architectures := armel mips mipsel
# becomes:
disabled_jit_architectures := armel mips mipsel i386

So my question would be that how can I do the compiling for my AMD Athlon XP (1533 Mhz) in Arch Linux and where can I download those mentioned sources?

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #1
@konstantin, AFAIK you don't have to patch anything, and disabling JIT is going to negatively impact performance (information from QtWebKit devs).
Plus you should consider qt5-webkit-ng package anyway.
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #2
Thx, I have installed "qt5-webkit-ng-tp5-2" package. Now what should I do? Just compile Otter Browser and it will work on the Athlon without SSE2?

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #3
@konstantin, it should.
You can try:
https://aur.archlinux.org/packages/otter-browser (stable releases)
Or:
https://aur.archlinux.org/packages/otter-browser-weekly (sometimes less stable but up to date)
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #4
I see, but I have already made the compilation two times, and in both cases I had only an error message when I started Otter Browser:

Code: [Select]
Illegal instruction
core dumped

Due to the lack of SSE2 CPU support.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #5
@konstantin, could you try to generate backtrace?

Also try exporting this environment variable before running:
Code: [Select]
export JSC_useLLInt=0

Or this one (but don't mix them!):
Code: [Select]
export JSC_useJIT=0
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #6
I tried both in the form:

Code: [Select]
export JSC_useLLInt=0;otter-browser

But didn't helped. Still "illegal instruction (core dumped)"

And how can I generate a backtrace?



Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #8
I tried both the mentioned environment variables either in common or in separate bash windows. None of them worked for me.
Now I made a copy of my /etc/makepkg.conf and placed two directives in it:
CFLAGS=""
CXXFLAGS=""

Code: [Select]
#
# /etc/makepkg.conf
#

#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
#  Format: 'protocol::agent'
DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
          'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'rsync::/usr/bin/rsync --no-motd -z %u %o'
          'scp::/usr/bin/scp -C %u %o')

# Other common tools:
# /usr/bin/snarf
# /usr/bin/lftpget -c
# /usr/bin/wget

#-- The package required by makepkg to download VCS sources
#  Format: 'protocol::package'
VCSCLIENTS=('bzr::bzr'
            'git::git'
            'hg::mercurial'
            'svn::subversion')

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="i686"
CHOST="i686-pc-linux-gnu"

#-- Compiler and Linker Flags
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong"
CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong"
CFLAGS=""
CXXFLAGS=""

LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"
#-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2"
#-- Debugging flags
DEBUG_CFLAGS="-g -fvar-tracking-assignments"
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"

#########################################################################
# BUILD ENVIRONMENT
#########################################################################
#
# Defaults: BUILDENV=(!distcc color !ccache check !sign)
#  A negated environment option will do the opposite of the comments below.
#
#-- distcc:  Use the Distributed C/C++/ObjC compiler
#-- color:    Colorize output messages
#-- ccache:  Use ccache to cache compilation
#-- check:    Run the check() function if present in the PKGBUILD
#-- sign:    Generate PGP signature file
#
BUILDENV=(!distcc color !ccache check !sign)
#
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster.
#DISTCC_HOSTS=""
#
#-- Specify a directory for package building.
#BUILDDIR=/tmp/makepkg

#########################################################################
# GLOBAL PACKAGE OPTIONS
#  These are default values for the options=() settings
#########################################################################
#
# Default: OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !optipng !upx !debug)
#  A negated option will do the opposite of the comments below.
#
#-- strip:      Strip symbols from binaries/libraries
#-- docs:      Save doc directories specified by DOC_DIRS
#-- libtool:    Leave libtool (.la) files in packages
#-- staticlibs: Leave static library (.a) files in packages
#-- emptydirs:  Leave empty directories in packages
#-- zipman:    Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge:      Remove files specified by PURGE_TARGETS
#-- upx:        Compress binary executable files using UPX
#-- optipng:    Optimize PNG images with optipng
#-- debug:      Add debugging flags as specified in DEBUG_* variables
#
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !optipng !upx !debug)

#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
INTEGRITY_CHECK=(md5)
#-- Options to be used when stripping binaries. See `man strip' for details.
STRIP_BINARIES="--strip-all"
#-- Options to be used when stripping shared libraries. See `man strip' for details.
STRIP_SHARED="--strip-unneeded"
#-- Options to be used when stripping static libraries. See `man strip' for details.
STRIP_STATIC="--strip-debug"
#-- Manual (man and info) directories to compress (if zipman is specified)
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
#-- Doc directories to remove (if !docs is specified)
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
#-- Files to be removed from all packages (if purge is specified)
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)

#########################################################################
# PACKAGE OUTPUT
#########################################################################
#
# Default: put built package and cached source in build directory
#
#-- Destination: specify a fixed directory where all packages will be placed
#PKGDEST=/home/packages
#-- Source cache: specify a fixed directory where source files will be cached
#SRCDEST=/home/sources
#-- Source packages: specify a fixed directory where all src packages will be placed
#SRCPKGDEST=/home/srcpackages
#-- Log files: specify a fixed directory where all log files will be placed
#LOGDEST=/home/makepkglogs
#-- Packager: name/email of the person or organization building packages
#PACKAGER="John Doe <john@doe.com>"
#-- Specify a key to use for package signing
#GPGKEY=""

#########################################################################
# COMPRESSION DEFAULTS
#########################################################################
#
COMPRESSGZ=(gzip -c -f -n)
COMPRESSBZ2=(bzip2 -c -f)
COMPRESSXZ=(xz -c -z -)
COMPRESSLRZ=(lrzip -q)
COMPRESSLZO=(lzop -q)
COMPRESSZ=(compress -c -f)

#########################################################################
# EXTENSION DEFAULTS
#########################################################################
#
# WARNING: Do NOT modify these variables unless you know what you are
#          doing.
#
PKGEXT='.pkg.tar.xz'
SRCEXT='.src.tar.gz'

# vim: set ft=sh ts=2 sw=2 et:

Then I saved the https://aur.archlinux.org/cgit/aur.git/snapshot/otter-browser.tar.gz from the AUR, extracted it, and I also modified the PKGBUILD by adding: options=(debug !strip) at the beginning.

Code: [Select]
# Maintainer: Steffen Weber <-boenki-gmx-de->

pkgname=otter-browser
pkgver=0.9.12
pkgrel=1
pkgdesc="Browser aiming to recreate classic Opera (12.x) UI using Qt5."
arch=('i686' 'x86_64')
url="http://$pkgname.org"
license=('GPL3')
depends=('qt5-multimedia' 'qt5-webkit' 'hicolor-icon-theme' 'desktop-file-utils' 'hunspell')
makedepends=('cmake' 'qt5-tools')
conflicts=('otter-browser-git')
source=($pkgname-$pkgver.tar.gz::https://github.com/OtterBrowser/$pkgname/archive/v$pkgver.tar.gz)
md5sums=('a9a141506f1ae428b21d69048840621f')
options=(debug !strip)

build() {
  cd $pkgname-$pkgver
  lrelease resources/translations/*.ts
  cmake -DCMAKE_INSTALL_PREFIX="/usr"
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR=$pkgdir install
}

Then I invoked makepkg -s --config ./makepkg.conf, I hope after the compilation the resulting binary will contain the debugging informations.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #9
The trace.log after all:

Code: [Select]
Starting program: /usr/bin/otter-browser 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0xa5908b40 (LWP 5420)]
[New Thread 0xa4b43b40 (LWP 5421)]
[New Thread 0xa2d4fb40 (LWP 5422)]
[New Thread 0xa254eb40 (LWP 5423)]

Thread 1 "otter-browser" received signal SIGILL, Illegal instruction.
0xb2d729b9 in ?? () from /usr/lib/libQt5WebEngineCore.so.5
Already logging to trace.log.

Thread 5 (Thread 0xa254eb40 (LWP 5423)):
#0  0xb7fdacd9 in __kernel_vsyscall ()
#1  0xacffe15f in poll () at /usr/lib/libc.so.6
#2  0xac855f70 in g_poll () at /usr/lib/libglib-2.0.so.0
#3  0xac84650c in  () at /usr/lib/libglib-2.0.so.0
#4  0xac846929 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#5  0xa99dcdc5 in  () at /usr/lib/libgio-2.0.so.0
#6  0xac86e59a in  () at /usr/lib/libglib-2.0.so.0
#7  0xaca65301 in start_thread () at /usr/lib/libpthread.so.0
#8  0xad0080ae in clone () at /usr/lib/libc.so.6

Thread 4 (Thread 0xa2d4fb40 (LWP 5422)):
#0  0xb7fdacd9 in __kernel_vsyscall ()
#1  0xacffe15f in poll () at /usr/lib/libc.so.6
#2  0xac855f70 in g_poll () at /usr/lib/libglib-2.0.so.0
#3  0xac84650c in  () at /usr/lib/libglib-2.0.so.0
#4  0xac846644 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#5  0xac8466a0 in  () at /usr/lib/libglib-2.0.so.0
#6  0xac86e59a in  () at /usr/lib/libglib-2.0.so.0
#7  0xaca65301 in start_thread () at /usr/lib/libpthread.so.0
#8  0xad0080ae in clone () at /usr/lib/libc.so.6

Quit

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #10
@konstantin, huh, apparently you have QtWebEngine (Blink based library) installed and it's causing crash (we support two web backends).

You need to rebuild without it, either add -DENABLE_QTWEBENGINE=No to cmake call in PKGBUILD or simply uninstall QtWebEngine from your system (it won't work anyway) and then rebuild otter-browser package.

That doesn't guarantee that it will work now but at least QtWebEngine won't interfere.
If you will still get crash then try again setting variables and post new backtrace.
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #11
Man, it works now! Otter-browser compiled without QtWebEngine starts fine on an AMD Athlon XP without SSE2.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #12
@konstantin, that's great. :-)
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #13
Yes, but it unfortunately crashes again when I try to login into facebook.

Second trace.log (it crashed before I clicked on login button)

Code: [Select]
Starting program: /usr/bin/otter-browser 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0xaf3d0b40 (LWP 10263)]
[New Thread 0xae58cb40 (LWP 10264)]
[New Thread 0xacd63b40 (LWP 10265)]
[New Thread 0xac562b40 (LWP 10266)]
[New Thread 0xab997b40 (LWP 10267)]
[New Thread 0xaa1ffb40 (LWP 10268)]
[New Thread 0xa99feb40 (LWP 10269)]
[New Thread 0xa8dffb40 (LWP 10274)]
[New Thread 0xa85feb40 (LWP 10275)]
[New Thread 0xa7b47b40 (LWP 10276)]
[New Thread 0xa5fffb40 (LWP 10277)]
[New Thread 0xa4fffb40 (LWP 10278)]

Thread 1 "otter-browser" received signal SIGILL, Illegal instruction.
0xaa8a75a1 in ?? ()

Thread 13 (Thread 0xa4fffb40 (LWP 10278)):
#0  0xb7fdacd9 in __kernel_vsyscall ()
#1  0xb3387c8b in pthread_cond_wait@@GLIBC_2.3.2 ()
    at /usr/lib/libpthread.so.0
#2  0xb365ff4e in __gthread_cond_wait (__mutex=<optimized out>, __cond=0xa55632dc)
    at /build/gcc/src/gcc-build/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu/bits/gthr-default.h:864
        __e = <optimized out>
#3  0xb365ff4e in std::condition_variable::wait(std::unique_lock<std::mutex>&) (this=0xa55632dc, __lock=...)
    at /build/gcc/src/gcc/libstdc++-v3/src/c++11/condition_variable.cc:53
        __e = <optimized out>
#4  0xb4c31dd8 in WTF::ParkingLot::parkConditionally(void const*, std::function<bool ()>, std::function<void ()>, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> > >) () at /usr/lib/libQt5WebKit.so.5
#5  0xb458811d in  () at /usr/lib/libQt5WebKit.so.5
#6  0xb4c34d70 in  () at /usr/lib/libQt5WebKit.so.5
#7  0xb4c610f9 in  () at /usr/lib/libQt5WebKit.so.5
#8  0xb3382301 in start_thread () at /usr/lib/libpthread.so.0
#9  0xb34820ae in clone () at /usr/lib/libc.so.6
Quit


Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #14
@konstantin, have you tried these variables?
Try reproducing with one of them set.

Also there is hint for attempting to produce better backtrace:
Quote
<annulen|home> it may help to print disasm of current function after gdb stops on crash

BTW, if you are using Freenode then you can ask directly on #qtwebkit, that should make this debugging a bit faster. ;-)
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #15
I tried out "export JSC_useJIT=0" and now I was able to login into facebook.
But sorry, I don't know what is Freenode.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #16
@konstantin, OK, there is some more testing to be done apparently:
Quote
<annulen|home> try JSC_useDFGJIT=0 instead of JSC_useJIT
<annulen|home> make sure that JSC_useJIT is not set or set to non-null

Freenode provides IRC service, QtWebKit devs hang out on #qtwebkit channel there.

Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #17
I tried now "JSC_useDFGJIT=0", but after a few minutes of facebook browsing it crashed soon.
Yesterday testing  "JSC_useJIT=0" seemd to be stable, no crash for about two hour of browsing.

Anyway I am testing "otter-browser-0.9.12". Handy little browser, performance is quite acceptable on this 16 years old PC especially compared to Firefox. I used Opera 43 recently, till my other PC which was SSE2 capable run down.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #18
@konstantin, we will be able to debug it better in more interactive mode. :-P
If you don't have IRC client around then you can try web client (using another instance of browser), like:
http://irc.lc/freenode/qtwebkit
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #19
@konstantin, OK, there is some more testing to be done apparently:
Quote
<annulen|home> try JSC_useDFGJIT=0 instead of JSC_useJIT
<annulen|home> make sure that JSC_useJIT is not set or set to non-null
Are they namesakes, or this is just trolling?  ??? Because annulen is also Konstantin.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #20
@Freeman, I don't think that's such rare name. ;-)
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #21
An interesting error came to light: when I try to save a file which name contains an apostrophe character, and it is passed by "Content-disposition: attachment; filename="A & # 3 9;B.txt;" the filename will be chunked after the & sign.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #22
@konstantin, OK, there is some more testing to be done apparently:
Quote
<annulen|home> try JSC_useDFGJIT=0 instead of JSC_useJIT
<annulen|home> make sure that JSC_useJIT is not set or set to non-null
Are they namesakes, or this is just trolling?  ??? Because annulen is also Konstantin.

No, I live in Hungary, and the english / latin equivalent of my name is accidentally Konstantin, that's all.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #23
@konstantin, lets focus on original first (crashes), the latter is probably unrelated to QtWebKit anyway (but will need research anyway).
Now it's the right time to visit IRC channel, QtWebKit maintainer is online.
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.

Re: Compile Otter Browser for Athlon XP processor (without SSE2) in Arch Linux

Reply #24
Another crash after a few hours of browsing:
Code: [Select]
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory

** (otter-browser:5189): CRITICAL **: file gstaudioringbuffer.c: line 1993 (gst_audio_ring_buffer_set_channel_positions): should not be reached
QPixmap::scaled: Pixmap is a null pixmap
QPixmap::scaled: Pixmap is a null pixmap
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)