错误: recipe for target 'unwind-dw2.o
(忘记复制详细错误了)简单说就是:在安装完gmp,mpfc,mpc后,再次make gcc4.9.2时出现了如上错误。
环境:现有的gcc版本是4.8.5
解决方法:
参考 https://blog.csdn.net/wang805447391/article/details/83380302,如下:
修改/build_dir/target-x86_64-glibc/gcc-5.4.0/x86_64-openwrt-linux-gnu/libgcc/md-unwind-support.h中的俩处:
Fix1:@line 61:
if (*(unsigned char *)(pc+0) == 0x48
&& *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
{
// struct ucontext *uc_ = context->cfa;
ucontext_t *uc_ = context->cfa;
/ The void * cast is necessary to avoid an aliasing warning.
The aliasing warning is correct, but should not be a problem
because it does not alias anything. */
sc = (struct sigcontext *) (void *) &uc_->uc_mcontext;
}
Fix2:@line144
{
struct rt_sigframe {
int sig;
siginfo_t *pinfo;
void *puc;
siginfo_t info;
// struct ucontext uc;
ucontext_t uc;
} *rt_ = context->cfa;
————————————————
版权声明:本文为CSDN博主「小学生414」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/wang805447391/article/details/83380302
后记:发现了一个更全的其他类似报错的解决方案如下
参考 https://www.cnblogs.com/yu121/p/12853419.html
附编译报错信息:
1. 报错:configure: error: in `/usr/local/src/gcc-5.4.0/build':
解决:缺少gcc需要先安装一个任意gcc版本
2. 报错:dereferencing pointer to incomplete type 'struct ucontext'
解决:将61行左右struct ucontext * uc_ = context->cfa
改成 struct ucontext_t * uc_ = context->cfa
3. 报错:/sanitizer_stoptheworld_linux_libcdep.cc:237:22:
error: aggregate 'sigaltstack handler_stack' has incomplete type and cannot be defined struct sigaltstack handler_stack;
解决:将/sanitizer_stoptheworld_linux_libcdep.cc中第237行
struct sigaltstack handler_stack;
修改为:stack_t handler_stack;
4. 报错:……// sanitizer_linux.h
解决:将第二行注释
struct link_map; // Opaque type returned by dlopen().
struct sigaltstack;
将 uptr internal_sigaltstack(const struct sigaltstack* ss, struct sigaltstack* oss);
修改为:uptr internal_sigaltstack(const void* ss, void* oss);
5. 报错:……// sanitizer_linux.cc
将uptr internal_sigaltstack(const struct sigaltstack *ss, struct sigaltstack *oss)
修改为:uptr internal_sigaltstack(const void *ss, void *oss)
6. 报错:……// sanitizer_stoptheworld_linux_libcdep.cc
将struct sigaltstack handler_stack;
修改为: stack_t handler_stack;
7. 报错:……//tsan_platform_linux.cc
将res_state *statp = (__res_state*)state;
修改为:struct __res_state *statp = (struct __res_state*)state;
8. 报错:……// asan_linux.cc
解决:在asan_linux.cc中添加头文件#include <signal.h>即可
9. 报错: error: invalid use of incomplete type ‘struct _Jv_catch_fpe(int, siginfo_t*, void*)::ucontext’ gregset_t &_gregs = _uc->uc_mcontext.gregs;
解决:(依葫芦画瓢了。。)x86_64-signal.h文件中修改如下:
struct ucontext *_uc = (struct ucontext *)_p; \ (这一句建议删除掉,加了注释符号之后报错)
改为
struct ucontext_t * _uc = (struct ucontext_t *)_p; \