NyaMisty / AltServer-Linux

AltServer for AltStore, but on-device
GNU Affero General Public License v3.0
951 stars 73 forks source link

Code will not compile/link on ARM (SOLUTION) #8

Closed DragonOfSpace closed 2 years ago

DragonOfSpace commented 2 years ago

The code would not compile on an ARM32 CPU (armv7l). GCC didn't know how to process the flag -mno-default as it is specific to x86-based platforms.

Additionally, the linker (LD) could not find certain filesystem-related functions, specifically std::experimental::filesystem and others.

SOLUTION:

  1. Remove -mno-default from the CFLAGS section of the MAKEFILE (line 18). The code compiles and links fine without it on ARM32 CPUs (tested with Raspberry Pi 2B, Raspbian 5.10.60). Line 18 should look like: CFLAGS := -DHAVE_CONFIG_H -DDEBUG -O0 -g

  2. Add -lstdc++fs to the LDFLAGS (line 85) and move -lpthread to the end. So Line 85 should look like: LDFLAGS = libraries/AltSign/AltSign.a -static -lssl -lcrypto -lcorecrypto_static -lzip -lm -lz -lcpprest -lboost_system -lboost_filesystem -lstdc++ -lssl -lcrypto -luuid -ldl -lstdc++fs -lpthread

Following these two changes to the MAKEFILE, I was successfully able to compile AltServer-Linux on a Raspberry Pi 2B running Raspbian 5.10.60 Lite. After installing libimobiledevice-dev and libimobiledevice-utils the binary was fully functional and AltStore on the phone was able to communicate with it over USB just like on a Windows PC.

Bradovman commented 2 years ago

I've been trying to get Alt-Server compiling on a Raspberry pi 2 for days now and i can't figure it out. It just exits randomly half way through compiling. I have followed what you have written but it still doesn't seem to work work. Would you be kind enough to publish the binary if you still have it or give greater info on how exactly you got it to compile correctly? Thanks.