[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [porting-dev] Compiling Error in PPC with gcc-3.2



Hi,

I think there is some misunderstanding.

Our OOo tree officially has the following in it in memmgr.cxx

std::new_handler
SAL_CALL std::set_new_handler (std::new_handler pfnHandler)  throw ()
{
        std::new_handler f = g_pfnHandler;
        g_pfnHandler = pfnHandler;
        return f;
}

But for some reason your version is showing the "throw ()"" commented out.  
I posted a gcc 3.1.1 patch that did exactly this but it should have never 
made it into any tree since all it did was workaround a gcc 3.1.1 pre 
compiler problem (gcc headers never had the throw() which was actually 
spec (set_new_handler may not throw any exceptions according to the rules) 
but gcc was never picky about the throw specifier before 3.1.1 pre.

So please back out the patch in memmgr.cxx (probably that came from my gcc 
3.1.1 patch) that comments out the throw() on the set_new_handler code (to 
make it look like it did previously) and you should be fine.

Hope this explains things in more detail.

Kevin


On August 7, 2002 09:18, Jan-Hendrik Palic wrote:
> Hi Debian-GCC team and OpenOffice.org people ..
>
> I got this error while compiling OOo with gcc-3.2:
>
> g++-3.2 ..[snip]..  -o ../../unxlngppc.pro/obj/memmgr.o
> /home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/build-
>tree/oo_1.0.1_src/tools/source/memmgr/memmgr.cxx
> /home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/build-
>tree/oo_1.0.1_src/tools/source/memmgr/memmgr.cxx: In function `void (*
> std::set_new_handler(void (*)()))()':
> /home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/build-
>tree/oo_1.0.1_src/tools/source/memmgr/memmgr.cxx:126: declaration of
> `void (* std::set_new_handler(void (*)()))()' throws different
> exceptions /usr/include/c++/3.2/new:65: than previous declaration `void
> (* std::set_new_handler(void (*)()) throw ())()' dmake:  Error code 1,
> while making '../../unxlngppc.pro/obj/memmgr.obj'
>
> I mailed it to the dev@porting.openoffice.org people and Kevin figured
> out, that this could be a gcc-3.2 issue since gcc-3.1.1
>
> Building OpenOffice.org with gcc-3.1.1 from debian works fine (I have
> running at on my IBook .. it works) .. but with gcc-3.2 fails ...
>
> here is the code, which should wrong (from OpenOffice.org-1.0.1
> tarball):
>
> static std::new_handler volatile g_pfnHandler = 0;
>
> std::new_handler
> SAL_CALL std::set_new_handler (std::new_handler pfnHandler)
> //      throw ()
> {
>         std::new_handler f = g_pfnHandler;
>         g_pfnHandler = pfnHandler;
>         return f;
> }
>
> So, I cannot apply the patch below ....
>
> My question is, is it a gcc-3.2 issue or perhaps, is it a OpenOffice.org
> issue.
>
> I looked to the link below about the gcc issue and it seems, that this
> patch is allready applied and I wonder, if the debian-gcc does not
> contain this patch.
>
> Anyone a hint?
>
> 	regards
> 			Jan
>
> On Tue, Aug 06, 2002 at 11:12:19AM -0400, Kevin B. Hendricks wrote:
> >Hi,
> >
> >AFAIK this is a gcc problem with 3.1.1-pre series.  Here is the patch I
> >used (it is wrong the real fix belongs in the headers and code for gcc)
> > to work around the problem.
> >
> >Index: source/memmgr/memmgr.cxx
> >===================================================================
> >RCS file: /cvs/util/tools/source/memmgr/memmgr.cxx,v
> >retrieving revision 1.5
> >diff -u -r1.5 memmgr.cxx
> >--- source/memmgr/memmgr.cxx    15 Oct 2001 18:40:32 -0000      1.5
> >+++ source/memmgr/memmgr.cxx    11 Jul 2002 14:25:04 -0000
> >@@ -121,7 +121,7 @@
> > static std::new_handler volatile g_pfnHandler = 0;
> >
> > std::new_handler
> >-SAL_CALL std::set_new_handler (std::new_handler pfnHandler) throw ()
> >+SAL_CALL std::set_new_handler (std::new_handler pfnHandler) /* was
> >throw ()*/
> > {
> >        std::new_handler f = g_pfnHandler;
> >        g_pfnHandler = pfnHandler;
> >
> >
> >But see gcc issue:
> >
> >http://gcc.gnu.org/ml/gcc-patches/2002-07/msg00619.html
> >
> >For the gcc patch.
> >
> >Kevin
> >
> >On August 6, 2002 10:55, Jan-Hendrik Palic wrote:
> >> Hi ..
> >> Hi Kevin :)
> >>
> >> I started to build build OpenOffice.org with gcc-3.2, since the
> >> gcc-maintainers of Debian announced, that they are plan to switch to
> >> gcc-3.2 as default compiler ....
> >>
> >> I got this ...
> >>
> >> g++-3.2 -fsigned-char -fmessage-length=0 -c -I. -I. -I../inc
> >> -I../../inc -I../../unx/inc -I../../unxlngppc.pro/inc -I.
> >> -I/home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/b
> >>uil d-tree/oo_1.0.1_src/solver/641/unxlngppc.pro/inc/stl
> >> -I/home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/b
> >>uil d-tree/oo_1.0.1_src/solver/641/unxlngppc.pro/inc/external
> >> -I/home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/b
> >>uil d-tree/oo_1.0.1_src/solver/641/unxlngppc.pro/inc
> >> -I/home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/b
> >>uil d-tree/oo_1.0.1_src/solenv/unxlngppc/inc
> >> -I/home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/b
> >>uil d-tree/oo_1.0.1_src/solenv/inc
> >> -I/home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/b
> >>uil d-tree/oo_1.0.1_src/res -I/usr/include
> >> -I/home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/d
> >>ebi an/local/stlport-home/stlport
> >> -I/home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/d
> >>ebi an/local/stlport-home/include/stlport
> >> -I/home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/d
> >>ebi an/local/stlport-home/include/stlport
> >> -I/home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/b
> >>uil d-tree/oo_1.0.1_src/solenv/inc/Xp31 -I/usr/lib/j2se/1.3/include
> >> -I/usr/lib/j2se/1.3/include/linux
> >> -I/usr/lib/j2se/1.3/include/native_threads/include
> >> -I/usr/X11R6/include -I/usr/lib/gcc-lib/powerpc-linux/3.2/include
> >> -I/usr/include     -I. -I../../res -I. -O2 -fno-schedule-insns
> >> -fno-strict-aliasing -fno-schedule-insns2   -fsigned-char -pipe
> >> -fno-for-scope -fpermissive -fno-rtti -fexceptions
> >> -fno-enforce-eh-specs   -fPIC  -DLINUX -DUNX -DVCL -DGCC -DC300
> >> -DPOWERPC -DCVER=C300 -D_USE_NAMESPACE -DGLIBC=2 -D_PTHREADS
> >> -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1
> >> -DSTLPORT_VERSION=400 -DPOWERPC -DPPC -D__DMAKE -DUNIX
> >> -DCPPU_ENV=gcc3 -DSUPD=641 -DBUILD=7663 -DPRODUCT -DNDEBUG
> >> -DPRODUCT_FULL -DOPTIMIZE -DEXCEPTIONS_ON -DCUI -DSOLAR_JAVA -DSRC641
> >>  -DMULTITHREAD  -w -o ../../unxlngppc.pro/obj/memmgr.o
> >> /home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/bui
> >>ld- tree/oo_1.0.1_src/tools/source/memmgr/memmgr.cxx
> >> /home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/bui
> >>ld- tree/oo_1.0.1_src/tools/source/memmgr/memmgr.cxx: In function
> >> `void (* std::set_new_handler(void (*)()))()':
> >> /home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/bui
> >>ld- tree/oo_1.0.1_src/tools/source/memmgr/memmgr.cxx:126: declaration
> >> of `void (* std::set_new_handler(void (*)()))()' throws different
> >> exceptions /usr/include/c++/3.2/new:65: than previous declaration
> >> `void (* std::set_new_handler(void (*)()) throw ())()'
> >> dmake:  Error code 1, while making
> >> '../../unxlngppc.pro/obj/memmgr.obj' ---* TG_SLO.MK *---
> >>
> >> ERROR: Error 65280 occurred while making
> >> /home/palic/Files/Projekte/OpenOffice/debian/openoffice.org-1.0.1/bui
> >>ld- tree/oo_1.0.1_src/tools/source/memmgr dmake:  Error code 1, while
> >> making 'build_all'
> >>
> >>
> >> Any hints
> >>
> >> 	Regards
> >> 		Jan



Reply to: