本文介绍了在Ubuntu 14.04中编译GCC 3.4.6时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在Ubuntu 14.04 x64中编译GCC 3.4.6。它已经有GCC-4.8.2的新版本。
我运行了 ./ configure --prefix = / usr / local / gcc-3.4
和 make
。
我最终遇到了几个错误,我可以在这些错误中找到解决方案。
../../最后,我终于遇到了这个错误,我找不到任何解决方案。 gcc / unwind-dw2.c:函数`uw_frame_state_for':
../../gcc/unwind-dw2.c:1031:error:field`info'有不完整的类型
make [2 ]:*** [libgcc / 32 / unwind-dw2.o]错误1
make [2]:离开目录`/home/hp-11/Documents/gcc-3.4.6/build/gcc'
make [1]:*** [stmp-multilib]错误2
make [1]:离开目录`/home/hp-11/Documents/gcc-3.4.6/build/gcc'
make:*** [all-gcc] Error 2
有人知道如何解决它?请告诉我是否需要更多细节。
这是一个老知名的问题,关于siginfo和siginfo_t
所有你需要的就是看你所有地方的GCC资源,比如
struct rt_sigframe {\
int sig; \
struct siginfo * pinfo; \
void * puc; \
struct siginfo info; \
struct ucontext uc; \
} * rt_ =(CONTEXT) - > cfa; \
sc_ =(struct sigcontext *)& rt _-> uc.uc_mcontext; \
这个是在gcc / config / i386 / linux.h里面的, / p>
手动将 struct siginfo *
替换为 siginfo_t *
和 struct siginfo
到 siginfo_t
,使它成为最新的POSIX兼容。在每个rt_sigframe声明中,最常见的是两个这样的地方,包括您的 info
问题字段。
I am trying to compile GCC 3.4.6 in Ubuntu 14.04 x64. It already has newer version of GCC-4.8.2.
I ran ./configure --prefix=/usr/local/gcc-3.4
and make
.
I ended up in several errors for which I could find solutions on searching.
Error 1
Error 2
Finally I ended up in this error, which I couldn't find any solution.
../../gcc/unwind-dw2.c: In function `uw_frame_state_for':
../../gcc/unwind-dw2.c:1031: error: field `info' has incomplete type
make[2]: *** [libgcc/32/unwind-dw2.o] Error 1
make[2]: Leaving directory `/home/hp-11/Documents/gcc-3.4.6/build/gcc'
make[1]: *** [stmp-multilib] Error 2
make[1]: Leaving directory `/home/hp-11/Documents/gcc-3.4.6/build/gcc'
make: *** [all-gcc] Error 2
Does anybody know how to fix it? Please let me know if more details are needed.
解决方案
This is old good-known problem, regarding siginfo and siginfo_t
All you need is to look at you GCC sources for all places like
struct rt_sigframe { \
int sig; \
struct siginfo *pinfo; \
void *puc; \
struct siginfo info; \
struct ucontext uc; \
} *rt_ = (CONTEXT)->cfa; \
sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext; \
this one is inside gcc/config/i386/linux.h but your arch may differ
And manually replace struct siginfo *
to siginfo_t *
and struct siginfo
to siginfo_t
, making it newest POSIX compatible. In every rt_sigframe declaration there is most common to be two such places, including your info
field of problem.
这篇关于在Ubuntu 14.04中编译GCC 3.4.6时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!