GCC with D have been finally been released.

Johannes Pfau nospam at example.com
Wed May 8 17:25:48 UTC 2019


Am Wed, 08 May 2019 09:46:55 -0700 schrieb H. S. Teoh:
>> 
>> It is probably not necessary to be compatible on object file level, but
>> at least shared libraries need to be compatible between compilers.
>> Otherwise you will force linux distributions to choose only one
>> compiler, as nobody wants to have 3 packages for every library (one for
>> every compiler).
> 
> That's a very good point.  If we stick to platform ABI conventions (and
> we have to, and do, because that's the only way we could interoperate
> with C/C++), then in theory libraries should be compatible at the ABI
> level. But there's a grey area where D features may not have a fixed
> implementation in the platform ABI, and different compilers may
> implement such features differently, causing ABI incompatibility.

The personality functions are used by compilers for exception handling, 
but as the function itself is in druntime you will always have problems 
to use druntime of compiler X with any other code using exceptions 
compiled with compiler Y.

> 
> So I retract my statement about compiler incompatibilities.  Still, I
> ran into linker problems with '*-personality-*' symbols, which appear to
> be caused by different compiler quirks / implementation choices. But I
> only tested with object files, so perhaps that's not a fair comparison.
> I'd expect at the .so level gdc and ldc compiled code ought to be able
> to interoperate.
> 
> 
>> However, I don't think there are many compiler specific runtime hooks,
>> so it should be possible to get e.g. gdc compiled code linking to a ldc
>> compiled druntime. I guess the biggest problem here is exception
>> handling.
> [...]
> 
> What is it about exception handling that causes problems?
> 
> 
> T

The (name of the) personality functions ;-)
I guess the actual exception handling implementation might also differ a 
little between compilers. But as all compilers use libgcc's unwind 
functions on linux, AFAIK, it should be possible to merge the different 
implementations.

-- 
Johannes


More information about the Digitalmars-d mailing list