ray-eldath@Ray-Eldath:/var/judger$ make
mkdir -p target/cpp
g++ -c -std=c++11 -Wall -fPIC -I "/etc/jdk1.8.0_131/include" -I "/etc/jdk1.8.0_131/include/linux" src/main/cpp/unix/Judger.Core.Runner.cpp -o target/cpp/Judger.Core.Runner.o
src/main/cpp/unix/Judger.Core.Runner.cpp: In function ‘int runProcess(pid_t, sigset_t, const string&, int, int, int&, int&)’:
src/main/cpp/unix/Judger.Core.Runner.cpp:220:24: error: ‘PTRACE_GETREGS’ was not declared in this scope
ptrace(PTRACE_GETREGS, pid, NULL, ®s);
^
src/main/cpp/unix/Judger.Core.Runner.cpp:34:22: error: ‘struct user_regs_struct’ has no member named ‘orig_rax’
#define REG(reg) reg.orig_rax
^
src/main/cpp/unix/Judger.Core.Runner.cpp:221:22: note: in expansion of macro ‘REG’
if ( REG(regs) >= 0 && REG(regs) <= 328 &&
^
src/main/cpp/unix/Judger.Core.Runner.cpp:34:22: error: ‘struct user_regs_struct’ has no member named ‘orig_rax’
#define REG(reg) reg.orig_rax
^
src/main/cpp/unix/Judger.Core.Runner.cpp:221:40: note: in expansion of macro ‘REG’
if ( REG(regs) >= 0 && REG(regs) <= 328 &&
^
src/main/cpp/unix/Judger.Core.Runner.cpp:34:22: error: ‘struct user_regs_struct’ has no member named ‘orig_rax’
#define REG(reg) reg.orig_rax
^
src/main/cpp/unix/Judger.Core.Runner.cpp:222:43: note: in expansion of macro ‘REG’
!isAllowedSystemCalls(REG(regs)) ) {
^
src/main/cpp/unix/Judger.Core.Runner.cpp:34:22: error: ‘struct user_regs_struct’ has no member named ‘orig_rax’
#define REG(reg) reg.orig_rax
^
src/main/cpp/unix/Judger.Core.Runner.cpp:223:60: note: in expansion of macro ‘REG’
std::cout << "[DEBUG] System call " << REG(regs) << " is detected." << std::endl;
^
Makefile:30: recipe for target 'target/cpp/Judger.Core.Runner.o' failed
make: *** [target/cpp/Judger.Core.Runner.o] Error 1
错误信息:
如何解决? 另外,以下是
gcc -v
的返回: