-mms-bitfields revisited

Till Adam adam at kde.org
Mon Jun 22 11:53:23 CEST 2009


On Wednesday 17 June 2009 17:55:58 Patrick Spendrin wrote:
> Bernhard Reiter schrieb:
> > Am Dienstag, 16. Juni 2009 14:08:57 schrieb Ralf Habacker:
> >>> It basically tell
> >>> gcc to be msvc compatible, for C libs, if I understand correctly, and
> >>> should cause no harm, provided everything is built with it
> >>> consistently.
> >
> > Or rephrased differently, using the machine flag "-m" set to
> > "ms-bitfields" the resulting binary will be compatible with the ABI of
> > windows (aka dlls from Microsoft-Compilers).
> >
> > http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Type-Attributes.html#i386-Typ
> >e-Attributes :
> >
> >     Currently -m[no-]ms-bitfields is provided for the Microsoft Windows
> > X86 compilers to match the native Microsoft compiler.
> >
> > (Credits go to Werner and Marcus for explaining the issue to me.)
> >
> >>> Let me know how I should proceed with this. This then leaves the
> >>> question of Qt. Nokians, any opinion on that? Is it maybe even already
> >>> in there, the flag?
> >>
> >> According to http://code.google.com/p/cocotron/issues/detail?id=137
> >> adding this option will result into an binary incompatible change, which
> >> means *all* packages affected by this BIC should be rebuild at the same
> >> time.
> >
> > Yes.
> >
> > The problem mainly will create problems with using C libraries using
> > somehow packed bitfields in structs or so and of course both sides using
> > a different ABI.
> >
> > It might be that current builds of KDE (without the right ABI) on windows
> > interfacing with DLLs in the microsoft compiler layout will have somehow
> > hidden defects because of this issue already.
>
> The following problems I do see with this change:
> 1) binary compatible problems shouldn't be a problem themselves. The
> much bigger question is the following: We do use libraries from third
> parties for the obvious sake of not needing to care about them on our own.
> Do we need to recompile those (that might not be compiled with
> ms-bitfield)? If yes how can we check which are needed to be recompiled?
> And who can shoulder these rebuilds?
> I would prefer to have those questions answered before changing this.

Yes, we do need to rebuild them all, it seems. I've done a full build of 
everything with the flag, everything that we currently build from source, that 
is, and with that any and all kde apps crash on startup. So something in there 
is still mismatching and biting us. Allen has started the ardeous task of 
assembling source-based emerge targets for everything, so that one day we 
should get to the point of making everything build with whatever flags we need 
and also gain the ability to properly distributed our binaries with the exact 
sources that were used to build them. This won't happen over night, but we are 
working on it.

For the short term, the immediate problem (gpgme) has been solved by 
introducing the flag to kdepimlibs/gpgme++ and there only, which seems to make 
things work and not break anything (so far, knock on wood).

Thanks for your help, Patrick,

Till 

-- 
Till Adam <adam at kde.org>


More information about the Kde-windows mailing list