Skip to content

Instantly share code, notes, and snippets.

@gahr
Created August 8, 2023 09:05
Show Gist options
  • Save gahr/e0ed0de97625290c013095470bb30c60 to your computer and use it in GitHub Desktop.
Save gahr/e0ed0de97625290c013095470bb30c60 to your computer and use it in GitHub Desktop.
opt -o base.bc base.ll
clang -c -D_OS='"FreeBSD"' -D_CPU='"x86"' `pkg-config --cflags libffi` -I/usr/local/include -emit-llvm lib.c
lib.c:362:19: warning: address of stack memory associated with local variable 'stk' returned [-Wreturn-stack-address]
return (char*)&stk - stk.rlim_cur + 16384;
^~~
lib.c:700:38: warning: incompatible pointer types passing 'uint64_t *' (aka 'unsigned long *') to parameter of type 'char *' [-Wincompatible-pointer-types]
bufFloat(car(x), y >> 4, &value[i]);
^~~~~~~~~
lib.c:583:50: note: passing argument to parameter 'p' here
void bufFloat(uint64_t value, int64_t scl, char *p) {
^
lib.c:702:39: warning: incompatible pointer types passing 'uint64_t *' (aka 'unsigned long *') to parameter of type 'char *' [-Wincompatible-pointer-types]
bufDouble(car(x), y >> 4, &value[i]);
^~~~~~~~~
lib.c:599:51: note: passing argument to parameter 'p' here
void bufDouble(uint64_t value, int64_t scl, char *p) {
^
3 warnings generated.
llvm-link -o picolisp.bc base.bc lib.bc
llc picolisp.bc -o picolisp.s
clang picolisp.s -o ../bin/picolisp -lc -lm -ldl -lutil `pkg-config --libs libffi` `pkg-config --libs readline`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment