box86 icon indicating copy to clipboard operation
box86 copied to clipboard

failed on static linking

Open rhjdvsgsgks opened this issue 2 years ago • 1 comments

hi. im trying to link box86 statically so that i can use it in a chroot and replace qemu. i add a -DCMAKE_EXE_LINKER_FLAGS=-static to cmake. on linking stage it got l lot "undefined reference to xx". is that expected behavior?

rhjdvsgsgks avatar Feb 21 '23 11:02 rhjdvsgsgks

Box86 is not really compatible with static linking. It needs the full libc functions to wrapped to calls, and static linking tend to removed unused functions. Try to use "whole-archive" maybe? But there is no guaranties that even if it links, that box86 will be fonctionnal built like that.

ptitSeb avatar Feb 21 '23 11:02 ptitSeb