Skip to content

Instantly share code, notes, and snippets.

View coder-ghw's full-sized avatar
🎨
Focusing

guohw coder-ghw

🎨
Focusing
View GitHub Profile
@alepez
alepez / run-linux-arm-executable-inside-docker-on-x86-host.md
Created January 19, 2022 09:37
Run Linux ARM executable inside Docker on x86 host

Say that you have compiled an executable for a Linux ARM system and you want to test it inside a Linux x86 system. Docker is able to use qemu to enable execution of different multi-architecture containers.

Execute the register script that registers binfmt_misc handlers for all supported processors except the current one in it when running the container.

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
@madebr
madebr / CMakeLists.txt
Last active August 19, 2023 20:10
Simple CTest coverage project + script
cmake_minimum_required(VERSION 3.9)
project(cmake_coverage)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.c" "int main() {return 0;}")
add_executable(main
main.c
)
target_compile_options(main