jdh8 / metallic

C runtime library (libc) for WebAssembly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I run the test suite?

IngwiePhoenix opened this issue · comments

I had to patch the Makefile a little bit to get it to use my LLVM 7 setup on OS X - but after that, it built successfuly! Now... I would like to run the test suite to see if this actually works. How can I do that?

Also, what I did was:

Ingwie@Ingwies-MBP.fritz.box ~/W/g/metallic $ git diff
diff --git a/Makefile b/Makefile
index 7867f1a..e36045a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,14 @@
 override CPPFLAGS += -MMD -MP -MQ $@
 override CFLAGS += -pipe -O3 -Wall -flto
 
-WACC = clang --target=wasm32-unknown-unknown-wasm
+WACC =  /usr/local/opt/llvm/bin/clang --target=wasm32-unknown-unknown-wasm
 LDFLAGS = -lm
 
 metallic.bc: CC = $(WACC)
 metallic.bc: CPPFLAGS += -I include
 metallic.bc: CFLAGS += -fno-builtin-memcpy
 metallic.bc: $(patsubst %.c, %.o, $(wildcard src/*/*.c src/*/*/*.c))
-       llvm-link -o $@ $^
+       /usr/local/opt/llvm/bin/llvm-link -o $@ $^
 
 check: $(patsubst %.c, %.out, $(wildcard test/wasm/*/*.c test/wasm/*/*/*.c)) \
        $(patsubst %.c, %.exe, $(wildcard test/native/*/*.c test/native/*/*/*.c))

I hope to use this soon! Because a simple hello-world program easily blows up the resulting filesize by quite a margin...

Just make and then make check like everything else (?)

It is how static linking works. We can only do static linking because there is no system libc to link. You can try compiling a statically linked native hello world, and it blows up too....

I just fixed some bashism in 013fd5d and tested on Ubuntu, which defaults to dash (a non-bash shell) as scripting shell. Along with #3 solved, running test is as easy as make check with LLVM 8+, a POSIX shell, and make. Therefore, I'm closing this issue.