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

Cross compile target for ARM & maybe provide binaries #28

Open
schrmh opened this issue Feb 21, 2023 · 4 comments
Open

Cross compile target for ARM & maybe provide binaries #28

schrmh opened this issue Feb 21, 2023 · 4 comments

Comments

@schrmh
Copy link

schrmh commented Feb 21, 2023

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)

@Le0X8
Copy link

Le0X8 commented Dec 17, 2023

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

@schrmh
Copy link
Author

schrmh commented Dec 17, 2023

@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

@john-peterson
Copy link

john-peterson commented May 5, 2024

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
Copy link

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

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