Back to the chromium compile task, I managed to compile it on the raspberrypi 4 itself in the end, with the help of a distributed compiler to save on time... Here is the result for chromium-77.0.3865.90:
Code: Select all
* Final size of build directory: 5805297 KiB ( 5.5 GiB)
* Final size of installed tree: 458178 KiB (447.4 MiB)
real 358m59.283s
user 140m15.309s
sys 32m32.286s
using:
Code: Select all
# cat /etc/portage/env/{notmpfs,makeopts-l1}.conf
PORTAGE_TMPDIR="/var/tmp/notmpfs"
MAKEOPTS="-j6 -l1"
and had to append the crypto extension to the C/CPP FLAGS:
Code: Select all
COMMON_FLAGS="-O3 -pipe -mlittle-endian -mabi=lp64 -march=armv8-a+crc+crypto -mtune=cortex-a72"
as without it it was failing to compile.
But what brought me here, in this forum thread in the first place? I used the base template for aarch64 I downloaded from Gentoo, which had the make.conf file setup to contain a new to me variable, which I ignored in the hurry:
COMMON_FLAGS.
What I overlooked was, I only set my CFLAGS variable and then comment out the COMMON_FLAGS, believing this is the CFLAGS and leaving all the other compilers' parameters being sourced from COMMON_FLAGS(which was an empty string).
What this caused was, code without any optimizations to be generated, which was causing my raspberrypi and also the qemu-aarch64 chroot to run out of memory during linking no matter what.
Lesson learned!
What helped me to identify this error was another gentoo package which was failing to install... webkit-gtk. The source code has a check whether the compiler runs with optimizations and if it does not it errors out and fails to compile with:
"WebKit will be slow. Set -DRELEASE_WITHOUT_OPTIMIZATIONS if this is intended"
Well done webkit-gtk

and thank you.
Regarding the topic with -O3 compiler flag and whether to use it or not, I run arm, aarch64 and amd64 machines compiled with -O3 and I have not seen any performance drawbacks. Again, most of the critical packages would overwrite it to a "sane" default, like in the case of chromium:
Code: Select all
* strip-flags: CFLAGS: changed '-O3 -pipe -mlittle-endian -mabi=lp64 -march=armv8-a+crc -mtune=cortex-a72' to '-pipe -mlittle-endian -mabi=lp64 -march=armv8-a+crc -mtune=cortex-a72 -O2'
* strip-flags: CXXFLAGS: changed '-O3 -pipe -mlittle-endian -mabi=lp64 -march=armv8-a+crc -mtune=cortex-a72' to '-pipe -mlittle-endian -mabi=lp64 -march=armv8-a+crc -mtune=cortex-a72 -O2'
* strip-flags: FFLAGS: changed '-O3 -pipe -mlittle-endian -mabi=lp64 -march=armv8-a+crc -mtune=cortex-a72' to '-pipe -mlittle-endian -mabi=lp64 -march=armv8-a+crc -mtune=cortex-a72 -O2'
* strip-flags: FCFLAGS: changed '-O3 -pipe -mlittle-endian -mabi=lp64 -march=armv8-a+crc -mtune=cortex-a72' to '-pipe -mlittle-endian -mabi=lp64 -march=armv8-a+crc -mtune=cortex-a72 -O2'
Again, I have not done any real comparison on benefits/drawbacks of having it enabled either. The only issues I had was with silent library crashes, thus I have those in the -O2 list:
Code: Select all
media-libs/alsa-lib gcc-O2.conf
net-libs/libnice gcc-O2.conf
media-libs/gstreamer gcc-O2.conf
dev-libs/glib gcc-O2.conf
app-emulation/virt-viewer gcc-O2.conf
NeddySeagoon, your response about -O3 does make sense to some extent so I will put some more research into it when time allows. Thank you.
Cheers,
-Nikolay