-
Notifications
You must be signed in to change notification settings - Fork 123
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
Library Forwarding: Make building on weak cross-compiling setups easier #3597
base: main
Are you sure you want to change the base?
Conversation
In the case where we have a working x86 cross compiler when building on arm64, and can procure a x86 rootfs but without the proper multilib integration, does X86_DEV_ROOTFS provide the necessary glue to build thunks without needing a separate machine/VM? If so, I think that sounds like a decent approach for Fedora. It would be great to get some documentation (either in-tree or contributed to wiki) about how to use these new options to build fex on such weak setups. |
It might work without a VM, but I haven't tested it. You'd have to add the dev rootfs paths to the CMake toolchain files in our project root so that the CMake targets in GuestLibs/CMakeLists.txt can also find the headers/libraries. Definitely interested to see someone try that out! |
afb9526
to
ba6c175
Compare
749cc9c
to
98d3de8
Compare
Realized we can achieve the same effect by using |
…elopment x86 rootfs
98d3de8
to
68b9bab
Compare
ExternalProject_Add(guest-libs | ||
PREFIX Guest/guest-libs | ||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/GuestLibs" | ||
BINARY_DIR "../Guest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something's off about this. I'm getting weird RPATH errors without ../
, but with ../
it's clearly putting the data in the wrong folder.
ARM64 Ubuntu provides both an x86 cross-compiler and corresponding glibc/stdlibc++ libraries, which makes cross-compiling FEX's guest library wrappers very easy. Sadly most other distributions only ship the compiler without any libraries/headers at all. In such environments, it can be easier to compile only the host-side libraries while offloading builds of the guest libraries to another machine / VM.
This PR adds two main features to make such fallback setups possible:
cmake ../ThunkLibs/CMakeLists.txt -DX86_32_TOOLCHAIN_FILE=`realpath ../toolchain_x86_32.cmake` -DX86_64_TOOLCHAIN_FILE=`realpath ../toolchain_x86_64.cmake` -DX86_DEV_ROOTFS=/
from a dedicated build folder.X86_DEV_ROOTFS
CMake setting can be used to provide a development x86 rootfs, from which standard headers will be read. (Specifically, Ubuntu requires these packages:libstdc++-12-dev-amd64-cross libstdc++-12-dev-i386-cross libstdc++-12-dev libc6-dev-amd64-cross libc6-dev-i386-cross linux-libc-dev-amd64-cross linux-libc-dev-i386-cross
)