DynamoRIO / DynamoRIO/drmemory

Build issues on an AArch32 userspace when running an AArch64 kernel

Open
#2,017 1 comment 0 reactions 0 assignees View on GitHub
Component-Build help wanted OpSys-AArch64 OpSys-ARM
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

Trying to build on a system running Linux 3.18.0 (AArch64) in an AArch32 chroot (Arch Linux ARM, gcc 6.3.1, cmake 3.7.2). The first error I get is:

```
[ 11%] Building ASM object dynamorio/core/CMakeFiles/drhelper.dir/arch/asm_shared.asm.o
In file included from /home/cosmin/drmemory/dynamorio/core/arch/asm_shared.asm:37:0:
/home/cosmin/drmemory/dynamorio/core/arch/asm_defines.asm:65:3: error: #error ARM is only 32-bit; AARCH64 is 64-bit
# error ARM is only 32-bit; AARCH64 is 64-bit
^~~~~
```

I guessed that the architecture reported by the kernel is used at some point in the build process, so I've then enabled the PER_LINUX32 personality by prepending `linux32` to the `cmake` and `make` commands (on a clean build). This changes the output of `uname`, `/proc/cpuinfo`, etc to be compatible with that on AArch32 kernels. The build then completed.

DynamoRIO `266b8a3c8b` on its own also fails to build without PER_LINUX32, but with a different error, so I think both the DR and Dr. Memory build systems misbehave.

```
[ 8%] Building CXX object clients/drcachesim/CMakeFiles/drcachesim_ops.dir/common/options.cpp.o
c++: error: unrecognized command line option '-mpreferred-stack-boundary=2'; did you mean '-mstructure-size-boundary='?
```

I've generally found the output of `$(CC) -dumpmachine` to be a more robust way of detecting the target architecture, but I'm not sure how well that would work with your build system.

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.