Re: [Cppcms-users] cppcms unclear issues and philosophy
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-06-18 21:24:16
|
----- Original Message ----- > From: Markus Raab <us...@ma...> > To: cpp...@li... > Cc: > Sent: Monday, June 18, 2012 11:48 PM > Subject: Re: [Cppcms-users] cppcms unclear issues and philosophy > > Hi! > > Artyom Beilis wrote: >> No, because if I use boost under the hood user will still have >> ABI incompatibilities. For example I use some boost code >> under hidden cppcms_boost namespace (boost with renamed namespace) >> but it is not exposed and I have to use alternative namespace > > Could you explain why this hidden cppcms_boost namespace is needed? In which > situation does it differ to static linkage? > It is very different. Even if I for example link statically with some boost::foo it symbol would appear in the code (even if it is not in interface) and if the application uses boost::foo as well and their ABI is different you would get a crash because the linker would resolve it to one of the boost::foo's and the other would be broken. Same valid for ELF dynamic linking as well. So the only way to make things safe is to change the namespace name. Also it does not 100% save you as sometimes in Boost there are some symbols not-previxed with boost (they are removed from cppcms_boost explicitly) That is for example what ICU does. All ICU classes are put into icu_xx_yy namespace with alias namespace icu = icu_xx_yy. All ICU C functions are postfixed with _xx_yy for example u_foo goes to u_foo_1_49. This saved me not once when headers were different from the actual library versions - happens when you tinker with multiple versions. >> Even if boost is not in interface you will have ABI problems >> if somebody accidentally uses for example boost.1.46.1 instead >> of boost.1.46 that cppcms is compiled with... > > Of course, but is changing the namespace needed to tackle this issue? > Unfortunately, Yes. Even boost provides a tool for that - BCP. > Do you use tools/rename.py for the renaming? > Yes - it is the primary tool. Also its most common use is to rename boost::locale to booster::locale. (Also note rename.py predates boost BCP namespace renaming support, and it works smarter than BCP) Note, internal cppcms_boost is boost 1.39 with some bug fixes back-ported from the latest versions. And because It is not exposed such fixes are not hard. > best regards > Markus > Best, Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |