-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"./asm_offset: Exec format error" when building for arm64 #881
Comments
If export asm: -- The ASM compiler identification is GNU Building error is the same. |
looks the change is introduced by PR #731 . @esullivan-nvidia |
Is your buildsystem aarch64 too? If not you need to build a x86 asm_offset binary first & reuse it for the aarch64 build... |
Running into this within nixpkgs as well. This is what the cmake boot/manual recommends doing: https://cmake.org/cmake/help/book/mastering-cmake/chapter/Cross%20Compiling%20With%20CMake.html#running-executables-built-in-the-project Kinda makes me sad to have to deal with that, but I guess it's kinda inevitable since cmake doesn't support compiling for build and target system in one go. NixOS/nixpkgs#170366 (comment) Trying to cross-compile from x86_64 to aarch64. Gonna try setting |
This appears to be the same as #249 as the issue is that cross-compilation is not support supported due to asm_offset needing to be run. This is a bug, and I am working on a fix for cross compilation that is discussed further in the linked issue. |
Might be needed for all aarch64 until KhronosGroup/Vulkan-Loader#881 is fixed
* vulkan-loader: require xrandr when using x11 * vulkan-loader: USE_GAS=OFF for Odin Might be needed for all aarch64 until KhronosGroup/Vulkan-Loader#881 is fixed * mergerfs: downgrade to fix build * xf86-input-libinput: require xorg-server * Odin: WINDOWMANAGER 'none' -> 'no' * xorg-server: add patch for drmmode_display.c build error * Odin: delete a bunch of custom packages * mesa: couple of bits from v4.x
* vulkan-loader: require xrandr when using x11 * vulkan-loader: USE_GAS=OFF for Odin Might be needed for all aarch64 until KhronosGroup/Vulkan-Loader#881 is fixed * mergerfs: downgrade to fix build * xf86-input-libinput: require xorg-server * Odin: WINDOWMANAGER 'none' -> 'no' * xorg-server: add patch for drmmode_display.c build error * Odin: delete a bunch of custom packages * mesa: couple of bits from v4.x
I want to build loader for arm64,
set(CMAKE_SYSTEM_PROCESSOR "aarch64") in loader/CMakeList.txt
and export CC/CXX.
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
Then, build as the following command:
mkdir build
cd build
../scripts/update_deps.py
cmake -C helper.cmake ..
cmake --build .
Log for cmake -C:
-- Check for working C compiler: /tools/gcc_aarch64/4.9_2014.07/bin/aarch64-linux-gnu-gcc
-- Check for working CXX compiler: /tools/gcc_aarch64/4.9_2014.07/bin/aarch64-linux-gnu-gcc
-- The ASM compiler identification is GNU
-- Found assembler: /tools/gcc_aarch64/4.9_2014.07/bin/aarch64-linux-gnu-gcc
Error for build:
k01@a01-lin:~/work/source/Vulkan-Loader/build$ cmake --build .
Scanning dependencies of target asm_offset
[ 5%] Building C object loader/CMakeFiles/asm_offset.dir/asm_offset.c.o
[ 10%] Linking C executable asm_offset
[ 10%] Built target asm_offset
Scanning dependencies of target loader_asm_gen_files
[ 15%] Generating gen_defines.asm
/bin/sh: 1: ./asm_offset: Exec format error
loader/CMakeFiles/loader_asm_gen_files.dir/build.make:79: recipe for target 'loader/gen_defines.asm' failed
make[2]: *** [loader/gen_defines.asm] Error 2
CMakeFiles/Makefile2:171: recipe for target 'loader/CMakeFiles/loader_asm_gen_files.dir/all' failed
make[1]: *** [loader/CMakeFiles/loader_asm_gen_files.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2
The text was updated successfully, but these errors were encountered: