[mapguide-internals] mapguide 2 trunk cmake patches andinstructions - with links instead of patches

Helio Chissini de Castro helio at kde.org
Thu Oct 23 16:56:56 EDT 2008


On Quinta 23 Outubro 2008 17:34:22 Helio Chissini de Castro wrote:
> Hi
>
> Except for Geos one, most of the changes of headers are done due new gcc
> been more restrictive on their requires ( not confuse with -pedantic ) and
> i prefer avoid use flag to "compat" old code, enabling me to fix this
> compile issues.
>
> But i even avoid now to use the most common new flags used in distros
> today, like --as-needed and --no-undefined
>
> Believe me, we will have some unpleasant surprises if you add this ones ion
> current mg build :-(
>
> []'s

Just for clarify what i means about unpleasant surprises, a quick example,
compiling with -Wl, --as-needed and -Wl,--no-undefined in linker flags we fall 
in:

...
Linking CXX shared library libMgServerTileService.so                       
CMakeFiles/MgServerTileService.dir/ServerTileServiceBuild.cpp.o: In function 
`MgServerTileService::ClearMapCache(std::basic_string<wchar_t, 
std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)':                                                                                                                
ServerTileServiceBuild.cpp:(.text+0x5db): undefined reference to 
`MgLogManager::GetInstance()' 

libMgServerTileService need MgLogManager, which is part of libMgServerManager, 
so lets add that as depends

compiling again
....
Scanning dependencies of target MgServerManager
Linking CXX shared library libMgServerManager.so
CMakeFiles/MgServerManager.dir/ServerManagerBuild.cpp.o: In function 
`MgServiceManager::NotifyTileServiceOnResourcesChanged(MgSerializableCollection*, 
bool)':
ServerManagerBuild.cpp:(.text+0x282f1): undefined reference to `typeinfo for 
MgServerTileService'
CMakeFiles/MgServerManager.dir/ServerManagerBuild.cpp.o: In function 
`MgServiceManager::NotifyFeatureServiceOnResourcesChanged(MgSerializableCollection*, 
bool)':

And now we see that libMgServerManager depends on MgServerTileService

A cyclic dependency between two shared libs
Mg is working today because is using blind compilation for symbols assuming 
that will be there after everything is finished, but if you just tweak right 
flags, we fall in this design flaw.

The pratical solution would be static libraries, but then we will need do 
whole mg static :-(

-- 
Helio Chissini de Castro
KDE Project
Brasil and South America Primary Contact


More information about the mapguide-internals mailing list