-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
[REQ INFO] How to cross-compile SHC to arm/arm64 ? #33
Comments
UPDATE: When I transfered the compiled shc to my phone, I do indeed can exec shc, but for some-reason, I can't compile THE SAME script I managed to compile on my pc. maybe gcc is missing on my android phone ? EDIT:
|
On your android phone, you need both gcc and the shell that will be executing the script, installed. |
Hello @neurobin
I tried for hours now, to compile SHC for arm & arm64, but without success.
so far, I only managed to SUCCESFULLY compile SHC for i386 ( see my below method ), then to use it, to create compiled bash-based binaries as arm/arm64 compatible.
This is only HALF the solution, since I need a PC for the bash->bin convertion.
( I wish to use SHC on phones ).
Can you please direct me on how to compile SHC for arm/arm 64 ?
P.S - for the internet record....
Thanks to a post by @Thiago Zilli Sarmento I managed to compile my bash script to arm & arm64 ( for android ) !!!! :-)
few notes:
for some reason, not "gcc-arm-linux-gnueabihf-gcc" nor
"gcc-arm-linux-gnueabihf-gcc-6" was willing to compile at all - only
when I used "gcc-arm-linux-gnueabihf-gcc-4.9" -> it worked (for arm)
'make' didn't work till I installed 'automake'
I too get wierd output when I compiled of:
"strip: Unable to recognise the format of the input file `SCRIPT_NAME'
shc: never mind"
just ignor it... no harm exist, AFAIK.
NEXT IMPORTANT STEP: what's left is to understand how to cross-compile SHC itself to arm/arm64 so that itself can run on these arch types.
here are the nessesary steps on lubuntu 16.04 i368 ( i.e x32 ):
aptitude install crossbuild-essential-armhf crossbuild-essential-arm64 automake gcc-4.9-arm-linux-gnueabihf
git clone https://github.com/neurobin...
cd shc
./configure --prefix=$prefix
make clean
make
** to compile script to ARM, run:
CC="arm-linux-gnueabihf-gcc-4.9" CFLAGS="-march=armv7-a -static" ./src/shc -r -f SCRIPT_NAME
mv SCRIPT_NAME.x SCRIPT_ARM
** to compile script to ARM64 (AARCH64), run:
CC="aarch64-linux-gnu-gcc" CFLAGS="-march=armv8-a -static" ./src/shc -r -f SCRIPT_NAME
mv SCRIPT_NAME.x SCRIPT_AARCH64
The text was updated successfully, but these errors were encountered: