Compiling

在 alpine linux 上安裝radare2時出錯

  • September 19, 2019

我正在執行一個 alpine linux 機器,並且正在嘗試安裝radare2。我下載了 git repo,然後執行 install.sh 腳本。它似乎執行良好,直到遇到錯誤:

In file included from p/native/linux/linux_debug.c:6:
/home/nomad/GitRepos/radare2/libr/include/r_debug.h:609:115: note: expected 'r_ptrace_data_t' {aka 'int'} but argument is of type 'void *'
static inline long r_debug_ptrace(RDebug *dbg, r_ptrace_request_t request, pid_t pid, void *addr, r_ptrace_data_t data) {
                                                                                                  ~~~~~~~~~~~~~~~~^~~~
CC linux_coredump.c
p/native/linux/linux_coredump.c:10:10: fatal error: asm/ptrace.h: No such file or directory
#include <asm/ptrace.h>
         ^~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [/home/nomad/GitRepos/radare2/libr/../global.mk:36: p/native/linux/linux_coredump.o] Error 1
make[3]: *** [Makefile:13: foo] Error 2
make[2]: *** [Makefile:157: debug] Error 2
make[1]: *** [Makefile:28: all] Error 2
make: *** [Makefile:61: all] Error 2

我在網上瀏覽了一下,但找不到與“錯誤 2”相關的內容。從錯誤看來我缺少一個庫,但我不確定它是什麼庫,或者如何安裝它,因為我對 alpine linux 還比較陌生。

在 Alpine Linux 上,asm/ptrace.h標頭由linux-headers包提供。

要安裝 Linux 標頭檔包,請執行以下命令:

apk add linux-headers

然後,嘗試重複安裝過程。

引用自:https://unix.stackexchange.com/questions/542328