newlisp and openwrt
Posted: Fri Nov 09, 2012 8:51 am
As the title
I am porting newlisp to openwrt.
My device is TP-LINK TL_WR703N
MIPS with linux kernel 3.3.8
I cloned openwrt svn trunk, builded toolchain and SDK
My problem is ,Is there a way to reduce the size of newlisp binary file ?
As far as now, it is 284k, But my device only left 502kb
I found out that lua is about 150kb
Anyone can help me a little?
And, I also cut the readline library to save space, Is this ok for the newlisp's performence?
Thanks
I am porting newlisp to openwrt.
My device is TP-LINK TL_WR703N
MIPS with linux kernel 3.3.8
I cloned openwrt svn trunk, builded toolchain and SDK
My problem is ,Is there a way to reduce the size of newlisp binary file ?
As far as now, it is 284k, But my device only left 502kb
I found out that lua is about 150kb
Anyone can help me a little?
Code: Select all
OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o \
nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o
CFLAGS = -Wall -ffunction-sections -fdata-sections -c -Os -DLINUX -I$(TARGET_DIR)/usr/include/
LDFLAGS = -L$(TARGET_DIR)/usr/lib/ -W1,--gc-sections -lm -ldl
CC = mips-openwrt-linux-gcc
LD = mips-openwrt-linux-ld
default: $(OBJS)
$(CC) $(OBJS) -o newlisp $(LDFLAGS) #for openwrt
# $(CC) $(OBJS) -g -lm -ldl -lreadline -ltermcap -o newlisp # slackware
# $(CC) $(OBJS) -g -lm -ldl -lreadline -lncurses -o newlisp # other Linux Dist
# $(CC) $(OBJS) -g -lm -ldl -o newlisp # without readline support
$(STRIP) newlisp
.c.o:
$(CC) $(CFLAGS) $<
$(OBJS): primes.h protos.h makefile_linux_openwrt
Thanks