Skip to content

Question about workflow using cross compilation #452

@Scarlet1ssimo

Description

@Scarlet1ssimo

Check List

  • The binary I am trying to run has been compiled statically for either RV64 or AArch64.
  • The compiled binary is a Linux Elf file.
  • I have provided both a config file and a binary to SimEng as runtime arguments.

Binary File Information
Please run file on the binary used and paste the output below (i.e. file myBinary.elf).

~ file test.out
test.out: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=93985e2691fb50b5a4cbbcb448e553aa65b7f9d7, for GNU/Linux 3.7.0, not stripped

System Description
Please provide the following as a list:

  • The Operating System of the system you are running SimEng on: Ubuntu 24.04
  • The compiler used to compile SimEng and its version: clang 18
  • The compiler used to compile the static binary and its version: aarch64-linux-gnu-g++ 13.3.0
  • The ISA or specific processor that the binary was compiled for: armv8.4-a+sve
  • The processor of the system you are running SimEng on: intel i9 14900k
  • The main memory capacity of the system you are running SimEng on: 64G

SimEng Version
Provide the SimEng repository branch, commit hash, and version tag (if relevant) that the issue is present on.

branch: dev 84f4c7f

SimEng CMAKE Options Used

cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_LINKER=lld -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B build -S . -DCMAKE_BUILD_TYPE=Release -GNinja -DCMAKE_INSTALL_PREFIX=./simeng-install -DSIMENG_ENABLE_TESTS=ON

Binary Compilation Instructions
Provide a bullet list of how the binary in question was compiled, including all compiler flags used.

~ cat test.cpp
int main() { return 0; }
~ aarch64-linux-gnu-g++ -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc-cross/aarch64-linux-gnu/13/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ......
Supported LTO compression algorithms: zlib zstd
gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04)
~ aarch64-linux-gnu-g++ test.cpp -o test.out -static -march=armv8.4-a+sve -mbranch-protection=none

SimEng Command Line Expression
Provide the command line expression used to run SimEng e.g. ./simeng /path/to/configs/a64fx.yaml /path/to/myBinary.elf

simeng ~/SimEng/configs/a64fx_SME.yaml test.out

SimEng Metadata Output
If your simulation begins to execute the binary, please provide the metadata that SimEng prints at the start of execution.
E.g.

[SimEng] Build metadata:
[SimEng]        Version: 0.9.6
[SimEng]        Compile Time - Date: 00:45:08 - Jan 16 2025
[SimEng]        Build type: Release
[SimEng]        Compile options: $<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>;-Wall;-pedantic;-Werror
[SimEng]        Test suite: ON

[SimEng] Running in Out-of-Order mode
[SimEng] Workload: test.out
[SimEng] Config file: /home/scarlet/SimEng/configs/a64fx_SME.yaml
[SimEng] ISA: AArch64
[SimEng] Auto-generated Special File directory: True
[SimEng] Special File directory used: /home/scarlet/SimEng/build/specialFiles/
[SimEng] Number of Cores: 1
[SimEng] Starting...


[SimEng:ExceptionHandler] Encountered execution not-yet-implemented exception
[SimEng:ExceptionHandler]   Generated by instruction:
[SimEng:ExceptionHandler]     0x0000000000400600: 3f 23 03 d5     paciasp 
[SimEng:ExceptionHandler]       opcode ID: 3783
[SimEng:Core] Halting due to fatal exception

Problem Description
I was trying to use SimEng to simulate aarch64 binaries produced by aarch64-linux-gnu-g++, but didn't get it to work. It keeps generating paciasp which is not supported. I'd like to know if it was my compilation skill issue or I just can't do it in this way? What's the right way to get it right?

BTW, according to this page, do I have to get the 10.3.0 version of aarch64-linux-gnu-g++?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ToDo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions