‘__NR_sigreturn’ was not declared in this scope
生活随笔
收集整理的這篇文章主要介紹了
‘__NR_sigreturn’ was not declared in this scope
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
安裝交叉編譯器gdbserver 按readme來編譯報錯找不到
linux-arm-low.c: In function ‘CORE_ADDR arm_sigreturn_next_pc(regcache*, int, int*)’: linux-arm-low.c:769:29: error: ‘__NR_sigreturn’ was not declared in this scopegdb_assert (svc_number == __NR_sigreturn || svc_number == __NR_rt_sigreturn);^ ./../common/gdb_assert.h:34:13: note: in definition of macro ‘gdb_assert’((void) ((expr) ? 0 : \^ linux-arm-low.c: In function ‘CORE_ADDR get_next_pcs_syscall_next_pc(arm_get_next_pcs*)’: linux-arm-low.c:823:21: error: ‘__NR_sigreturn’ was not declared in this scopeif (svc_number == __NR_sigreturn || svc_number == __NR_rt_sigreturn)^ make: *** [linux-arm-low.o] 錯誤 1按博客方法處理https://www.codenong.com/cs106254960/
//在這個linux-arm-low.c文件添加文件包含 #ifndef __NR_sigreturn #include <asm/unistd.h> #endif繼續編譯又引入新的問題,新問題參考博客https://www.programmersought.com/article/98671620102/
/usr/bin/ld: build-gnulib-gdbserver/import/libgnu.a(fcntl.o): Normal ELF relocation (M: 40) /usr/bin/ld: build-gnulib-gdbserver/import/libgnu.a(fcntl.o): Normal ELF relocation (M: 40) /usr/bin/ld: build-gnulib-gdbserver/import/libgnu.a(fcntl.o): Normal ELF relocation (M: 40) /usr/bin/ld: build-gnulib-gdbserver/import/libgnu.a(fcntl.o): Normal ELF relocation (M: 40) /usr/bin/ld: build-gnulib-gdbserver/import/libgnu.a(fcntl.o): Normal ELF relocation (M: 40) build-gnulib-gdbserver/import/libgnu.a: Unable to add symbol: File format error collect2: error: ld returned 1 exit status Makefile:399: recipe for target ‘gdbserver’ failed make: *** [gdbserver] Error 1查閱了會,鏈接工具不一致,迎著頭皮看了遍make輸出信息,截取部分輸出
make[4]: Entering directory '/home/lala0903/linux/tool/gdb-9.1/gdb/gdbserver/build-gnulib-gdbserver/import'GEN alloca.hGEN configmake.hGEN warn-on-use.hmake all-recursive make[5]: Entering directory '/home/lala0903/linux/tool/gdb-9.1/gdb/gdbserver/build-gnulib-gdbserver/import'CC cloexec.oCC dirname-lgpl.oCC stripslash.oGEN ref-add.sedGEN ref-del.sedAR libgnu.aarm-linux-gnueabihf-ranlib ./libiberty.a; \cd ..; \ else true; fi make[2]: Leaving directory '/home/lala0903/linux/tool/gdb-9.1/gdb/gdbserver/build-libiberty-gdbserver' make[1]: Leaving directory '/home/lala0903/linux/tool/gdb-9.1/gdb/gdbserver'CXX alloc.oCXX arch/arm-linux.oCXX gdbsupport/agent.oCXX gdbsupport/btrace-common.o從上面看出有CC 和CXX,感覺奇怪應該是不止gcc還有g++,于是查看了下makefile
CC = arm-linux-gnueabihf-gcc CXX = g++ CXX_DIALECT = -std=gnu++11 AR = arm-linux-gnueabihf-ar AR_FLAGS = rc不知道為什么配置出來的make中g++ 竟然不是交叉編譯工具,本地沒裝arm g++,裝了一個修改makefile解決問題,不知道是否是不存在g++交叉編譯工具導致的config配置問題,需要實驗一下
總結
以上是生活随笔為你收集整理的‘__NR_sigreturn’ was not declared in this scope的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 怎样删除数组中重复元素
- 下一篇: 信创产业国产CPU产业研究报告