elvm
elvm copied to clipboard
undefined sym: __builtin_mul
Frequently when using the online demo, attempting to assemble the ELVM IR just prints:
undefined sym: __builtin_mul
It seems to occur anytime multiplication is needed. For example, the code below throws the error above:
int main(void) { printf("%d", 6 * 3); }
This may not just be the online demo but I suspect that it is.
I know this is a weird limitation, but you need #include <stdio.h>, which lets the compiler include https://github.com/shinh/elvm/blob/master/libc/_builtin.h .
Including this file by default would significantly slow down the compilation for minimal code. Maybe we should let compiler emit __builtin_xxx when xxx is used first time.
I agree, I think _builtin.h
being included by default would simplify things a lot. I can't think of many useful programs that won't use multiplication in some form.