Skip to content

Commit 5f97f93

Browse files
committed
Build to bytecode before compiling with clang to work around missing symbol error
1 parent 726a90b commit 5f97f93

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
all: test
22

3-
mylib.o: mylib.rs
4-
rustc -c mylib.rs
3+
mylib.bc: mylib.rs
4+
rustc --emit-llvm mylib.rs
5+
6+
mylib.o: mylib.bc
7+
clang -c mylib.bc
58

69
test: test.c mylib.o
7-
gcc -o test test.c mylib.o
10+
clang -o test test.c mylib.o
811

912
clean:
13+
rm *.bc
1014
rm *.o
1115
rm test

0 commit comments

Comments
 (0)