hoytech / vmtouch

Portable file system cache diagnostics and control

Home Page:https://hoytech.com/vmtouch/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ARM Support

LuPoMicron opened this issue · 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

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!