gcc - 如何在 Archlinux 中使用 gcc 7.2 编译 gcc 6.4.0

标签 gcc archlinux

我正在尝试在 Archlinux 中使用 gcc 7.2 独立编译 gcc 6.4.0。

配置如下:

../configure --prefix=${INSTALL_PREFIX} --enable-languages=c,c++,fortran \
    --enable-threads=posix --enable-tls --enable-libgomp --enable-lto \
    --enable-shared --enable-static --disable-nls --disable-multilib \
    --with-fpmath=sse

编译时,我在 md-unwind-support.h 中得到以下错误:
md-unwind-support.h:65:47: error: dereferencing pointer to incomplete type 'struct ucontext'

我比较过 md-unwind-support.h在 gcc 6.4.0 和 gcc 7.2.0 中定义之间,发现 struct ucontext定义为 ucontext_t在 gcc 7.2.0 中。

所以,我在 md-unwind-support.h 做了一些改动gcc 6.4.0 源代码树,但遇到了一些命名空间问题,如下所示:
int std::uncaught_exceptions() should have been declared inside 'std'

我被卡住了,不知道这个问题。

任何帮助和建议都会有所帮助。

最佳答案

为了拥有make要工作,您必须修改文件 make_folder/libgcc/config/i386/linux_unwind.h哪里make_folder是您在其中键入 make 的文件夹命令。

linux_unwind.h你要改struct ucontext *uc_ = context->cfa;在线61至struct ucontext_t *uc_ = context->cfa;
感谢 Seong这告诉我们要修改什么文件。

关于gcc - 如何在 Archlinux 中使用 gcc 7.2 编译 gcc 6.4.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46999900/

相关文章:

c++ - 没有中间表达式的三元运算符

linux - 虚幻引擎在 arch Linux 上随机崩溃未处理的异常 : SIGABRT

linux - 蒙神 : symbol lookup error: mongod: undefined symbol: _ZN4YAML6detail9node_data12empty_scalarB5cxx11

linux - Gcloud 初始化为错误的项目

Python 总是返回 Network is unreachable because of old ipv6 configuration

bash - Arch Linux 须藤 : command not found

C: GCC 编译器——类型冲突错误

代码块找不到我的编译器

c++ - 二进制表达式中的 GCC 临时常量

windows - 如何将目录添加到 Cygwin gcc 默认搜索路径