日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

‘__NR_sigreturn’ was not declared in this scope

發布時間:2023/12/20 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ‘__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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。