On Thu, 12 Apr 2001, Juergen Vigna wrote:

> To tell you the truth I compiled with optimization on and don't get the segfault
> anymore, but don't ask me at what time this happend, in all the changes, backchanges
> tries, remove tries, other go, ... ;)
> 

perhaps you altered the size of InsetText at some point ?

I got gcc 2.96-80 working (me being silly), and the bug doesn't
occur. So I think the patch below or similar should go into
CVS.

Also, I've got a little further with my gcc 3.0 troubles. It seems
c_str() + friends are NOT being inlined, but are being included
verbatim (i.e. T in the nm symbol output). This obviously leads
to the multiply-defined problems.

However, the pre-processed output seems normal. It is being caused
by the use of stringstream.str().c_str() in e.g. tostr() template.
Removing the c_str() stops the problem. Now obviously we can't do that
because of lyxstring, ... so is this a compiler bug or our problem ?[1]

thanks
john

[1] perhaps I'm now compiler-bug happy ;)


Index: INSTALL
===================================================================
RCS file: /home/moz/cvs/lyx-devel/INSTALL,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 INSTALL
--- INSTALL     2001/03/19 22:51:19     1.1.1.1
+++ INSTALL     2001/04/12 15:51:26
@@ -325,6 +325,13 @@
     If you your version of gcc-c++ is > 2.96-69, you may not need to do
     this.
 
+  o If you are using RedHat 7.0, optimisation of the lyx binary is 
+    disabled by default due to a compiler bug in their version of gcc.
+    If you are using the gcc rpm version of 2.96-80 or above, the bug 
+    has been fixed and optimisation can be re-enabled. Note that LyX 
+    will not compile correctly with a gcc rpm version of less than 
+    2.96-69.
+
   o It is possible to compile lyx with Tru64 Unix cxx compiler
     version 6.2, provided one uses
        CXX='cxx -std strict_ansi'
Index: config/lyxinclude.m4
===================================================================
RCS file: /home/moz/cvs/lyx-devel/config/lyxinclude.m4,v
retrieving revision 1.2
diff -u -r1.2 lyxinclude.m4
--- config/lyxinclude.m4        2001/04/05 20:03:02     1.2
+++ config/lyxinclude.m4        2001/04/12 15:56:53
@@ -206,7 +206,10 @@
       2.95.1)  CXXFLAGS="-g $lyx_opt -fpermissive -fno-rtti -fno-exceptions";;
       2.95.2)  CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
       2.95.*)  CXXFLAGS="-g $lyx_opt -fno-exceptions";;
-      2.96*)  CXXFLAGS="-g $lyx_opt -fno-exceptions";;
+dnl we can't optimise on 2.96 due to RH's buggy compiler.
+dnl 2.96-80 is OK. It is probably worth checking __VERSION__
+dnl so RH7.1 and above can compile with optimisation
+      2.96*)  CXXFLAGS="-g -fno-exceptions";;
       3.0*)    CXXFLAGS="-g $lyx_opt";;
       *2.91.*) CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;
       *)       CXXFLAGS="-g $lyx_opt -fno-rtti -fno-exceptions";;

Reply via email to