vnmakarov / mir

A lightweight JIT compiler based on MIR (Medium Internal Representation) and C11 JIT compiler and interpreter based on MIR
MIT License
2.31k stars 148 forks source link

An attempt to test c2m on windows ends on stdio.h syntax errors on second include of that file. #154

Open differentprogramming opened 3 years ago

differentprogramming commented 3 years ago

I included the source files I was using in case that would help you recreate. source.zip

I realize that for my first attempt to try c2m, it was a bit much to use a program that includes "windows.h" but I had forgotten that it does.

In any event the compile somehow died parsing stdio.h for a second time, which should be impossible because that file is guarded with #define and an #ifdef.

In order to get as far as I did, I gleaned from the fact that it relies on make files (and not whatever it is that NMAKE looks for) and the failure of running make under cygwin (it tried to use cl which isn't in the path instead of gcc) that the build process for MIR on Windows is to install GNUWin32, and then start with a Microsoft x64 Native Tools Command Prompt for VS 2017.

And that worked for building MIR.

Then I realized that it had to have some version of include files. Since your blog post mentioned GCC, I figured that you use a Windows port of GCC for the include files. I could have used Clang. I doubted you'd use Microsoft's include files as those would be full of cruft that's incompatible with Linux or any other compiler.

So here's the input and the output:

C:\local\spookyc>..\mir\c2m testspooky.c -I/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include testspooky.c:9:10: error in opening file stdio.h

C:\local\spookyc>..\mir\c2m testspooky.c -I/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include -I/TDM-GCC-64/x86_64-w64-mingw32/include /TDM-GCC-64/x86_64-w64-mingw32/include/_mingw.h:124:11: warning -- different macro redefinition of restrict /TDM-GCC-64/x86_64-w64-mingw32/include/vadefs.h:14:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/vadefs.h:35:2: #error VARARGS not implemented for this compiler /TDM-GCC-64/x86_64-w64-mingw32/include/vadefs.h:103:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/crtdefs.h:15:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/crtdefs.h:476:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:13:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:534:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:535:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:563:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:564:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:794:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:795:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:815:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:816:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/swprintf.inl:82:0: warning -- no end of line at file end /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:989:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:16:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:64:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:68:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:80:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:87:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:89:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:93:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:318:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:321:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:453:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:454:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:459:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:460:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:568:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:569:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:574:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:575:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:576:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:577:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:582:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:583:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdlib.h:683:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/malloc.h:11:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/malloc.h:65:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/malloc.h:66:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/malloc.h:97:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/malloc.h:98:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/malloc.h:209:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/string.h:88:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/string.h:91:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/time.h:15:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/time.h:262:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/sys/timeb.h:15:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/sys/timeb.h:122:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pthread_time.h:78:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pthread_time.h:91:2: warning -- unknown pragma testspooky.c:181:9: warning -- different macro redefinition of CLOCK_MONOTONIC /TDM-GCC-64/x86_64-w64-mingw32/include/excpt.h:11:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/excpt.h:128:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/minwindef.h:128:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/minwindef.h:136:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:570:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:571:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:576:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:577:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:578:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:579:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:584:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/winnt.h:585:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ia32intrin.h:53:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ia32intrin.h:54:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ia32intrin.h:82:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ia32intrin.h:199:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ia32intrin.h:200:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ia32intrin.h:214:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/mmintrin.h:31:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/mmintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/mmintrin.h:310:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/mmintrin.h:311:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/mmintrin.h:322:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/mmintrin.h:422:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/mmintrin.h:423:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/mmintrin.h:434:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/mmintrin.h:939:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:66:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:67:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:34:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:35:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/emmintrin.h:1558:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xmmintrin.h:1261:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/pmmintrin.h:34:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/pmmintrin.h:35:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/pmmintrin.h:129:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/tmmintrin.h:34:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/tmmintrin.h:35:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/tmmintrin.h:246:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ammintrin.h:34:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ammintrin.h:35:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/ammintrin.h:90:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:35:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:36:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:588:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:589:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:803:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:808:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/popcntintrin.h:28:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/popcntintrin.h:29:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/popcntintrin.h:50:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:814:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:815:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:820:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:821:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:854:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/smmintrin.h:859:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/wmmintrin.h:36:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/wmmintrin.h:37:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/wmmintrin.h:99:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/wmmintrin.h:105:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/wmmintrin.h:106:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/wmmintrin.h:129:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avxintrin.h:35:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avxintrin.h:36:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avxintrin.h:1464:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx2intrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx2intrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx2intrin.h:1901:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512fintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512fintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512fintrin.h:13139:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512erintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512erintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512erintrin.h:391:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512pfintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512pfintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512pfintrin.h:209:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512cdintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512cdintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512cdintrin.h:181:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vlintrin.h:40:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vlintrin.h:41:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vlintrin.h:8164:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vlintrin.h:8165:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vlintrin.h:8442:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vlintrin.h:13595:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512bwintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512bwintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512bwintrin.h:2992:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512dqintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512dqintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512dqintrin.h:2298:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vlbwintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vlbwintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vlbwintrin.h:4650:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vldqintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vldqintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vldqintrin.h:2022:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512ifmaintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512ifmaintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512ifmaintrin.h:101:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512ifmavlintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512ifmavlintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512ifmavlintrin.h:161:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vbmiintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vbmiintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vbmiintrin.h:156:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vbmivlintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vbmivlintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/avx512vbmivlintrin.h:272:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/shaintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/shaintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/shaintrin.h:95:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/lzcntintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/lzcntintrin.h:34:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/lzcntintrin.h:72:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/bmiintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/bmiintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/bmiintrin.h:181:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/bmi2intrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/bmi2intrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/bmi2intrin.h:106:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/fmaintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/fmaintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/fmaintrin.h:299:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/f16cintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/f16cintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/f16cintrin.h:95:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/rtmintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/rtmintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/rtmintrin.h:81:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xtestintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xtestintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xtestintrin.h:48:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/immintrin.h:88:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/immintrin.h:89:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/immintrin.h:107:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/immintrin.h:113:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/immintrin.h:114:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/immintrin.h:174:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/immintrin.h:178:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/immintrin.h:179:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/immintrin.h:190:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/mm3dnow.h:34:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/mm3dnow.h:35:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/mm3dnow.h:215:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/fma4intrin.h:35:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/fma4intrin.h:36:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/fma4intrin.h:238:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xopintrin.h:34:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xopintrin.h:35:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xopintrin.h:841:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/lwpintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/lwpintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/lwpintrin.h:102:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/tbmintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/tbmintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/tbmintrin.h:177:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/rdseedintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/rdseedintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/rdseedintrin.h:63:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/fxsrintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/fxsrintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/fxsrintrin.h:69:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xsaveintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xsaveintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xsaveintrin.h:69:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xsaveoptintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xsaveoptintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xsaveoptintrin.h:55:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/clwbintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/clwbintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/clwbintrin.h:46:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/pcommitintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/pcommitintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/pcommitintrin.h:46:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/clflushoptintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/clflushoptintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/clflushoptintrin.h:46:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xsavesintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xsavesintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xsavesintrin.h:69:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xsavecintrin.h:32:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xsavecintrin.h:33:2: warning -- unknown pragma /TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/xsavecintrin.h:55:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack4.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack4.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack2.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack2.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack2.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack8.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack8.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack4.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack1.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack2.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack2.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack4.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack4.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack2.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack1.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack8.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack8.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack8.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/_bsd_types.h:16:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/_bsd_types.h:19:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack8.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack8.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack8.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack8.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/msxml.h:30:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/msxml.h:3379:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/urlmon.h:301:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack8.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack1.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack1.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack1.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack1.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack1.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack1.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/pshpack8.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/poppack.h:7:2: warning -- unknown pragma /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:144:32: syntax error on const (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:144:32: syntax error on const (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:150:30: syntax error on const (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:150:30: syntax error on const (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:156:37: syntax error on (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:156:37: syntax error on (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:160:33: syntax error on char (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:160:33: syntax error on char (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:170:32: syntax error on const (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:170:32: syntax error on const (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:176:38: syntax error on (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:176:38: syntax error on (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:182:33: syntax error on char (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:182:33: syntax error on char (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:188:33: syntax error on char (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:188:33: syntax error on char (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:381:29: syntax error on (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:381:29: syntax error on (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:382:23: syntax error on const (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:382:23: syntax error on const (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:383:24: syntax error on char (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:383:24: syntax error on char (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:393:27: syntax error on const (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:393:27: syntax error on const (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:394:34: syntax error on (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:394:34: syntax error on (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:395:29: syntax error on const (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:395:29: syntax error on const (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:399:21: syntax error on (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:399:21: syntax error on * (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:406:16: syntax error on const (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:406:16: syntax error on const (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:412:14: syntax error on const (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:412:14: syntax error on const (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:529:34: syntax error on char (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:529:34: syntax error on char (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:538:30: syntax error on char (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:538:30: syntax error on char (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:543:18: syntax error on char (expected 'identifier'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:543:18: syntax error on char (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:556:21: syntax error on identifier (expected ';'): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:556:21: syntax error on identifier (expected ''): /TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:567:11: syntax error on int (expected ''):

C:\local\spookyc>

differentprogramming commented 3 years ago

I just realized that the output probably doesn't mean that it processed stdio.h twice, it means that it gives source file positions for macros when it throws an error processing them after loading the headers.

I tried again using Tiny C compiler win32 version headers instead of mingw/gcc headers, since that's a very simple compiler and it can compile the source I supplied, and of course it has very simple headers.

But actually it threw even more errors. If you ever want to test with those, I think you have to actually build the win32 version before a bat file combines the include directories into one.

vnmakarov commented 3 years ago

Thank you for reporting this. I'll will look at this on the next week. I should say that c2m is not ready yet for Win64 although I am working on it. A lot of things should be done for this. I'd like to make Win64 port before the first release of MIR project.

I have a very high regard to tinyC compiler. It is incredibly fast compiler. The fastest C compiler I know. c2m has different goals. Initially it was not designed to be fast or used for everyday C program developing. The goal for c2m is to translate as much as possible C code in CRuby/MRuby to MIR. Although c2m probably will be moving to be used for everyday C program developing.

I hope my blog post about c2m and its comparison with other C compilers (GCC, Clang, pcc, tcc, lacc, chibicc, cparser, and cproc) will be published in January. I think it will be useful for people interesting in c2m.

differentprogramming commented 3 years ago

Maybe I can help you port it.

I have some uses for MIR that aren't reliably supported by existing projects, unless I could do them with LLVM's jit library which doesn't seem to have enough examples to be easy to jump into.

I want to design a system that has a number of slightly unusual requirements, and it couldn't hurt MIR to be up to them.

I can start out on Linux if I have to, to get working on MIR.

I hope you will excuse me listing what abilities I want a dynamic system to have, but I know the precise definition of the language a compiler is needed for deeply affects the back end. LLVM is for C/C++ and everything else it does is an experimental feature, and it may never support some of the things you want because it was never designed to.

So by listing what my goals are, you can get an idea of what I would mold a back end into.

The goals I have for a language are:

a) statically typed for primitive types, though a dynamic type/boxing should be available. In fact I want to emphasize the use of static primitive types in order to make a tracing JIT unnecessary most of the time. Usually you know the static type of primitives, and mostly you don't need to optimize for the definition of non-primitive objects outside of that class' own methods.

