如何在Archlinux中用gcc 7.2编译gcc 6.4.0 [英] How to compile gcc 6.4.0 with gcc 7.2 in Archlinux

查看:272
本文介绍了如何在Archlinux中用gcc 7.2编译gcc 6.4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to compile gcc 6.4.0 independently with gcc 7.2 in Archlinux.

配置如下:

../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中出现以下错误:

While compiling, I got the following error in md-unwind-support.h:

md-unwind-support.h:65:47: error: dereferencing pointer to incomplete type 'struct ucontext'

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

I compared md-unwind-support.h between defined in gcc 6.4.0 and gcc 7.2.0 and found that struct ucontext is defined as ucontext_t in gcc 7.2.0.

因此,我在gcc 6.4.0源代码树的md-unwind-support.h中进行了一些更改,但出现了如下命名空间问题:

So, I made some changes in md-unwind-support.h of gcc 6.4.0 source tree but got some kine of namespace issue as follows:

int std::uncaught_exceptions() should have been declared inside 'std'

我被困住了,对这个问题一无所知.

I get stuck and have no idea about this issue.

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

Any help and advice will be helpful.

推荐答案

要使make工作,必须修改文件make_folder/libgcc/config/i386/linux_unwind.h,其中make_folder是键入make命令的文件夹

In order to have make to work you have to modify the file make_folder/libgcc/config/i386/linux_unwind.h where make_folder is the folder where you type the make command.

linux_unwind.h中,您必须将第61行的struct ucontext *uc_ = context->cfa;更改为struct ucontext_t *uc_ = context->cfa;

In linux_unwind.h you have to change struct ucontext *uc_ = context->cfa; on line 61 to struct ucontext_t *uc_ = context->cfa;

感谢 Seong ,它告诉我们要修改的文件.

Thanks to Seong that told us what file to modify.

这篇关于如何在Archlinux中用gcc 7.2编译gcc 6.4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