Issue 95065 - Build brakes with warning in /solver/300/unxlngi6.pro/inc/comphelper/propertycontainerhelper.hxx
Summary: Build brakes with warning in /solver/300/unxlngi6.pro/inc/comphelper/property...
Status: CLOSED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: code (show other issues)
Version: DEV300_m33
Hardware: PC Linux, all
: P2 Trivial with 2 votes (vote)
Target Milestone: OOo 3.1
Assignee: Stephan Bergmann
QA Contact: Unknown
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-17 12:16 UTC by christianlins
Modified: 2009-01-23 09:03 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description christianlins 2008-10-17 12:16:19 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).
Comment 1 christianlins 2008-10-17 12:54:52 UTC
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'"
Comment 2 Frank Schönheit 2008-10-19 22:09:03 UTC
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).
Comment 3 christianlins 2008-10-20 16:46:39 UTC
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.
Comment 4 Stephan Bergmann 2008-10-21 09:24:22 UTC
-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).
Comment 5 christianlins 2008-10-21 12:22:48 UTC
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.
Comment 6 Stephan Bergmann 2008-10-21 12:50:01 UTC
-fvisibility=hidden apparently got into comphelper through issue 38608
Comment 7 christianlins 2008-10-22 16:17:30 UTC
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...
Comment 8 Stephan Bergmann 2008-10-24 17:05:17 UTC
-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.)
Comment 9 christianlins 2008-11-04 17:15:14 UTC
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.
Comment 10 Stephan Bergmann 2008-11-12 09:05:36 UTC
.
Comment 11 Stephan Bergmann 2008-12-04 14:54:22 UTC
see follow up issue 96897 and issue 96898 to reduce exported symbols of newly
VISIBILITY_HIDDEN=TRUE libraries
Comment 12 Stephan Bergmann 2008-12-12 12:09:15 UTC
fixed on <http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fsb102>
Comment 13 Stephan Bergmann 2008-12-12 12:42:20 UTC
builds fine on unxlngi6.pro with vanilla GCC 4.3.2
Comment 14 Stephan Bergmann 2009-01-23 09:03:01 UTC
.