openoffice-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Don Lewis <truck...@FreeBSD.org>
Subject Re: build breaker/Issue 126449/ svx module
Date Sun, 30 Aug 2015 02:05:43 GMT
On 14 Aug, Andrea Pescetti wrote:
> On 09/08/2015 Don Lewis wrote:
>> Looks like you are compiling with gcc 4.9.  I ran into this same problem
>> on FreeBSD and worked around it by changing the "-Os" optimization flag
>> ... This is a gcc bug, see:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65009
> 
> This looks like very valuable information (I never saw this, but I build 
> with gcc 4.8.x most of the times). Could you expand on it a bit?

It apparently is an optimizer bug in gcc 4.9 that has been fixed in gcc
5 and was not present in 4.8.  It is sometimes triggered by inline
virtual class methods.  I believe it only happens with -Os optimization.
The workaround is to either disable optimization by using
"-O0", or disabling the problematic optimization step by using
"-fno-devirtualize -fno-devirtualize-speculatively", which I figured out
based on comment #2 in the gcc bug report.  I didn't attempt to figure
out if only one of the flags would be sufficient.

> Do I understand correctly from the above issue than anybody building 
> OpenOffice (I'm obviously particularly interested in the coming 4.1.2) 
> with GCC 4.9.0 to 4.9.3 (and possibly later 4.9.x releases, since the 
> issue is not fixed yet in 4.9.x) will have to manually edit their makefiles?

Yes.

> If this is true, would you recommend that we either detect it at 
> configuration time, or modify the makefiles, or anything else?

It would be nice to detect it at configuration time, but configure
doesn't really look at the compiler version.  One half of the build
framework does decipher the compiler version and that could be leveraged
to change the optimization flags for gcc 4.9, but the other half of the
build framework does not.  Unfortunately there are two instances where
this is broken, and the fix needs to be done in both places.

I maintain the FreeBSD port and the approach that I took for package
building is to detect the use of gcc 4.9 in the port Makefile, and then
patch the freebsd.mk and unxfbsdi.mk on the fly when gcc 4.9 is
detected.  I didn't need to patch unxfbdx.mk because it uses -O2
optimization on x86_64.

> Is this related to https://bz.apache.org/ooo/show_bug.cgi?id=125475 
> (where a patch by Ariel is available, but operates at a C++ code level 
> and not at a Makefile level)?

Yes.  Early on I saw the LibreOffice folks do something similar, but I
was not able to get that to work reliably and switched to -O0
optmization for a long time.  My workaround above is fairly recent.

> Sorry for the many questions! At the bare minimum, it would be very 
> helpful if you can update the building guide at 
> https://wiki.openoffice.org/wiki/Documentation/Building_Guide_AOO/Step_by_step 
> with some specific information; I know you build on FreeBSD which is not 
> one of the platforms we provide binaries for, but you can add a whole 
> section about it if you like. If you need a wiki account, just ask here.

It would really be nice if this just worked out of the box.  For the
stuff that uses solenv/inc to build, the compiler version is available
in $(CCNUMVER), which can be tested in the target .mk files to adjust
the optimization flags.  Unfortunately $(CCNUMVER) is not available on
the solenv gbuild side.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Mime
View raw message