google / google/kernel-research

Compilation failure on arm64

Open
#166 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
90
Forks
15
PR merge metrics
No merged PRs in 30d

Description

```console
$ uname -m
aarch64
$ cd ~/kernel-research/libxdk
$ ~/kernel-research/libxdk ./build.sh
+ cmake -B build
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/jvoisin/dev/kernel-research/libxdk/build
+ cmake --build build --target kernelXDKTests
[ 3%] Building CXX object CMakeFiles/kernelXDK.dir/rip/RopUtils.cpp.o
/home/jvoisin/dev/kernel-research/libxdk/rip/RopUtils.cpp: In function ‘void segfault_handler(int, siginfo_t*, void*)’:
/home/jvoisin/dev/kernel-research/libxdk/rip/RopUtils.cpp:44:58: error: ‘struct mcontext_t’ has no member named ‘gregs’; did you mean ‘regs’?
44 | void *rip = reinterpret_cast(uc->uc_mcontext.gregs[REG_RIP]);
| ^~~~~
| regs
/home/jvoisin/dev/kernel-research/libxdk/rip/RopUtils.cpp:44:64: error: ‘REG_RIP’ was not declared in this scope
44 | void *rip = reinterpret_cast(uc->uc_mcontext.gregs[REG_RIP]);
| ^~~~~~~
/home/jvoisin/dev/kernel-research/libxdk/rip/RopUtils.cpp:46:13: warning: ISO C++ forbids comparison between pointer of type ‘void *’ and pointer-to-function [-Wpedantic]
46 | if (rip == g_after_lpe_func_addr) {
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
gmake[3]: *** [CMakeFiles/kernelXDK.dir/build.make:93: CMakeFiles/kernelXDK.dir/rip/RopUtils.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:109: CMakeFiles/kernelXDK.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:148: test/CMakeFiles/kernelXDKTests.dir/rule] Error 2
gmake: *** [Makefile:192: kernelXDKTests] Error 2
$
```

Seems like x86 assumptions are hardcoded but [undocumented](https://xdk.dev/search.html?q=x86&check_keywords=yes&area=default).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.