Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cross Compile Firefox 84 for Mingw32 on Ubuntu 20

19 views
Skip to first unread message

Ghobad Emadi

unread,
Feb 9, 2021, 12:22:05 PM2/9/21
to
Hello everyone,

I'm trying to cross compile Firefox 85.0.1 on Ubuntu 20 and I get different type of errors in finding some types in .h or .cpp files.

For example,
obj-x86_64-w64-mingw32/dist/include/mozilla/interceptor/MMPolicies.h:25:28: error: unknown type name 'MEM_EXTENDED_PARAMETER'

I found that in the former Firefox versions for example 82.0, this error does not occur.

some other errors are:
mozglue/misc/WindowsProcessMitigations.cpp:69:36: error: use of undeclared identifier 'ProcessPayloadRestrictionPolicy'
ProcessPayloadRestrictionPolicy, &polInfo,

/home/dev/85.0.1/mozilla-release-30fa4718813e735a3b4a0a5135352bfe2a655a8b/mozglue/misc/WindowsProcessMitigations.cpp:74:18: error: no member named 'EnableExportAddressFilterPlus' in '_PROCESS_MITIGATION_DYNAMIC_CODE_POLICY'


My mozeconfig file is like that:

CROSS_COMPILE=1

TOOLTOOL_DIR=/home/dev/85.0.1/mozilla-release-30fa4718813e735a3b4a0a5135352bfe2a655a8b

# MinGW does not have (or need) makecab
unset MAKECAB

RUSTC="${TOOLTOOL_DIR}/rustc/bin/rustc"
CARGO="${TOOLTOOL_DIR}/rustc/bin/cargo"
RUSTFMT="${TOOLTOOL_DIR}/rustc/bin/rustfmt"
CBINDGEN="${TOOLTOOL_DIR}/cbindgen/cbindgen"

mk_add_options AUTOCLOBBER=1

ac_add_options --enable-crashreporter
ac_add_options --enable-js-shell

# MinGW Stuff
ac_add_options --target=x86_64-w64-mingw32
ac_add_options --with-toolchain-prefix=x86_64-w64-mingw32-

ac_add_options --disable-warnings-as-errors
export MOZ_COPY_PDBS=1

# Temporary config settings until we get these working on mingw
ac_add_options --disable-accessibility # https://sourceforge.net/p/mingw-w64/bugs/648/

# These aren't supported on mingw at this time
ac_add_options --disable-webrtc # Bug 1393901
ac_add_options --disable-geckodriver # Bug 1489320
ac_add_options --disable-update-agent # Bug 1561797
ac_add_options --disable-default-browser-agent # WinToast does not build on mingw

# Find our toolchain
HOST_CC="$TOOLTOOL_DIR/clang/bin/clang"
HOST_CXX="$TOOLTOOL_DIR/clang/bin/clang++"
CC="$TOOLTOOL_DIR/clang/bin/x86_64-w64-mingw32-clang"
CXX="$TOOLTOOL_DIR/clang/bin/x86_64-w64-mingw32-clang++"
CXXFLAGS="-fms-extensions -Wno-incompatible-ms-struct"
AR=llvm-ar
RANLIB=llvm-ranlib

BINDGEN_CFLAGS="-I$TOOLTOOL_DIR/clang/x86_64-w64-mingw32/include/c++/v1 -I$TOOLTOOL_DIR/clang/x86_64-w64-mingw32/include"

# We want to make sure we use binutils and other binaries in the tooltool
# package.
mk_add_options "export PATH=$TOOLTOOL_DIR/rustc/bin:$TOOLTOOL_DIR/clang/bin:$TOOLTOOL_DIR/mingw32/bin:$TOOLTOOL_DIR/fxc2/bin:$PATH"

LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/mingw32/lib64:$TOOLTOOL_DIR/clang/lib
mk_add_options "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH"

ac_add_options --with-branding=browser/branding/unofficial


and I go through this document in Mozilla website:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Cross_Compile_Mozilla_for_Mingw32

Thanks in advanced.

Byron Jones

unread,
Feb 10, 2021, 12:18:35 AM2/10/21
to
Hello,

This newsgroup is no longer active; please use the "#build" room on
Matrix for assistance: https://chat.mozilla.org/#/room/#build:mozilla.org

See https://wiki.mozilla.org/Matrix for more information.


-glob

Ghobad Emadi wrote on 10/2/21 1:22 am:
--
glob — engineering workflow manager — moz://a

tri...@mozilla.com

unread,
Feb 10, 2021, 9:54:40 AM2/10/21
to
On Tuesday, February 9, 2021 at 5:22:05 PM UTC, emadi....@gmail.com wrote:
> My mozeconfig file is like that:
> ...
> ac_add_options --disable-accessibility # https://sourceforge.net/p/mingw-w64/bugs/648/

This is no longer needed, so your mozconfig is a bit out of date. The most recent one is
https://searchfox.org/mozilla-central/source/browser/config/mozconfigs/win32/mingwclang (x86)
https://searchfox.org/mozilla-central/source/browser/config/mozconfigs/win64/mingwclang (x64)
I have updated this a little bit. The toolchain links there are for clang 9 and out of date. I've updated them to clang 11.

If you downloaded those toolchains it may explain some of initial errors you got - "error: use of undeclared identifier 'ProcessPayloadRestrictionPolicy' " indicates that the mingw checkout you are using is out of date.

-tom

tri...@mozilla.com

unread,
Feb 10, 2021, 9:55:23 AM2/10/21
to
On Wednesday, February 10, 2021 at 2:54:40 PM UTC, tri...@mozilla.com wrote:
> I have updated this a little bit. The toolchain links there are for clang 9 and out of date. I've updated them to clang 11.

Actually, I have submitted a pull request to update it: https://github.com/mdn/content/pull/2253/files
0 new messages