What's New in C++Builder 10.2: Part 1 - The Linker

Posted by on in Blogs

RAD Studio 10.2 Tokyo will be out very soon, and I'd like to let you know some of what you can expect to see new on the C++Builder side.  While the majority of work is for Linux, which will be available for C++ in 10.2.1, we've worked on three key areas:

  1. Improved linking
  2. Improved code generation
  3. Improved debugging

Today I want to discuss what's new in the linker.

The Win32 and Win64 linker

The Win32 linker, which we also use for Win64, is one of the oldest technologies we still use, and until today in recent years it hasn't had much work done on it.  As time has passed the applications people are writing, and so the data that needs to be linked, has changed significantly.  Today's apps are larger, with more debug info and importantly larger quantities of certain types of debug info than they were when the linker was first written. This led to problems allocating space for and handling large linksets. Sometimes, the problem was not the size of a specific type of data, so much as that the size was more than had been predicted in relation to other types when the linker was written.

We have addressed this in 10.2 in two ways:

  • The linker is now large address aware and can address up to 4GB on a 64-bit system, twice the previous amount. (Some customers hacked the linker to be LAE in the past by toggling the bit in the PE header; since the code wasn't written to be LAE-aware this hack prevented incremental linking and sometimes other functionality from functioning correctly.)
  • The linker has been tuned to modern debug usage.  That is, the various pools and heaps it uses have been modified to follow typical behaviour for debug information today.

The second means that many linksets that experienced problems will now link correctly. The first means that linksets that stressed the heap allocations, even when manually tweaked via command-line flags, can now access much more memory and link correctly. We hope to see the vast majority of linker errors solved with these two changes.

The vast majority? What if that's not me?

Glad you asked! In the past, we recommended users use command-line flags to change the allocation size of various pools or heaps.

Those flags are still available, and we have expanded their support. The settings are now available in the IDE's project options (C++ Linker > Linker Heap Settings) with some options for Win32 linking, and more for Win64 linking:

If you encounter an error, the linker will emit a message stating what failed, and you can look up the appropriate option here to set a specific size. (Note if you're building in the IDE, you may need to set Verbosity to Diagnostic in Tools > Options > Environment Options.) However, the vast majority of users will not need to use these settings - they are there as a backup.

Future plans

We plan to continue working on the linker in future over the next few releases. If you have update subscription, you will get all changes as they are released. However, in 10.2, we've taken a large step in addressing issues customers have experienced. We hope that when you test out your projects with 10.2, you will find significantly improved behaviour.

 



About
Gold User, No rank,
C++ Product Manager, looking after C++Builder as well as the IDE.

Comments

  • Max K34801
    Max K34801 Friday, 24 March 2017
  • David Millington
    David Millington Friday, 24 March 2017

    Hopefully, or if not then soon - we have ongoing work in the linker planned to address any remaining issues or problems that specific customers still encounter.

  • Mark J691
    Mark J691 Thursday, 23 March 2017

    There are still problems - check out https://quality.embarcadero.com/browse/RSP-11737

  • David Millington
    David Millington Friday, 24 March 2017

    I see a comment in that thread that someone is still encountering problems - but unfortunately nothing to help us reproduce them. If you still have problems, please attach a repro project, or if it's commercially sensitive get in touch and we can arrange a private upload of the linkset only.

  • Semih Ozmen
    Semih Ozmen Wednesday, 22 March 2017

    It is great to hear this improvement. I will keep you informed about our experiences with our large projects facing these problems.

  • Lena I2199
    Lena I2199 Saturday, 18 March 2017

    Good news!
    When servises for android in C++ Builder?
    Thanks.

  • David Millington
    David Millington Monday, 20 March 2017

    They're not in this release, but I hope soon! It's a common request.

  • Reinaldo Guedes
    Reinaldo Guedes Friday, 17 March 2017

    Awesome!
    Is that new linker based on LLD (LLVM linker)?
    Is there support for COFF libraries?

  • David Millington
    David Millington Monday, 20 March 2017

    Hi Reinaldo - it's the same linker, but improved. So no support for COFF for Win64, I'm afraid. (What's your use case here - linking MSVC- or ICC-built libraries?)

  • Reinaldo Guedes
    Reinaldo Guedes Monday, 20 March 2017

    Hi David, some cases we need to link to MSVC libraries but we can´t because of the patterns of import libraries are different (OMF x COFF).
    In our case, this occurs mainly with Visibroker(Ex Borland), which in distant past was distributed along with C++ Builder 6 Enterprise. Today, unfortunately only MSVC is in Microfocus roadmap and we have to request migrations every time we need to upgrade our C++ Builder. The same problem occours in other small cases. Binary compatibility with MSVC libraries already exists for CLANG/LLVM, so we had hoped that C++ Builder would inherit this feature.

    King Regards,
    Reinaldo Guedes

  • David Millington
    David Millington Tuesday, 21 March 2017

    Is it a C or C++ library, and does it expose C++ classes?

    Supporting the object format is only one step in compatibility, even if the class layout is the same (which is a big if.) STL versions and compatibility, memory allocation, specific RTL functions...

  • Please login first in order for you to submit comments
  • Page :
  • 1

Check out more tips and tricks in this development video: