Skip to content

Instantly share code, notes, and snippets.

Created November 24, 2017 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ee42707c5cd448e4c6acc6ead52601aa to your computer and use it in GitHub Desktop.
Save anonymous/ee42707c5cd448e4c6acc6ead52601aa to your computer and use it in GitHub Desktop.
Compiling 32/64-bit PicoLisp on arm64
rock64@rock64:~/Desktop/picoLisp/src$ make
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -D_OS='"Linux"' main.c
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -D_OS='"Linux"' gc.c
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -D_OS='"Linux"' apply.c
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -D_OS='"Linux"' flow.c
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -D_OS='"Linux"' sym.c
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -D_OS='"Linux"' subr.c
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -D_OS='"Linux"' big.c
In file included from big.c:5:0:
big.c: In function ‘boxWord2’:
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:207:35: note: in definition of macro ‘Push’
#define Push(c,x) (data(c)=(x), Save(c))
^
pico.h:161:25: note: in expansion of macro ‘num’
#define hi(w) num((w)>>BITS)
^
big.c:23:13: note: in expansion of macro ‘hi’
Push(c1, hi(t)? consNum(num(t), box(hi(t))) : box(num(t)));
^
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:207:35: note: in definition of macro ‘Push’
#define Push(c,x) (data(c)=(x), Save(c))
^
big.c:23:36: note: in expansion of macro ‘box’
Push(c1, hi(t)? consNum(num(t), box(hi(t))) : box(num(t)));
^
pico.h:161:25: note: in expansion of macro ‘num’
#define hi(w) num((w)>>BITS)
^
big.c:23:40: note: in expansion of macro ‘hi’
Push(c1, hi(t)? consNum(num(t), box(hi(t))) : box(num(t)));
^
big.c: In function ‘digMul2’:
big.c:8:19: warning: left shift count >= width of type [-Wshift-count-overflow]
#define OVFL ((1<<BITS-1)) // Carry/Overflow 0x8000....
^
big.c:64:50: note: in expansion of macro ‘OVFL’
n = unDig(x), setDig(x, n + n), carry = n & OVFL;
^
big.c:8:19: warning: left shift count >= width of type [-Wshift-count-overflow]
#define OVFL ((1<<BITS-1)) // Carry/Overflow 0x8000....
^
big.c:68:19: note: in expansion of macro ‘OVFL’
carry = n & OVFL;
^
In file included from big.c:5:0:
big.c: In function ‘digDiv2’:
big.c:8:19: warning: left shift count >= width of type [-Wshift-count-overflow]
#define OVFL ((1<<BITS-1)) // Carry/Overflow 0x8000....
^
pico.h:156:48: note: in definition of macro ‘setDig’
#define setDig(x,v) (car(numCell(x))=(any)(v))
^
big.c:82:31: note: in expansion of macro ‘OVFL’
setDig(y, unDig(y) | OVFL);
^
big.c: In function ‘bigMul’:
big.c:8:19: warning: left shift count >= width of type [-Wshift-count-overflow]
#define OVFL ((1<<BITS-1)) // Carry/Overflow 0x8000....
^
big.c:220:15: note: in expansion of macro ‘OVFL’
n |= OVFL;
^
In file included from big.c:5:0:
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:151:33: note: in definition of macro ‘num’
#define num(x) ((word)(x))
^
big.c:222:60: note: in expansion of macro ‘hi’
carry = (lo(t) > num(setDig(y, unDig(y) + lo(t)))) + hi(t);
^
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:151:33: note: in definition of macro ‘num’
#define num(x) ((word)(x))
^
big.c:231:19: note: in expansion of macro ‘hi’
carry += hi(t);
^
big.c: In function ‘digMul’:
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:151:33: note: in definition of macro ‘num’
#define num(x) ((word)(x))
^
big.c:253:11: note: in expansion of macro ‘hi’
t = hi(t);
^
big.c: In function ‘bigDiv’:
big.c:8:19: warning: left shift count >= width of type [-Wshift-count-overflow]
#define OVFL ((1<<BITS-1)) // Carry/Overflow 0x8000....
^
big.c:323:29: note: in expansion of macro ‘OVFL’
for (d = 0; (unDig(x) & OVFL) == 0; ++d)
^
big.c:337:22: warning: left shift count >= width of type [-Wshift-count-overflow]
t = ((word2)u1 << BITS) + u2; // Calculate q
^
big.c:340:45: warning: left shift count >= width of type [-Wshift-count-overflow]
while (r <= MAX && (word2)q*v2 > (r << BITS) + u3)
^
In file included from big.c:5:0:
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:151:33: note: in definition of macro ‘num’
#define num(x) ((word)(x))
^
big.c:345:67: note: in expansion of macro ‘hi’
borrow = (MAX - lo(t) < num(setDig(z, unDig(z) - lo(t)))) + hi(t);
^
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:151:33: note: in definition of macro ‘num’
#define num(x) ((word)(x))
^
big.c:352:20: note: in expansion of macro ‘hi’
borrow += hi(t);
^
big.c: In function ‘doSeed’:
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:154:34: note: in definition of macro ‘box’
#define box(n) (consNum(n,Nil))
^
pico.h:161:25: note: in expansion of macro ‘num’
#define hi(w) num((w)>>BITS)
^
big.c:1201:15: note: in expansion of macro ‘hi’
return box(hi(Seed = initSeed(EVAL(cadr(ex))) * 6364136223846793005LL));
^
big.c: In function ‘doRand’:
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:154:34: note: in definition of macro ‘box’
#define box(n) (consNum(n,Nil))
^
pico.h:161:25: note: in expansion of macro ‘num’
#define hi(w) num((w)>>BITS)
^
big.c:1226:18: note: in expansion of macro ‘hi’
return box(hi(Seed));
^
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:151:33: note: in definition of macro ‘num’
#define num(x) ((word)(x))
^
big.c:1228:14: note: in expansion of macro ‘hi’
return hi(Seed) & 1 ? T : Nil;
^
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:151:33: note: in definition of macro ‘num’
#define num(x) ((word)(x))
^
big.c:1231:12: note: in expansion of macro ‘hi’
n += hi(Seed) % m;
^
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -D_OS='"Linux"' io.c
In file included from io.c:5:0:
io.c: In function ‘new64’:
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:151:33: note: in definition of macro ‘num’
#define num(x) ((word)(x))
^
io.c:2758:11: note: in expansion of macro ‘hi’
return hi(w)? consNum(num(w), consNum(hi(w), x)) : consNum(num(w), x);
^
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:151:33: note: in definition of macro ‘num’
#define num(x) ((word)(x))
^
io.c:2758:42: note: in expansion of macro ‘hi’
return hi(w)? consNum(num(w), consNum(hi(w), x)) : consNum(num(w), x);
^
io.c: In function ‘blk64’:
io.c:2770:29: warning: left shift count >= width of type [-Wshift-count-overflow]
w |= (adr)unDig(x) << BITS;
^
In file included from io.c:5:0:
io.c: In function ‘extOffs’:
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:151:33: note: in definition of macro ‘num’
#define num(x) ((word)(x))
^
io.c:2800:11: note: in expansion of macro ‘hi’
x = hi(w)? consNum(num(w), consNum(hi(w), Nil)) : consNum(num(w), Nil);
^
pico.h:161:32: warning: right shift count >= width of type [-Wshift-count-overflow]
#define hi(w) num((w)>>BITS)
^
pico.h:151:33: note: in definition of macro ‘num’
#define num(x) ((word)(x))
^
io.c:2800:42: note: in expansion of macro ‘hi’
x = hi(w)? consNum(num(w), consNum(hi(w), Nil)) : consNum(num(w), Nil);
^
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -D_OS='"Linux"' net.c
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -D_OS='"Linux"' tab.c
mkdir -p ../bin ../lib
gcc -o ../bin/picolisp -rdynamic main.o gc.o apply.o flow.o sym.o subr.o big.o io.o net.o tab.o -lm -ldl
strip ../bin/picolisp
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -D_OS='"Linux"' ext.c
gcc -o ../lib/ext -shared -export-dynamic ext.o -lcrypt
strip ../lib/ext
gcc -c -O2 -pipe -falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wuninitialized -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -D_OS='"Linux"' ht.c
gcc -o ../lib/ht -shared -export-dynamic ht.o
strip ../lib/ht
rock64@rock64:~/Desktop/picoLisp/src$
rock64@rock64:~/Desktop/picoLisp/src64$ make
as -o arm64.linux.base.o arm64.linux.base.s
cc -o ../bin/picolisp arm64.linux.base.o -Wl,--no-as-needed -rdynamic -lc -lm -ldl
strip ../bin/picolisp
as -o arm64.linux.ext.o arm64.linux.ext.s
cc -o ../lib/ext arm64.linux.ext.o -shared -export-dynamic
strip ../lib/ext
as -o arm64.linux.ht.o arm64.linux.ht.s
cc -o ../lib/ht arm64.linux.ht.o -shared -export-dynamic
strip ../lib/ht
rock64@rock64:~/Desktop/picoLisp/src64$
rock64@rock64:~/Desktop/picoLisp/src$ ../pil +
on/l open: No such file or directory
?
: (version)
17.11.19 C
-> (17 11 19)
: *CPU
-> NIL
:
rock64@rock64:~/Desktop/picoLisp/src64$ ../pil +
: (version)
17.11.19
-> (17 11 19)
: *CPU
-> "arm64"
:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment