-
Notifications
You must be signed in to change notification settings - Fork 36
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
Support XC8 2.x #3
Comments
It looks like @enbyted has already done some work on this in enbyted@f688dc8 I'm not going to merge that directly as it pushes users to use I also want to see if I can get CMake to detect |
So apparently |
If you have an idea in mind how it should work I'd love to work on it as I'm using this CMake setup with all new projects currently. It probably isn't feasible to use I've never dug so deep in CMake, but hey, there's a lot to learn! |
Currently only XC8 v1.x is supported, although v2.x works with the legacy command-line driver (see last paragraph).
In v2.x Microchip switched from their proprietary HI-TECH C frontend to Clang in order to support C99. Rather than implement PIC codegen in LLVM, though, they wrote a translator from LLVM's IR to p-code (the HI-TECH IR), which is then passed through the same code generator as the old HI-TECH frontend. XC8 still includes the HI-TECH C frontend to support older projects.
Some code (M-Stack, notably) that worked under HI-TECH C does not compile in Clang. Also, the LLVM IR translation currently produces larger and less efficient code than the IR generated by HI-TECH C. Many projects have declined to upgrade until some of the kinks are worked out. We will therefore have to support both the HI-TECH C and Clang frontends for the foreseeable future.
v2.x also introduces a new compiler command-line driver,
xc8-cc
, which uses an option format more in line with Clang and GCC. It supports both C frontends via the-std
option:-std=c99
for Clang and-std=c90
or-std=c89
for HI-TECH C. The old command-line driverxc8
is still included. We will need to support both command-line drivers, both so v1.x still works and to support projects already using the v1.x driver who want to upgrade to v2.x without changing their compiler options.The text was updated successfully, but these errors were encountered: