Apache OpenOffice (AOO) Bugzilla – Issue 12442
Clean up of configure - create a symbols switch
Last modified: 2013-08-07 15:35:14 UTC
The current build process has two major errors: a) gcc 3.2 needs no-rtti removed. b) The size of the build has tripled. The attached patch cleans this up and removes some cruft from the code.
Created attachment 5130 [details] patch file for config_office.
Created attachment 5131 [details] remove rtti and -g from makefile now done in configure.
Created attachment 5132 [details] finally a reduction of cuft in settings.mk
Target this one for beta2.
OK, I've got several comments/questions: 1. --enable-symbols vs --enable-debug The help text didn't make it clear to me at first what the difference is between these two settings. I guess this is the difference? --enable-symbols -> -g --enable-debug -> -g and debug=true How about these help texts? --enable-symbols: Include debugging symbols in output. Warning - a complete build needs 8 Gb of space and takes much longer. (enables -g compiler flag) --enable-debug: Include debugging symbols from --enable-symbols plus extra debugging code. Extra large build! (enables -g compiler flag and dmake debug=true) 2. Use of ENVCFLAGSCXX. Should we consider using the standard autoconf variables CFLAGS/CXXFLAGS, just as we switched to using the standard compiler vars CC and CXX? Also, it might be better to leave ENVCFLAGS alone completely for the user to use if they wish? 3. removing -fno-rtti. As dicussed on IRC, it might be better to try and remove the -frtti from one or two makefiles instead of enabling it for the whole build, since it incurs a (fairly small I know) extra overhead in the size of the binaries. 12:59 <@haggai> waratah: Ratte suggested removing the CFLAGS+=-frtti from the individual project. If that would work, it would generate smaller binaries and is maybe a good idea 12:59 <@haggai> Ratte: did you actually test that change, or was it a guess? 13:44 < Ratte> haggai: yes I tested this with gcc-3.2.2 on LinuxIntel, I surely donot approve enabling -frtti for all modules at this moment 13:47 < Ratte> waratah: I'm not happy with this, how much increased size of OOo with rtti enabled ? 13:48 <@haggai> Ratte: I think it was about 2M in total 13:49 <@haggai> Ratte: so you tested that removing -frtti works? In that case, lets go for that 13:50 < Ratte> yes: the rtti switch in the xmlhelp makefiles seems a ccp error to me, it's only needed in one dir, grep for dynamic_cast 13:54 <@haggai> but the problem is.. anything that is linked to that file will need -frtti, no? 13:55 < Ratte> haggai: no, only here rtti is needed, but this may be good luck 14:04 <@haggai> hmm, ok - sounds better then 4. cleanup of the gcc verson code using gcc_longver is a great idea! 5. ditto for cleanup of AC_MSG_WARN >> warn construct and introducing AC_MSG_ERROR for missing build components. Much better. 6. Did this one leak in from another issue? # Set default warn level -CFLAGSDFLTWARN=-w +CFLAGSDFLTWARN= Hope that helps, Chris
1) accepted. 2) I wanted to keep this a little smaller and less risky. We can follow this up as a post requirement with sufficient testing. 3) We should apply and backout if the 'correct' solution is not available soon. This is a buildability bug, we can raise the rtti reimplementation as another patch to reverse the patch we implement now. I do not want to alienate the builders because of broken gcc 3.2 as a lot of developers are using. 4+5) clean up - thanks 6) already applied.
Status is waiting patch for rtti in makefiles.
Here is a list of rtti that I found inside the source for the latest 644 tag: ./svx/workben/makefile.mk:add_cflagscxx="-frtti -fexceptions" ./setup2/source/custom/update/makefile.mk:CFLAGSCXX+=-frtti ./solenv/inc/macgccp.mk:CFLAGSCXX= -mpowerpc -fguiding-decls -frtti ./solenv/inc/unxbsdi.mk:CFLAGSCXX=-pipe -mpentium -fguiding-decls -frtti ./solenv/inc/unxlngppc.mk:CFLAGSCXX= -pipe -fno-for-scope -fpermissive -frtti ./solenv/inc/unxlngppc4.mk:CFLAGSCXX= -fsigned-char -pipe -fno-for-scope -fpermissive -frtti ./solenv/inc/unxscoi.mk:CFLAGSCXX=-mpentium -fguiding-decls -frtti ./xmlhelp/source/cxxhelp/db/makefile.mk:CFLAGSCXX+=-frtti ./xmlhelp/source/cxxhelp/provider/makefile.mk:CFLAGSCXX+=-frtti ./xmlhelp/source/cxxhelp/qe/makefile.mk:CFLAGSCXX+=-frtti ./xmlhelp/source/cxxhelp/util/makefile.mk:CFLAGSCXX+=-frtti ./xmlhelp/util/makefile.mk:CFLAGSCXX+=-frtti ./sablot/Sablot-0.52.patch:! CFLAGSCXX+=-frtti ./sablot/unxlngi4.pro/misc/build/Sablot-0.52/Sablot/engine/makefile.mk:CFLAGSCXX+=-frtti ./stlport/unxlngi4.pro/misc/build/STLport-4.5/src/gcc7.mak:WARNING_FLAGS= -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -D_STLP_NO_TYPEINFO -D_STLP_NO_EXCEPTIONS -frtti ./cosv/source/fullcpp.mk:CFLAGSCXX+= -frtti ./autodoc/source/mkinc/fullcpp.mk:CFLAGSCXX+= -frtti ./udm/source/mkinc/fullcpp.mk:CFLAGSCXX+= -frtti
Created attachment 5290 [details] this patch allows -fno-rtti to be left on in gcc 3.2
xmlhelp.rtti.patch: approved.
Created attachment 5313 [details] Configure clean up - new descriptions, remove rtti option change
The xmlhelp patch has now been applied. gcc 3.2 builds should now work.
Created attachment 5314 [details] original patch minus the no-rtti removal.
Ken, can you please remove the: ---- + if (( $platform ne "$Winnt" ) or ( $USE_SHELL ne "4nt" )) + { print OUT "$setenv $_[ 0 ] \"$_[ 1 ]\"$newline"; # to tcsh file if(defined($outfile_sh)) { print OUT_SH "$_[ 0 ]=\"$_[ 1 ]\"$newline"; # to sh file $exportvars .= " $_[ 0 ]"; # add to export list for sh file } + } ---- part (occurs twice, the last two hunks, at the end off set_soenv.in) from your config_office.patch. It makes sense to generate winenv.bat and winenv.set even in the 4nt case. Martin said me once he wanted to keep the W32-4nt part, and with both winenv.* files generated it is possible to use bootstrap *AND* the 4nt shell. (Not simultaneously, but configure and bootstrap in cygwin bash and winenv.bat in 4nt.) The rest of config_office.patch looks good to me.
Created attachment 5323 [details] Once more without the windows regression.
Created attachment 5373 [details] Include a symbols switch and more errors if program not found.
Applied to developers tree.
Hi Ken, you remove -g from -CFLAGS+=-fmessage-length=0 -c $(INCLUDE) -g +CFLAGS+=-fmessage-length=0 -c $(INCLUDE) CFLAGS, but you add -g only to ENVCFLAGSCXX + dnl ================================================================ + dnl First setting is whether to include symbols into final build. + dnl ================================================================ + if test "$enable_symbols" = "yes"; then + ENVCFLAGSCXX="-g" + else + ENVCFLAGSCXX="" + fi IMHO this should be ENVCFLAGS instead, see line 1457 from settings.mk. Also, unfortunately not all compilers use "-g" for this purpose. The setting of ENVCFLAGS should be done after the COM variable is set. I propose exporting ENABLE_SYMBOLS to set_soenv and set ENVCFLAGS there.
Created attachment 5607 [details] Patch to enable symbols switch for gcc and MSVC
I just realized that the patch I just attached doesn't work. The following one should do. The only problem I see is that it changes the default behavior in the Hamburg environment for MSVC from "always build with symbols" to "only build with symbols when ENABLE_SYMBOLS is set to "yes". But Ken's patch did this already for gcc, so this might be no problem.
Created attachment 5608 [details] 2nd try. Patch to enable symbols switch for gcc and MSVC
Created attachment 5751 [details] Start AIX and fix bug where it does not show perl version checked.
Created attachment 5752 [details] handle system not setup yet, remove USE_SHELL and tidy the comment variable.
I tried the last patch against cws_srx644_ooo20030412 == HEAD. patching file set_soenv.in Hunk #1 FAILED at 43. Hunk #2 succeeded at 131 (offset -4 lines). ... Hunk #20 FAILED at 1981. 10 out of 20 hunks FAILED -- saving rejects to file set_soenv.in.rej Also in hunk @@ -1123,7 +1116,7 @@ - if ( ( "$USE_SHELL" eq "tcsh" ) && ( ! $noldPATH =~ /(?:[:]|\A)(?:$TCSH_PATH)(?:[:]|\Z)/ ) ) + if ( ( "'@USE_SHELL@'" eq "tcsh" ) && ( ! $noldPATH =~ /(?:[:]|\A)(?:$TCSH_PATH)(?:[:]|\Z)/ ) ) There are "'...'" used, should be only '...' Ken, can you also please comment on the ENVCFLAGS vs. ENVCFLAGSCXX issue. I think ENVCFLAGS is the correct variable to be used.
Created attachment 5758 [details] Major upgrade. based on 0412 branch. AIX aware, format upgrades.
THe envcflags have been upgraded to use -g on option as well. This works well with most compilers as most compilers us -g for symbols. Except M$, I have to work on a proper fix for M$ but I have little time. I want to move some of the set_soenv.in up to configure.in to make this switch easier.
The following patch enables the --enable-symbols switch to be used for MSVC. Warning! This is a hack! The patch checks for ENVCFLAGSCXX="-g", as this is the "global" enable symbols switch for all other compilers and enables the MSVC switch "-Zi -Fd$(MISC)\_ooo_st_$(TARGET).PDB" if it's set. CCing ause, because this is in solenv.
Created attachment 5759 [details] Patch for solenv/inc/wnt.mk
Created attachment 5760 [details] Patch for solenv/inc/wnt.mk
Ken, when you add the forgotten ENVCFLAGS could you also please fix: + ($platform eq $Irix64) || ($platform eq $FreeBSD) || ($platform = "AIX")) the two lines in your patch with $platform = "AIX".
Win nt symbols conversion from -g to complex M$ code is approved. WIll work on better configure to make it upstream later.
i strongly discourage the use of "ENVC*" variables for permanent environment changes. these variables are for temporary use for developers only to e.g. override the default switches. every content set in the environment scripts will potentially get removed in developer builds.
unxlngi4.mk readded -g, was it intended to remove it ?
So long as configure sets the -g by option then the -g in unxlngi4.mk should not be there.
please keep in mind that SO does not use configure, so if we change some things there, we also have to take care that in SO / setsolar Environment the required change also has to be done.
Acknowledged. This particular item was agreed in a lengthy discussion in the mailing list. The point about setsolar was made during that discussion to the internal support. It was agreed that -g was too big a blocker on disk space for new OOo developers.
Created attachment 6703 [details] Backout patch for setup2 to compile on most platforms.
Hi Ken, wrong issue ;-)
please see #14472 for make --enable-symbols work.
Fixed in issue 14472.
close