Alex313031 / Mercury

Firefox fork with compiler optimizations and patches from Librewolf, Waterfox, and GNU IceCat.
https://thorium.rocks/mercury
Mozilla Public License 2.0
1.22k stars 28 forks source link

Cross Building Windows AVX2 on Linux #125

Closed wagesj45 closed 9 months ago

wagesj45 commented 9 months ago

I'm attempting to set up an automated build process on a Debian Linux server. Having cloned the Mercury source, I followed all the steps in the BUILDING.md documents for the --release trunk and --cross setup value. This build process completes and runs fine on Windows.

What I'm struggling to do is convert the mozconfig values from mozconfigs/mozconfig-win-avx2. Specifically, I'd like to enable AVX2 support and target the znver3 or x86-64-v3 architecture. A few things I've noticed:

Is there now, or could there be, a setup value that can specify march value and AVX support? And is there a requirement for these specifications (AVX2, march=x86-64-v3) that require the Microsoft C++ compiler specified in WIN32_REDIST_DIR? Is there a method I could use to translate the values from mozconfig-win-avx2 to mozconfig-win-cross?

Alex313031 commented 9 months ago

@wagesj45 Here you go! > https://github.com/Alex313031/Mercury/commit/5f762574700e542480eb375d01e9d643cc6ba011

You should now be able to use ./setup.sh --cross-avx2

Note, on top of the normal things to build, you will also need to install icoutils and msitools like sudo apt install icoutils msitools

Also linted a few things, and added all this to the Mercury-Win7 repo too.

wagesj45 commented 9 months ago

Preliminary testing gave me an executable, but packaging the installer failed. I'm going to try again on a fresh Ubuntu Server installation, since that distro is suggested by the official Firefox documentation. I really appreciate the help, though! Will update when I figure out more.

wagesj45 commented 9 months ago

So for future reference, this config does indeed work. I switched to a fresh install of Ubuntu Server and was able to install all dependencies and build successfully. I really appreciate your help!