b) a few common things like duck-typed objects, with the unusual caveat that messages should be reifiable, ie you should be able to store a message to a variable, and then send it to an object of unknown type later.

c) support like Go for massive parallelism. Having static primitive types helps, because it's not possible to ever have a variable that's visible from multiple threads at once AND have it be dynamically typed AND have its use be optimized.

d) garbage collection with similar goals to Go, ie support for parallelism and as close to real time as possible.

e) now we get to more unusual needs, I want support for Smalltalk like run time system flexibility.

1) You should be able to save and restore an image of a running system.

2) You should be able to change code even of a system that continues running, where threads never shut down.

3) Ideally you should be able to change and debug a running system without shutting it down. I'm sad at how these old features, even in the most minimal form have become hard to find. Even the idea that you can assign a global variable and the value is there for multiple runs is hard to find.

4) while that sort of thing has been supported in old languages like Smalltalk and Lisp, there was never any effort put into how you safely version running code with active stack frames in live threads and persistent data of objects whose definitions could be changing. Some more sophisticated facilities for that should be included. Changing the definition of a class is analogous to changing the schema of a database.

5) Also, perhaps variations on saving images could be added like segmenting a running program and moving part of it to another server.

f) I don't want people relying on images except where they have to. Languages that rely on images too much, like Smalltalk accumulate cruft in their images. There should be IDE like support for separating code AND DATA into projects.

