Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
C++ModernizationNewsRAD StudioWindows

The new Clang Toolchain in C++Builder 12.1!

The new Clang Toolchain in C++Builder 12.1!

RAD Studio 12.1 has big news: we have released the first version of our new Clang-based toolchain! This is a complete revision of the entire technology stack, and provides a solid, modern, ‘done the right way’ foundation for all of C++ going forward.

Technical Info

The new toolchain targets Windows 64-bit Intel apps, and is based on Clang 15, with a new STL, a new C++ runtime, and uses the Windows Universal C Runtime (UCRT.) It has a new linker, and uses the COFF and PDB object and debug file formats. For more information, see the second Behind the Build webinar from just a few weeks before 12.1 released. We also have documentation on upgrading with key things to know.

All binaries (the compiler, linker etc) are 64-bit EXEs, meaning they can handle large memory requirements – and you’d be surprised how often this is needed for C++. This even includes when compiling in the IDE, where we call out to the external process.

Clang: a solid foundation, reaching for the future

What does it provide?

The toolchain has a focus on quality above features (it is version 1, but we want what we release to be solid), on doing things right and making the right choices, on resolving the key areas through that quality that affect you, and on setting C++Builder up for a really exciting future.

Examples of the right choices:

  • We are using the platform standard COFF object file format
  • We are using the platform standard PDB debug file format (this should allow you to use other specialised debuggers, if you need)
  • Making heavy use of open source software, such as LLVM’s STL (libc++)
  • Removing duplicate efforts: we used to have our own C runtime, but there’s one built into Windows now (the UCRT); we use that
  • Shipping both the old Win64 toolchain and the new one side by side in the IDE (yes, both are there!), so you can upgrade and test moving from old to new just by toggling platform. This should really help upgrading: there’s no sudden, required switch.

Examples of quality in areas that affect you:

  • The linker: there should be no more memory issues, it’s the same linker used to build Chrome
  • The linker: it’s about four times faster than the old ilink
  • The STL: a complete replacement, with a high-quality STL with excellent standards test results

Examples of setting up for the future:

  • Recent version of Clang, and much easier to keep up to date (the only reason it’s not the absolute latest now is to reduce multiple moving targets)
  • Platform standards look towards interoperability
  • Open source STL looks towards constant (ongoing) quality and features
  • Etc.

Examples of quality above features:

  • A very strong focus on C++ standards compliance: mid-last-year, nine months before release, we were already passing many more tests than our previous old toolchain
  • A very strong focus on additional quality: we had a special focus on exception handling, where not only do we pass multiple test suites but we created over 700 new tests for various scenarios ourselves

What has it not got?

Quality above features means that version 1 does not include everything. The notable absences are that packages can only be statically linked, not dynamically linked, in this release; packages built in C++ must similarly be statically linked (ie built as .libs) currently; and we don’t yet have CMake support. We’re also in the process right now of updating libraries on GetIt, like Boost. Read this blog post for info on plans for these features, and common tasks and how to achieve them.

We recommend using the toolchain unless these are blockers for you due to its greatly increased overall quality.

What has it got?

Huge benefits! We are closing tickets left, right and center because code that did not work in the past, works now.

Try it out for a new, fast linker. A new, high quality STL (ever had issues with std::variant or other types? Try it now.) Using the PDB format, if you want to use, eg, WinDbg. Huge C++ compatibility: if you need to compile 3rd party code, use this toolchain. You get the idea!

The future

Windows 64 bit Modern added as a target platform'Windows 64-bit Modern' added as a target platformThis is a foundational release and we really want you to try it out! Remember, when you install RAD Studio or C++Builder, both the old and new Win64 toolchains are available at the same time, in parallel. Just add the new one to your projects (in the Projects view, right-click, Add Platform, ‘Win64 Modern’) and you can then toggle back and forth between them by double-clicking the platform target you want.

We do intend to remove the old Win64 toolchain in future once we ship dynamic packages, so we recommend taking advantage of the current parallel toolchains as an upgrade feature.

We hope you’re as excited by this release as we are. While we know it’s a version 1, in terms of quality it’s a solid version 1 and we’re really keen to see you try it out and test it against your code… and see what you can achieve now that you couldn’t before!

 


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

David is an Australian developer, currently living in far-north Europe. He is the senior product manager for C++ at Idera, looking after C++Builder and Visual Assist.

1 Comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES