@@ -11,6 +11,16 @@ do_libc_extract() {
CT_Pushd "${CT_SRC_DIR}/mingw-w64-v${CT_WINAPI_VERSION}/"
CT_Patch nochdir mingw-w64 "${CT_WINAPI_VERSION}"
CT_Popd
+
+ # Beginning with GCC 4.6.0, the "sysroot/mingw/include" directory
+ # must exist before the pass-1 compiler is built.
+ CT_mkdir_pushd "${CT_SYSROOT_DIR}/usr/${CT_TARGET}/include"
+ CT_Popd
+
+ # It seems mingw is strangely set up to look into /mingw instead of
+ # /usr (notably when looking for the headers). This symlink is
+ # here to workaround this, and seems to be here to last... :-/
+ CT_DoExecLog ALL ln -sv "usr/${CT_TARGET}"
"${CT_SYSROOT_DIR}/mingw"
}