Apache OpenOffice (AOO) Bugzilla – Issue 95065
Build brakes with warning in /solver/300/unxlngi6.pro/inc/comphelper/propertycontainerhelper.hxx
Last modified: 2009-01-23 09:03:01 UTC
On Ubuntu-8.04 with gcc 4.2.3 the build brakes with this error message (see http://termite.go-oo.org/buildbot/builders/Ubuntu-8.04/builds/7/steps/Compile/logs/stdio for full log): "Making: ../../unxlngi6.pro/slo/provider.obj g++ -fmessage-length=0 -c -Os -fno-strict-aliasing -I. -I../../unxlngi6.pro/inc/api2 -I../inc -I../../source/inc/inc -I../../inc/pch -I../../inc -I../../unx/inc -I../../unxlngi6.pro/inc -I. -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc/stl -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc/external -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solenv/unxlngi6/inc -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solenv/inc -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/res -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc/stl -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solenv/inc/Xp31 -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux -I/usr/lib/jvm/java-6-sun/include/native_threads/include -I/usr/include -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc/offuh -I. -I../../res -I. -pipe -mtune=pentiumpro -fvisibility-inlines-hidden -Wall -Wextra -Wendif-labels -Wshadow -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Werror -fpic -DLINUX -DUNX -DVCL -DGCC -DC341 -DINTEL -DCVER=C341 -DNPTL -DGLIBC=2 -DX86 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=400 -DHAVE_GCC_VISIBILITY_FEATURE -D__DMAKE -DUNIX -DCPPU_ENV=gcc3 -DGXX_INCLUDE_PATH=/usr/include/c++/4.2 -DSUPD=300 -DPRODUCT -DNDEBUG -DPRODUCT_FULL -DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DCUI -DSOLAR_JAVA -DSHAREDLIB -D_DLL_ -fexceptions -fno-enforce-eh-specs -DEXCEPTIONS_ON -o ../../unxlngi6.pro/slo/provider.o /media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/configmgr/source/api2/provider.cxx cc1plus: warnings being treated as errors In file included from /media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc/comphelper/propertycontainer.hxx:34, from /media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/configmgr/source/api2/provider.hxx:46, from /media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/configmgr/source/api2/provider.cxx:33: /media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc/comphelper/propertycontainerhelper.hxx:88: warning: 'comphelper::OPropertyContainerHelper' declared with greater visibility than the type of its field 'comphelper::OPropertyContainerHelper::m_aProperties' dmake: Error code 1, while making '../../unxlngi6.pro/slo/provider.obj'" P4 as this could be easily work-arounded (disabling warning-errors).
As second module is affected: "Making: ../../unxlngi6.pro/slo/solver.obj g++ -fmessage-length=0 -c -Os -fno-strict-aliasing -I. -I../../unxlngi6.pro/inc/solver -I../inc -I../../inc/pch -I../../inc -I../../unx/inc -I../../unxlngi6.pro/inc -I. -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc/stl -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc/external -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solenv/unxlngi6/inc -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solenv/inc -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/res -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc/stl -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solenv/inc/Xp31 -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux -I/usr/lib/jvm/java-6-sun/include/native_threads/include -I/usr/include -I/media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc/offuh -I. -I../../res -I. -pipe -mtune=pentiumpro -fvisibility-inlines-hidden -Wall -Wextra -Wendif-labels -Wshadow -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Werror -fpic -DLINUX -DUNX -DVCL -DGCC -DC341 -DINTEL -DCVER=C341 -DNPTL -DGLIBC=2 -DX86 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=400 -DHAVE_GCC_VISIBILITY_FEATURE -D__DMAKE -DUNIX -DCPPU_ENV=gcc3 -DGXX_INCLUDE_PATH=/usr/include/c++/4.2 -DSUPD=300 -DPRODUCT -DNDEBUG -DPRODUCT_FULL -DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DCUI -DSOLAR_JAVA -DSHAREDLIB -D_DLL_ -fexceptions -fno-enforce-eh-specs -DEXCEPTIONS_ON -o ../../unxlngi6.pro/slo/solver.o /media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir_m33/sccomp/source/solver/solver.cxx cc1plus: warnings being treated as errors In file included from /media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc/comphelper/propertycontainer.hxx:34, from /media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir_m33/sccomp/source/solver/solver.hxx:40, from /media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir_m33/sccomp/source/solver/solver.cxx:38: /media/sdb1/buildbot/slavedir/Ubuntu-8.04/workdir/solver/300/unxlngi6.pro/inc/comphelper/propertycontainerhelper.hxx:88: warning: 'comphelper::OPropertyContainerHelper' declared with greater visibility than the type of its field 'comphelper::OPropertyContainerHelper::m_aProperties'"
fs->christianlins: Hmm? Any idea what this warning talks about? To me it sounds like the compiler complaints that OPropertyContainerHelper is declared as COMPHELPER_DLLPUBLIC, while OPropertyContainerHelper::Properties isn't. Something like that. In this case, I refuse to fix it, but suggest disabling the particular compiler warning (but not warnings globally), since it is nonsense here (in my understanding).
I think this has something to do with the gcc Visibility feature explained here (http://gcc.gnu.org/wiki/Visibility). I rebuild with -fvisibility=hidden globally enabled and voila all these errors disappeared. But on the other hand new linker errors occurred, probably because some public methods were not properly exported. I will try to add -fvisibility=hidden to every module makefile where appropriate.
-fvisibility=hidden is dangerous, as it can make C++ exception handling fail (see <http://gcc.gnu.org/wiki/Visibility#head-c0223cccb6d47c73ab4fbd367b0a8dc032eb7112>). C++ exceptions representing UNO exceptions would be safe (as the code generated by cppumaker uses CPPU_GCC_DLLPUBLIC_EXPORT and CPPU_GCC_DLLPRIVATE), but other exceptions could cause problems (e.g., tags/DEV300_m33/sal/inc/rtl/malformeduriexception.hxx@262087).
I noticed that comphelper is actually compiled with -fvisibility=hidden. This is probably the reason why this module did not break, but the header files are included in at least seven or eight modules.
-fvisibility=hidden apparently got into comphelper through issue 38608
I think it is necessary to resolve this once and for all ;-) Any volunteers? If we cannot resolve this properly, I could submit a few (not safe, but working) work-arounds...
-fvisibility=hidden is indeed already used in many modules; this had temporarily escaped me. A proper fix for this issue needs to address three things: 1 Enable -fvisibility=hidden in modules that cause warnings (=errors) with GCC 4.2 (at least configmgr and sccomp), to remove the warnings. These modules typically use linker map files to determine their exports; the relevant symbols need to be decorated with SAL_DLLPUBLIC_EXPORT/IMPORT in the source code, so that they are still exported despite -fvisibility=hidden (and the linker map file should still be used, so that the symbols get the correct versioning; at least an experiment I just conducted showed that SAL_DLLPUBLIC_EXPORT + -fvisibility=hidden + linker map file preserved the symbol versioning specified in the linker map file). 2 Broken C++ exception classes like rtl::MalformedUriException need to be fixed, so that they work reliably in all modules using -fvisibility=hidden (old and new). This is moved out to issue 95428. 3 It has to be evaluated that any external C++ exception classes (from std:: and maybe elsewhere) are similarly safe. (I *think* I evaluated that before, but cannot right now find any notes.)
Rising priority to P2 as this now affects not only Ubuntu Hardy 32bit but after the last updates Ubuntu Hardy (32bit and 64bit) and the new Ubuntu Intrepid. I assume this affects every gcc versions greater gcc/4.2.3 in at least six modules. Correct me if I am wrong.
.
see follow up issue 96897 and issue 96898 to reduce exported symbols of newly VISIBILITY_HIDDEN=TRUE libraries
fixed on <http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fsb102>
builds fine on unxlngi6.pro with vanilla GCC 4.3.2