如何在Archlinux中用gcc 7.2编译gcc 6.4.0 [英] How to compile gcc 6.4.0 with gcc 7.2 in Archlinux
问题描述
我正在尝试在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屋!