7.x: Does EurekaLog support Embarcadero CLang/LLVM/64-bit?
Posted by Kevin G. McCoy on 04 January 2019 00:40
Yes, EurekaLog supports CLang and LLVM in both 32 and 64 bits - with some limitations.
The 64-bit Delphi is build on classic Borland toolchain. EurekaLog 7 supported 64-bit Delphi since the very begining: the original release of EurekaLog 188.8.131.52 in 2012. Since many of our clients were using the new 64-bit platform, we were also able to improve its support over time. It was feature-complete in somewhere near 2014. Currently it does not have any limitations.
On the other hand, the 64-bit C++ Builder is build on entirely different toolchain: LLVM. Classic toolchain is not used for 64-bit C++ Builder. The CLang is LLVM's frontend for C++. Initially EurekaLog 7 did not have support for LLVM.
While 32-bit C++ Builder was also originally build on classic Borland toolchain, Embarcadero has released RAD Studio 10 Seattle in 2015 with an option to use LLVM-based toolchain for 32-bit C++ Builder. In other words, starting with RAD Studio 10 Seattle (2015+):
Since now CLang was accessible in 32-bit, we also started implementing support for LLVM and CLang. However, not many of our clients use C++Builder. And very few clients immediately switched to CLang/LLVM. Therefore, we also couldn't polish our CLang/LLVM support as quickly as Delphi's 64-bit support. However, a lot of time has passed and we can say with confidence that many of our clients use EurekaLog for CLang/LLVM today.
Support for 64-bit C++ Builder is a relatively recent addition. It was enabled in 2020. EurekaLog doesn't track usage statistics, so we don't know exactly how many of our clients are using 64-bit C++ Builder. But we can judge this indirectly: by the number of questions to our technical support. And judging by it: almost none of our clients use 64-bit C++ Builder. This means we don't get a lot of feedback and improvements to 64-bit C++ Builder support are VERY slow.
In summary: while EurekaLog does support CLang, LLVM and 64-bit, you must understand that some aspects had more time to polish and evolve. For these historical reasons, the levels of maturnity (in order from high to low) are:
Technical details and limitations
Unfortunately, using LLVM (CLang) for 32 or 64-bits means that some exception info is missing. LLVM (or its implementation in C++ Builder) is very unpolished for exception tracing. Specifically, it does not set an exception address, it does not set a valid stack pointer and a frame - all those necessary and important values are just zeros. We really got into the wilds of workarounds and hacks, only to extract the address of the exception. Everything really hangs on straws and assumptions.
Classic C++ Builder is much better in this aspect. We are improving diagnostic as much as possible, so newer versions of EurekaLog should provide better info. But there may be something that is impossible to implement from our side. We highly recommend that you don't use LLVM on 32-bit, use classic compiler. Naturally, you are limited to LLVM only for 64-bit C++ Builder as there is no option to use classic compiler.
One other point to consider is debug information. Delphi, C++ Builder and RAD Studio has an option to generate a text .map file, which contains debug information about the compiled module - such as unit, class, function names and line numbers. Such .map file is used by EurekaLog to compose debug information in EurekaLog's own format - designed for maximum access speed or minimum space. The issue is that .map files produced by the C++ Builder do not have line numbers - just names of units, classes, and functions:
You can help us to fix this issue by voting for this entry: [RSP-27359] No line numbers in map files for LLVM-based compilers.