如何在 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
被定义为 ucontext_t
在 gcc 7.2.0 中.
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屋!