Been having a bit of trouble linking two .o files.
First .o file is generated from compiling a .c file to a .ll file and then to a .o file
Second .o file is generated from a .zig file
When I attempt to link both together, I get the following error (using WSL btw)
LLD Link... ld.lld: error: duplicate symbol: _start
>>> defined at /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crt1.o:(_start)
>>> defined at main
>>> main.o:(.text+0x0)
Here are the commands I used in order (last one causes the error)
clang -O3 -S -emit-llvm helper.c -o helper.ll
llc -filetype=obj helper.ll -o helper.o
zig cc -c helper.ll -o helper.o
zig build-obj main.zig -O ReleaseSmall
zig cc -o main main.o helper.o -lc
I'm just trying to compile two simple files together, both don't contain complex code (I can share them if needed)
*Using the latest Zig version (master)