Linux: buildling cross compile toolchain

I’m trying to build cross compile toolchain as instructed by this page:

The reason I’m not using the pre-compiled version is because eventually I would like to tweak the setup to generate cross compiler for arm-linux target. But as a first step trying to get the standard cross compiler for x86-linux working.

I’m seeing this failure:

[INFO ] =================================================================
[INFO ] Building mingw-w64 files
[EXTRA] Configuring mingw-w64-crt
[ERROR] configure: error: Please check if the mingw-w64 header set and the build/host option are set properly.
[ERROR]
[ERROR] >>
[ERROR] >> Build failed in step ‘Building mingw-w64 files’
[ERROR] >> called in step ‘(top-level)’
[ERROR] >>
[ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR] >> called from: do_libc[scripts/build/libc/mingw.sh@66]
[ERROR] >> called from: main[scripts/crosstool-NG.sh@638]
[ERROR] >>
[ERROR] >> For more info on this error, look at the file: ‘build.log’
[ERROR] >> There is a list of known issues, some with workarounds, in:
[ERROR] >> ‘/home/dmahashin/projects/ue4/cross/build/crosstool-ng/docs/B - Known issues.txt’
[ERROR]
[ERROR] (elapsed: 29:38.96)

The config.log file for mingw-w64-crt configure script is the following:

configure:5640: $? = 1
configure: failed program was:
| /* confdefs.h /
| #define PACKAGE_NAME “mingw-w64-runtime”
| #define PACKAGE_TARNAME “mingw-w64-runtime”
| #define PACKAGE_VERSION “2.0”
| #define PACKAGE_STRING “mingw-w64-runtime 2.0”
| #define PACKAGE_BUGREPORT “mingw-w64-public@lists.sourceforge.net
| #define PACKAGE_URL “”
| #define PACKAGE “mingw-w64-runtime”
| #define VERSION “2.0”
| #define __ENABLE_GLOBBING 0
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /
end confdefs.h. */
| #include <_mingw_mac.h>
configure:5640: result: no
configure:5640: checking for _mingw_mac.h
configure:5640: result: no
configure:5644: error: Please check if the mingw-w64 header set and the build/host option are set properly.

I noticed that this file actually exists and installed in presumably the cross compiler build directory:
~/x-tools/x86_64-pc-mingw32/x86_64-pc-mingw32/sysroot/usr/x86_64-pc-mingw32/include/_mingw_mac.h

It looks like the configure script is trying to look for this header under the build machine’s true root directory (i.e /usr/include, etc).

Looking into crosstool-ng’s mingw.sh script this is how the configure is called:
CT_DoExecLog CFG
“${CT_SRC_DIR}/mingw-w64-v${CT_WINAPI_VERSION}/mingw-w64-crt/configure”
–prefix=/usr
–build=${CT_BUILD}
–host=${CT_TARGET} \

Doesn’t this need a --with-sysroot option ?
I tried adding that and pointing it to the ~/x-tools/… location above and it still fails. Looking at the configure script it doesn’t look like it’s actually using the given --with-sysroot value at all.
Inside …/linux-host-build/.build/src/mingw-w64-v2.0.7/mingw-w64-crt/configure there is this suspicious comment:

Checks for programs.

Checks for headers, libs, etc need to utilize the sysroot… no idea how

Has anyone ran into and fixed this issue in the past ? Any tips would be greatly appreciated.

Thanks

While not exactly answering the your question, note that we are building mingw64 with ct-ng 1.19.0 - the newer version aren’t tested (and didn’t work for me). Build log normally has enough information to figure out the problem. A few more caveats:

  1. pass absolute filenames everywhere
  2. build on a case-sensitive filesystem (this matters if you’re trying cygwin and/or Mac builds).

I have zipped our ARM toolchain and gave our CDN people to upload - will shortly paste the URL to it.

I am sorry for the delay - that didn’t happen until the Christmas break. Here’s the link to Windows toolchain targeting ARM Linux (note that it contains ct-ng files + instructions that can help you build Linux toolchain): https://s3.amazonaws.com/unrealengine/qfe/arm-unknown-linux-gnueabihf_v5_clang-3.5.0-ld-2.23.1-glibc-2.13.zip