1) Smalltalk images sometimes have to be manually walked and the data and code for a project manually separated out. I never want that to be needed.

2) other kinds of modularity should be built in, such as modules and libraries.

g) support not only for parallelism at all levels (including C++11 like control over memory order), but also unusual paradigms that similarly change program semantics when in use, such as bounded continuations. When you're in a part of the program that can save continuations, you can't assume that when a function returns, it didn't save a continuation - it could return again in the same context later.

h) related unusual semantics such as logical variables, the state of a variable could be tied to continuations so that when a continuation is restored so is its previous value. Useful for reifying search.

I have other ideas, but they won't affect the back end, I think.

vnmakarov commented 3 years ago

Thank you for sharing your ideas. MIR has no support for generating parallel code right now. I think MIR needs at least atomic support for this. I guess it will be added in the future.

As for persistence feature, I think it is too specialized one. I don't think MIR will have support for this. May be it is possible to implement it as an upper layer on MIR base code. I'd like to keep MIR as simple as possible. In the past, people already proposed some specialized features (like vector insns) and they were rejected not only by me. Although you are welcome to create a fork of MIR project to implement some specialized features.

As for GC, people already asked will MIR project support this. The answer is probably no. People can create a conservative GC without MIR project changes. For example, CRuby uses a conservative GC and usage of MIR for CRuby JIT implementation does not need any GC support in MIR project itself.

RussellHaley commented 3 years ago

Hi,

I can compile mir with llvm-mingw ( can be downloaded from http://winlua.net) on Windows but I also run into stdio.h errors. I am not sure which version of the mingw-64 library it's using, but it's fairly recent (summer 2020).

C:\Users\russh\git\mircVM [master ≡ +3 ~2 -0 !]> cd mir
C:\Users\russh\git\mircVM\mir [(34ccc1d...) +3 ~0 -0 !]> cd .\build-ninja\
C:\Users\russh\git\mircVM\mir\build-ninja [(34ccc1d...) +3 ~0 -0 !]> cmake -GNinja -DCMAKE_TOOLCHAIN_FILE="../../cmake/x86_64-w64-mingw.cmake" ..
-- The C compiler identification is Clang 11.0.0
-- The CXX compiler identification is Clang 11.0.0
-- Check for working C compiler: C:/Program Files (x86)/WinLua/WLC/bin/wlc64.exe
-- Check for working C compiler: C:/Program Files (x86)/WinLua/WLC/bin/wlc64.exe - works
-- Detecting C compiler ABI info
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/WinLua/WLC/bin/x86_64-w64-mingw32-clang++.exe
-- Check for working CXX compiler: C:/Program Files (x86)/WinLua/WLC/bin/x86_64-w64-mingw32-clang++.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
C compiler flags:
CMake Warning at CMakeLists.txt:68 (find_package):
  By not providing "FindLLVM.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "LLVM", but
  CMake did not find one.

  Could not find a package configuration file provided by "LLVM" with any of
  the following names:

    LLVMConfig.cmake
    llvm-config.cmake

  Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
  provides a separate development package or SDK, be sure it has been
  installed.

-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/russh/git/mircVM/mir/build-ninja
C:\Users\russh\git\mircVM\mir\build-ninja [(34ccc1d...) +3 ~0 -0 !]> ninja
[26/54] Building C object CMakeFiles/reduce_test.dir/adt-tests/mir-reduce-test.c.obj
../adt-tests/mir-reduce-test.c:60:12: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned long long') [-Wformat]
           input_length1, output_length1, (input_length1 + 0.0) / output_length1,
           ^~~~~~~~~~~~~
../adt-tests/mir-reduce-test.c:60:27: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned long long') [-Wformat]
           input_length1, output_length1, (input_length1 + 0.0) / output_length1,
                          ^~~~~~~~~~~~~~
../adt-tests/mir-reduce-test.c:69:12: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned long long') [-Wformat]
           input_length2, output_length2, (input_length2 + 0.0) / output_length2,
           ^~~~~~~~~~~~~
../adt-tests/mir-reduce-test.c:69:27: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned long long') [-Wformat]
           input_length2, output_length2, (input_length2 + 0.0) / output_length2,
                          ^~~~~~~~~~~~~~
../adt-tests/mir-reduce-test.c:79:98: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned long long') [-Wformat]
             "FAIL: original and reduced/unreduced files are different on pos = %lu! Result:\n", i);
                                                                                ~~~              ^
                                                                                %zu
5 warnings generated.
[31/54] Building C object CMakeFiles/mir.dir/mir.c.obj
../mir.c:1806:11: warning: 140 enumeration values not handled in switch: 'MIR_MOV', 'MIR_FMOV', 'MIR_DMOV'... [-Wswitch]
  switch (code) {
          ^
1 warning generated.
[54/54] Linking C executable mir2c_test.exe
C:\Users\russh\git\mircVM\mir\build-ninja [(34ccc1d...) +3 ~0 -0 !]> ./c2m -v -I"C:\\Program Files (x86)\\WinLua\\WLC\\include" -L"C:\\Program Files (x86)\\WinLua\\WLC\\x86_64-w64-mingw32" -S C:\Users\russh\git\mircVM\files\C\sieve.c
C2MIR init end           -- 531 usec
C:\\Program Files (x86)\\WinLua\\WLC\\include/_mingw.h:121:11: warning -- different macro redefinition of __restrict__
C:\\Program Files (x86)\\WinLua\\WLC\\include/vadefs.h:14:2: warning -- unknown pragma
C:\\Program Files (x86)\\WinLua\\WLC\\include/vadefs.h:35:2: #error VARARGS not implemented for this compiler
C:\\Program Files (x86)\\WinLua\\WLC\\include/vadefs.h:103:2: warning -- unknown pragma
C:\\Program Files (x86)\\WinLua\\WLC\\include/corecrt.h:15:2: warning -- unknown pragma
C:\\Program Files (x86)\\WinLua\\WLC\\include/corecrt.h:506:2: warning -- unknown pragma
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:11:2: warning -- unknown pragma
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:1579:2: warning -- unknown pragma
    preprocessor tokens -- 18437, parse tokens -- 9573
  C2MIR preprocessor end    -- 26468 usec
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:147:32: syntax error on const (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:147:32: syntax error on const (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:153:30: syntax error on const (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:153:30: syntax error on const (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:159:37: syntax error on * (expected '*'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:159:37: syntax error on * (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:163:33: syntax error on char (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:163:33: syntax error on char (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:173:32: syntax error on const (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:173:32: syntax error on const (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:179:38: syntax error on * (expected '*'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:179:38: syntax error on * (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:185:33: syntax error on char (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:185:33: syntax error on char (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:191:33: syntax error on char (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:191:33: syntax error on char (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:208:29: syntax error on const (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:208:29: syntax error on const (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:214:35: syntax error on * (expected '*'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:214:35: syntax error on * (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:220:30: syntax error on char (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:220:30: syntax error on char (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:223:39: syntax error on unsigned (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:223:39: syntax error on unsigned (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:224:39: syntax error on unsigned (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:224:39: syntax error on unsigned (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:225:38: syntax error on unsigned (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:225:38: syntax error on unsigned (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:226:38: syntax error on unsigned (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:226:38: syntax error on unsigned (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:489:29: syntax error on * (expected '*'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:489:29: syntax error on * (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:491:23: syntax error on const (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:491:23: syntax error on const (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:493:24: syntax error on char (expected 'identifier'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:493:24: syntax error on char (expected '<declarator>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:499:23: syntax error on identifier (expected ';'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:499:23: syntax error on identifier (expected '<statement>'):
C:\\Program Files (x86)\\WinLua\\WLC\\include/stdio.h:506:3: syntax error on static (expected '<statement>'):
  C2MIR parser end          -- 71338 usec
parser - FAIL
  C2MIR context checker end -- 71912 usec
  C2MIR generator end       -- 72527 usec
C2MIR compiler end                -- 73303 usec
C:\Users\russh\git\mircVM\mir\build-ninja [(34ccc1d...) +3 ~0 -0 !]>

LLDB only works on 32 bit binaries at the moment (from what I understand), and I am limited to command line so debugging with it isn't really practical. I tried compiling with gnu-mingw (for use with gdb) but mir fails to compile. I will open a different issue for that.

vnmakarov commented 3 years ago

Sorry, I wanted to do MIR windows port before releasing the 1st version of MIR. I think it will not happen.

Making windows port is hard and my management does not support this goal. Windows port requires implementation of seh (structural exception handling) and also changes a lot in prologue/epilogue generation as seh requires quite specific form of epilogue and prologue. I spent a lot of time on making Windows port and am still far away of achieving Windows port goal. To be honest I have not time to do any work on MIR until gcc-11 release.

Work on Windows port removes me from my original goal of trying MIR for Ruby JIT. So I am guessing now that windows port could be made at the end of this year at the best, but first I'll do a MIR release without Windows and then will work on MIR based version Ruby JIT compiler to find out what is still missing in MIR project for this.

As for the current state of mir on windows, I myself use existing GNUMakefile (not cmake) with gcc and microsoft command line c compiler. I achieved passing practically all tests but not c2m bootstrap (which is a sign that there is still a lot of missed in the port).

RussellHaley commented 3 years ago

Thanks for commenting @vnmakarov. I just wanted to add my information in case it's helpful. And thanks for all your hard work with GCC!

dibyendumajumdar commented 3 years ago

Hi @vnmakarov Understand the issue with Win port - fortunately it seems even the current version works well for Ravi. I am able to to use it successfully on Windows. It never worked correctly when I used LLVM - longjmp caused crashes. But with MIR so far I have not encountered the issue. Perhaps your problems on Win port are elsewhere?