Open Ivo-Balbaert opened 1 year ago
@Ivo-Balbaert This was a bug in the 0.6.1 version. A few versions before that, when running built executables worked, the compiler assumed only one executable to run. After that, the system was changed to support multiple executables, however, the actual step of running was commented out. This should be fixed in the next release. I will be pinging here when the next release happens.
Thanks for showing interest, pointing this out and contributing to the project. I appreciate your feedback and effort.
D:\Qat\qat_v0.7.0_windows_amd64>qat -version
D:\Qat\qat_v0.7.0_windows_amd64>qat -v
D:\Qat\qat_v0.7.0_windows_amd64>qat run main.qat
D:\Qat\qat_v0.7.0_windows_amd64>
@Ivo-Balbaert
I have found the issue. There is a function the compiler uses to search for executables. In posix systems, which
command is used. In windows, SearchPath
is used which is not providing the correct result in the tests I did recently. The compiler log is saying that it cannot find clang
on path in the debug builds. The reason I stated previously was valid, but already resolved. So now that I think about it, this has also been a problem from the beginning, which is why the compilation is not successful now.
qat version
is the command to use to see the version of the compiler. I will also include another popular command used for the same purpose in other executables, in the next release.
Thanks for looking into this!
@Ivo-Balbaert
The SearchPath
issue has been solved by using where
command in windows. But there are more problems in the Windows compiler. Compiling & linking the LLVM files with clang, causes the linker to throw the following error:
C:/msys64/mingw64/bin/ld: C:/msys64/mingw64/lib\libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function `main':
C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
This is fixed by using lld
by adding -fuse-ld=lld
to the compilation command.
However, at this point, running the built executable causes segfaults. I looked into it. I removed say "Hello, World!".
and compiled again, and there is no error whatsoever. say
uses printf
under the hood which is properly linked in POSIX systems, but turns out, not so much in a windows system. I updated the compiler to use __mingw_vprintf
instead in windows, but no change in the result.
I will look more into this and see how I can properly link C runtime. Manually passing -Lc
doesn't work either.
When running: D:\Qat\qat_v0.6.1-alpha_windows_amd64>qat run main.qat
with main.qat:
I see not output from say. Any idea what might go wrong here?