Compile:
g++ -std=c++11 -fPIC -fno-gnu-unique -MMD -MP -g -O3 -march=nehalem -funsafe-math-optimizations -fno-omit-frame-pointer -o purevirtual main.cpp -static-libstdc++ -static-libgcc
Try it on your x64 host? Segfault!
Remove the static linking? It catches pure virtual call!
Useful read? https://stackoverflow.com/a/14082540
Result on arm64:
box64 ./purevirtual
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL PageSize:4096
Box64 with Dynarec v0.1.9 1057b88 built on Jun 8 2022 02:27:46
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 36 Env var
Looking for ./purevirtual
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Error: PltResolver: Symbol __cxa_pure_virtual(ver 1: __cxa_pure_virtual) not found, cannot apply R_X86_64_JUMP_SLOT 0xffffa5234018 (0xffffa5231036) in /home/xox/purevirtual