Boost logo

Boost :

From: Edward Diener (eldiener_at_[hidden])
Date: 2020-03-30 16:45:50


Embarcardero ( formerly Codegear, formerly Borland ) has had for about
five years C++ compilers based on clang, along with the venerable bcc32,
which is the Borland compiler of old through a number of
transformations. The clang-based Windows compilers are bcc32c/bcc32x for
32-bit development and bcc64 for 64-bit development. The only difference
between bcc32c and bcc32x is that the former takes the same command line
flags as their legacy bcc32 compiler while the latter, like bcc64, takes
clang command line flags. The clang-based C++ compilers are based on
clang-5.0, and use the Dinkumware library.

The clang based compilers still predefine __BORLANDC__ and __CODEGEARC__
but also predefine __clang__. The latter is the way to distinguish
in preprocessor code between the bcc32 compiler and the clang-based
compilers.

Despite numerous workarounds in Boost code based on the predefined
macros __BORLANDC__ and __CODEGEARC__ the bcc32 compiler, not being very
C++ compliant even at the C++98/C++03 level at which it operates, has
not really worked for Boost since about Boost 1.39. It is useless for
modern day Boost.

Therefore I have made efforts, in contact with some Embarcadero C++
representatives, to integrate the clang-based compilers into Boost,
especially since there is a free non-commercial offering by Embarcadero
called C++ Builder Community Edition at
https://www.embarcadero.com/products/cbuilder/starter which any Boost
developer could use to test these compilers if they wished. I am doing
this in the hopes that this may become effective for Boost 1.74.0.

Doing this involves:

1) Creating an embarcadero.jam toolset, based on the clang-linux.jam
toolset, which supports bcc32x and bcc64. Updating the borland.jam
toolset to also support bcc32c. I have done these and the PR has been
merged to 'develop' on Boost Build.

2) Updating Boost Config to support the clang-based compilers. I have
done this and the PR has been merged to 'develop' on Boost Config.

3) In the update to Boost Config, I have created these macros:

a) BOOST_BORLANDC = __BORLANDC__ with __clang__ not defined
b) BOOST_CODEGEARC = __CODEGEARC__ with __clang__ not defined
c) BOOST_EMBTC = Embarcadero C++ compilers with __clang__ defined

Therefore what is really needed in Boost libraries is to change all the
code which currently uses __BORLANDC__ to BOOST_BORLANDC and all the
code which uses __CODEGEARC__ to BOOST_CODEGEARC when Boost config has
been included. When in the rarer case that Boost config has not been
included, then __BORLANDC__ logic becomes __BORLANDC__ and !__clang__
and __CODEGEARC__ logic becomes __CODEGEARC__ and !__clang__. I am
workiog on doing this for the numerous Boost libraries with workarounds
nased on __BORLANDC__ and __CODEGEARC__ in Boost code, and will create
PRs for those libraries.

I only ask that library maintainers will merge the PRs I create once
they have passed their CI tests, since the PRs are almost all just
simple transformations regarding the __BORLANDC__ and __CODEGEARC__ in
the code. If any library maintainer wants to so this on their own in the
'develop' branch it would be appreciated.

Further points:

The Embarcadero C++ clang-based compilers are not as good as clang
itself, which is at release 9, gcc, or vc++. But they are good enough
for the majority of Boost code.

The Embarcadero C++ clang-based compilers support only C++17. The
documentation implies that they also support C++11 and C++14 but that is
not so. But since Boost libraries written for a C++ standard level are
supposed to work flawlessly at a higher level this is no impediment for
C++ Builder programmers using the Embarcadero C++ compilers in current
Boost.

I have reported a number of bugs, based on my Boost testing, for the
Embarcadero C++ compilers to Embarcadero themselves in their bug
reporting system. I believe that any registered user of their free
community edition can report bugs to Embarcadero C++ at their bug
reporting system at https://quality.embarcadero.com. Hopefully these
reports will improve the compilers.

It would really be nice, once the Embarcadero C++ clang-based compilers
are integrated into current Boost, if regression testers could test
their compilers. I will try to do so myself if I have the time and
resources. I have discussed this with some Embarcadero C++
representatives about adding the Embarcadero clang-based C++ compilers
to one or more CI testing services, but currently there are not any
which support them of which I know.

Besides the clang-based Windows compiler Embarcadero also has
clang-based C++ compilers for 32-bit and 64-bit iOS ( Apple ) and for
Android ( Google ). The code in Boost Config distinguishes between these
environments, if necessary, with further macros based off of the
mnemonic BOOST_EMBTC. It would be nice to add these configurations to
embarcadero.jam once the rest of the work is done. But I have no idea
how to test any of these other compilers as they are not part of the
Windows based Embarcardero C++ Builder Community Edition.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk