vmtouch icon indicating copy to clipboard operation
vmtouch copied to clipboard

ARM Support

Open LuPoMicron opened this issue 8 years ago • 1 comments

Hi,

It would be very easy to add also ARM support to your Makefile. I tested with the following changes and it works on Android.

Cheers, Luca

diff --git a/Makefile b/Makefile
index 535138b..61aebd8 100644
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,17 @@ PREFIX?=       /usr/local
 BINDIR?=       $(PREFIX)/bin
 MANDIR?=       $(PREFIX)/share/man/man8

-CC?=           cc
-CFLAGS+=       -Wall -O2 -g -std=c99
+ARCH := arm
+
+#Compilers
+ifeq ($(ARCH),x86)
+    CC := cc
+    CFLAGS += -Wall -O2 -g -std=c99
+else
+    CC := arm-linux-gnueabi-gcc
+    CFLAGS += -Wall -O2 -std=c99 -fomit-frame-pointer -D__USE_STRING_INLINES -pipe -static -s
+endif
+

 all: vmtouch vmtouch.8

LuPoMicron avatar Apr 21 '17 07:04 LuPoMicron

Thanks very much! I tested it once on an ARM but I didn't document the compiler flags I used.

Since ARM targets are so varied, I'd prefer to not clutter up the Makefile with arch-specific settings. Can you please:

  • Paste in a make command that works for your system? I'm guessing from your patch it would be something like so:

      make CC=arm-linux-gnueabi-gcc CFLAGS='-Wall -O2 -std=c99 -fomit-frame-pointer -D__USE_STRING_INLINES -pipe -static -s'
      
  • Some specifics about your target, and any insights into why these compiler options were required. Just whatever info you have on-hand and don't mind revealing is fine -- it might be useful to people porting to other systems.

I'll add your information to the PORTABILITY section in the docs (or possibly make a new PORTING.md file in the repo).

Thanks!

hoytech avatar Apr 21 '17 12:04 hoytech