Skip to content
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

Box64 Cross-compiling: Can I specify where the library files are going? #1993

Open
SoftwareGuy opened this issue Nov 2, 2024 · 4 comments
Open

Comments

@SoftwareGuy
Copy link

SoftwareGuy commented Nov 2, 2024

I'm trying to do some cross-compiles on my devices to target specific ARM64 devices, and I'm having difficulty getting the libraries that Box64 compiles to go into a specific folder. The following is my command line (note the slashes are just to escape the newline):

cmake -D CMAKE_C_COMPILER=aarch64-linux-gnu-gcc -D CMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \ 
-D CMAKE_INSTALL_PREFIX=$(pwd)/box64-rpi -D ARM_DYNAREC=ON -D CMAKE_BUILD_TYPE=RelWithDebInfo \ 
-D RPI3ARM64=1

I'll break it down step by step:

  • I'm using a x64 host, so I'm using a cross compiler toolchain.
  • I want the compiled files to be placed in the CMAKE_INSTALL_PREFIX path, which evaluates to /workdir/box64-rpi.
  • I'm building a release binary with debug info.
  • I'm wanting to use the R-Pi 3 enhancements where possible.

However, with this I find that the box64 binary is copied into /workdir/box64-rpi/bin but other stuff gets placed in /etc and /usr/lib. I want it to be placed in /workdir/box64-rpi/etc and /workdir/box64-rpi/usr/lib.

What am I doing wrong?

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 2, 2024

that's probably issues with the cmake project. I need to check that out.

@SoftwareGuy
Copy link
Author

If it helps, I think CMake gives a hint that when I specify other GNUInstallDir parameters (ie CMAKE_INSTALL_LIBDIR) that they aren't used by the project.

@theofficialgman
Copy link
Contributor

the install paths for some files are currently hardcoded
eg:

box64/CMakeLists.txt

Lines 1156 to 1161 in 2d04cbe

install(FILES ${CMAKE_BINARY_DIR}/system/box64.conf DESTINATION /etc/binfmt.d/)
install(FILES ${CMAKE_SOURCE_DIR}/system/box64.box64rc DESTINATION /etc/)
if(BOX32_BINFMT)
configure_file(system/box32.conf.cmake system/box32.conf)
install(FILES ${CMAKE_BINARY_DIR}/system/box32.conf DESTINATION /etc/binfmt.d/)
endif()

@theofficialgman
Copy link
Contributor

theofficialgman commented Nov 24, 2024

* I'm using a x64 host, so I'm using a cross compiler toolchain.

it actually shouldn't be possible to install (make install) the binaries and config files on x64 host at all unless you are patching out the x86/x64 check

if(NOT _x86 AND NOT _x86_64)
like sed -i "s/NOT _x86 AND NOT _x86_64/true/g" ../CMakeLists.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants