davidar / lljvm

Low Level Java Virtual Machine
https://davidar.io
MIT License
475 stars 62 forks source link

"limits.h" problem #13

Open Erhannis opened 2 years ago

Erhannis commented 2 years ago

A project I'm trying to compile includes limits.h. It looks like lljvm is intended to support this, but does so incompletely. Consider the following, in the Docker described in the README (which I appreciate, btw - assuming there's not a heap of other gotchas past this one I'm running into, providing a pre-built docker will have been the easiest way of getting this to run, out of the several c->jvm projects I've tried.)

root@ebb1c6a0a0c2:/test# cat test.c 
#include <limits.h>

int main(int argv, char ** argc) {
    return 0;
}
root@ebb1c6a0a0c2:/test# lljvm-cc -o test test.c 
In file included from test.c:1:
In file included from /usr/local/lib/lljvm/include/newlib/limits.h:130:
/usr/local/lib/clang/1.1/include/limits.h:35:15: fatal error: 'limits.h' file not found
#include_next <limits.h>
              ^
1 diagnostic generated.
Erhannis commented 2 years ago

I commented out #include <limits.h> in the project I'm compiling, and it seems like that problem's gone away for now, so...maybe I'm ok on this front. It may still be relevant for anybody that actually DOES depend on this header.