gcc - 为 mingw-w64 构建跨 GCC
问题描述
在我之前遇到的麻烦中,构建 GCC,我遇到了一个让我尴尬的问题。
首先,仅供参考,我正在从 freebsd 12.2 工作站为 mingw32 构建 GCC。
../gcc/configure --target=x86_64-w64-mingw32 --prefix=/usr/local/mingw-gcc/ --with-sysroot=/usr/local/mingw/ --enable-languages=c,c++ --enable-fully-dynamic-string --enable-checking=release --enable-version-specific-runtime-libs --enable-plugins --disable-shared --disable-multilib --disable-nls --disable-werror --disable-win32-registry --disable-sjlj-exceptions --disable-libstdcxx-verbose CFLAGS=-I/usr/local/include -L/usr/local/lib CPPFLAGS=-I/usr/local/include AR_FOR_TARGET=/usr/local/mingw/bin/x86_64-w64-mingw32-ar AS_FOR_TARGET=/usr/local/mingw/bin/x86_64-w64-mingw32-as DLLTOOL_FOR_TARGET=/usr/local/mingw/bin/x86_64-w64-mingw32-dlltool LD_FOR_TARGET=/usr/local/mingw/bin/x86_64-w64-mingw32-ld NM_FOR_TARGET=/usr/local/mingw/bin/x86_64-w64-mingw32-nm OBJCOPY_FOR_TARGET=/usr/local/mingw/bin/x86_64-w64-mingw32-objcopy OBJDUMP_FOR_TARGET=/usr/local/mingw/bin/x86_64-w64-mingw32-objdump RANLIB_FOR_TARGET=/usr/local/mingw/bin/x86_64-w64-mingw32-ranlib STRIP_FOR_TARGET=/usr/local/mingw/bin/x86_64-w64-mingw32-strip WINDRES_FOR_TARGET=/usr/local/mingw/bin/x86_64-w64-mingw32-windres CPP=/usr/local/bin/cpp10
然后xgcc成功构建并用于构建libgcc。在配置过程中,调用 AC_PROG_CPP 但在此步骤:
configure:4049: checking how to run the C preprocessor
configure:4080: /home/didier/build-gcc-64/./gcc/xgcc -B/home/didier/build-gcc-64/./gcc/ -L/usr/local/mingw-gcc/x86_64-w64-mingw32/lib -L/usr/local/mingw-gcc/mingw/lib -isystem /usr/local/mingw-gcc/x86_64-w64-mingw32/include -isystem /usr/local/mingw-gcc/mingw/include -B/usr/local/mingw-gcc/x86_64-w64-mingw32/bin/ -B/usr/local/mingw-gcc/x86_64-w64-mingw32/lib/ -isystem /usr/local/mingw-gcc/x86_64-w64-mingw32/include -isystem /usr/local/mingw-gcc/x86_64-w64-mingw32/sys-include -E conftest.c
In file included from /home/didier/build-gcc-64/./gcc/include-fixed/syslimits.h:7,
from /home/didier/build-gcc-64/./gcc/include-fixed/limits.h:34,
from conftest.c:10:
/home/didier/build-gcc-64/./gcc/include-fixed/limits.h:203:15: fatal error: limits.h: No such file or directory
203 | #include_next <limits.h> /* recurse down to the real one */
| ^~~~~~~~~~
compilation terminated.
configure:4080: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
这意味着我需要两个 limits.h 在包含路径中的不同位置。但是在源代码中只有一个可用。
非常感谢您的贡献。
干杯迪迪埃
解决方案
推荐阅读
- firefox - Firefox 没有正确触发 setInterval
- java - 如果实现的方法是通用的,我可以将实现相同接口的 java 类放在一个列表中吗?
- c# - C# 从 POST 响应中读取 .wav RIFF 字节数据
- node.js - 如果有 nodejs 的代理中间件,为什么要使用 nginx?
- svn - Tortoise SVN bugtrack URL 到 BUGID 的超链接在提交后不起作用,在 SVN showlog 下查看时
- xml - 无法从 XML 生成正确的 XSD
- node.js - SimpleParser 不解析来自 s3 存储桶的电子邮件
- android - 错误:膨胀类 com.google.android.material.textfield.TextInputLayout
- python - postgres中的无效日期和整数输入
- azure-cloud-services - 适用于云服务的 Application Insights Profiler ApplicationInsightsProfiler 接收器密钥