Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined sym: __builtin_mul #45

Open
aaronryank opened this issue Jan 27, 2018 · 2 comments
Open

undefined sym: __builtin_mul #45

aaronryank opened this issue Jan 27, 2018 · 2 comments

Comments

@aaronryank
Copy link

aaronryank commented Jan 27, 2018

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.

@shinh
Copy link
Owner

shinh commented Jan 27, 2018

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.

@aaronryank
Copy link
Author

aaronryank commented Jan 27, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants