Closed Bug 1351377 Opened 7 years ago Closed 4 years ago

Support cross compilation Thunderbird with MinGW

Categories

(Thunderbird :: Build Config, enhancement, P5)

enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: naeilzoueidi, Unassigned)

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0
Build ID: 20170126200443

Steps to reproduce:

Cross Compile Thunderbird for Mingw32
I followed the steps described in this official documentation.
GCC version 6.3.0
Binutils-2.28
and mingw-w64 
Wlid64


Actual results:

In the last step of building :
./mozzila/mach build 
It exit with non zero code with message Windows-SDK is missing
I am working on the patch, will push it asap.
Assignee: nobody → naeilzoueidi
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee: naeilzoueidi → rob
Status: ASSIGNED → NEW
Type: defect → enhancement

WORK IN PROGRESS.
mozock.c is compatibility wrappers for socket handling on Windows due to various winsock implementations. Removing it from the build when using Clang+MinGW builds, but I have not tested whether LDAP functionality works or not.

WORK IN PROGRESS
The Clang+MinGW compiler setup gets identified as "clang" rather than "clang-cl". It's used to include some Windows specific code. There are probably better ways of doing this, but this approach compiles. It is untested otherwise.

WORK IN PROGRESS
The header files for the Windows Search API do not exist in MinGW. Rather than remain stuck on that issue, this patch simply disables the Windows Explorer search integration.

Attached file mozconfig

This is the mozconfig I'm using. It should work without too many changes for others. It's based on https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Cross_Compile_Mozilla_for_Mingw32 (which is outdated now) and the Firefox mozconfig at M-C:browser/config/mozconfigs/win64/mingwclang

The Linux host OS will need some tools installed from the distribution:

  • Mercurial
  • GCC/G++
  • upx
  • wine
  • makensis (on Ubuntu its called "nsis", other distributions will have mingw in the name)
  • nasm
  • yasm

clang, rust, cbindgen, and node I'm pulling from the Taskcluster toolchain archives, as described in the MDN article. If you have a source checkout and have run a mach configure, you can use mach to make downloading easier.

# cd $topsrcdir
mkdir mingw-tmp && pushd mingw-tmp
for i in linux64-clang-8-mingw-x64 mingw32-rust-1.35 linux64-cbindgen linux64-mingw-fxc2-x86 linux64-node
do
  mach artifact toolchain --cache-dir ~/.mozbuild/toolchains --from-build $i
done
popd
mv mingw-tmp ~/.mozbuild/mingw

Note that "mingw32-rust-1.35" is the latest available as of this writing, and it changes quickly. There's no toolchain alias like for other builds so check M-C:taskcluster/toolchain/rust.yml for the current version.
With regard to NSIS, the advice from the build team is not to use any NSIS build besides theirs. They seem to build okay, but I have not tested one yet so it might not work.

Assignee: rob → nobody
Severity: normal → minor
Priority: -- → P5

Bug 1619097 brings the brilliant work from bug 1617794 to Thunderbird, without the feature limitations that come from using MinGW headers.
I don't foresee the SearchAPI.h issue being solved on the MinGW side of things any time soon. And while I can understand the arguments against using MS's non-free headers and libraries, you're still building for a non-free platform.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: