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] >> Build failed in step ‘Building mingw-w64 files’
[ERROR] >> called in step ‘(top-level)’
[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] >> 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] (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 “firstname.lastname@example.org”
| #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:
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:
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.