3dstool icon indicating copy to clipboard operation
3dstool copied to clipboard

Cross compile target for ARM & maybe provide binaries

Open schrmh opened this issue 3 years ago • 4 comments

I would like this to be usable on Android devices in Termux (at least on armv7l and aarch64) and for that I would like to cross compile it on my x86_64 system running Arch Linux.

Would also be nice if binaries for ARM could be added (then I would not even need to compile it, but it would still be nice to have the option)

schrmh avatar Feb 21 '23 18:02 schrmh

I tried the same, but after installing all the dependencies, I can compile everything, but I cannot link it.

Le0X8 avatar Dec 17 '23 17:12 Le0X8

@Le0X8 At least you can finish the process by using Termux on Android (or well, any kind of terminal on a mobile Linux distribution but that's still a niche). You just need to remove -static-libstdc++ from 3dstool/build/src/CMakeFiles/3dstool.dir/link.txt.

Binaries for ARMv8 based devices running Android (and other things using bionic) and postmarketOS (and other things using musl): 3dstool_aarch64.tar.gz

schrmh avatar Dec 17 '23 20:12 schrmh

if someone can remove the dep folder completely i can add it to termux-packages

both Ubuntu arm and termux has capstone i don't understand why add two gig of deps because windows

it almost built out if the box except a linker error that i could not fix

should be easy unless all functions were renamed in version 4

here is the Ubuntu arm build that i ran from my phone

i updated the command to use clang to mimick the native termux environment that doesn't have gcc

gcloud compute instances create ua --image-project ubuntu-os-cloud --image-family ubuntu-minimal-2310-arm64 --machine-type t2a-standard-1 --zone europe-west4-a --provisioning-model spot  --scopes https://www.googleapis.com/auth/devstorage.full_control  

sudo apt update

sudo apt install -y git clang cmake libssl-dev libcurl4-openssl-dev libcapstone-dev

git clone --depth 1 https://github.com/dnasdw/3dstool

sed -i 's:capstone.h:capstone/capstone.h:' src/code.h

sed -i 's/-m64//' CMakeLists.txt

mv dep ..

mkdir build
cd build
cmake -DUSE_DEP=OFF ..
make

/usr/bin/ld: code.cpp:(.text+0x23b8): undefined reference to `cs_free'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

john-peterson avatar May 05 '24 20:05 john-peterson

related command that might help anyone reading this thread

this will work directly in termux without any patches

git clone https://github.com/3DSGuy/Project_CTR

make

cp ctrtool/bin/ctrtool  ~/bin

ctrtool kart.app |less

the entire cxi header

john-peterson avatar May 05 '24 21:05 john-peterson