Apache OpenOffice (AOO) Bugzilla – Issue 109853
enable build with gcc-4.5
Last modified: 2010-12-22 08:41:13 UTC
I have just successfully built OOo-3.2 with gcc (SUSE Linux) 4.5.0 20100218 (experimental) [trunk revision 156860] I did the cppu tests according to http://wiki.services.openoffice.org/wiki/Uno/Binary/Modules/CPPU and they all passed. I will attach a patch that enables this gcc version in cppu/inc/uno/lbnames.h. IMPORTANT: There was one more compilation error in sal/cpprt/operators_new_delete.cxx. It was caused by http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43257. I compiled the file with -fno-ipa-sra as a workaround. I am not sure if you want this workaround as well or if you would prefer to wait for the upstream fix.
Created attachment 68175 [details] Patch to enable build with gcc-4.5 in cppu/inc/uno/lbnames.h
Created attachment 68176 [details] Workaround for gcc#43257
see also issue 111141 (no idea whether it's actually gcc-4.5 related, but it's filed as such)
forget my last comment...
Created attachment 69545 [details] lets just get rid of that version test
cmc->sb: How about we just get rid of that test. Really a hangover from gcc2 to gcc3 transition days. Tedious to go through this every little gcc bump nowadays. I can shove this into a workspace I have open here if there's agreement on it. cmc->pmladek: This works too, right ?, i.e. CFLAGSCXX is our c++ flag variable so setting that should be sufficient for the additional gcc45 workaround in sal
@cmc: sounds reasonable to lbnames.h, plus 1 I would drop the GCC 2 stuff completely 2 should we check for GCC >= 3.4 and still give an error otherwise?
nah, we shouldn't error on any new gcc versions anymore IMO
pmladek->cmc: Your variant works as well. Hmm, we might remove the hack at all. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43237 has been fixed quickly. So, it was broken only in few gcc-4.5 developer snapshots...
@cmc: Sorry, got confused by the code and thought 3.4 was our minimum requirement to choose "gcc3" while it obviously is 3.0; so what I would condense the stuff to would be ... #elif defined __GNUC__ #if __GNUC__ >= 3 #define TMP_CPPU_ENV gcc3 #else #error "Unsupported gcc major version." #endif #endif
@pmladek: Of your two applied patches, cppu-lbnames-enable-gcc-4.5.diff is superseded by cmc's sal_cppu.gcc45.patch (see next), and sal-cpprt-gcc-4.5.workaround.diff should not be applied as corresponding <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43257> does not affect any "true" (non-snapshot) GCC 4.5, right? @cmc: Looking at cppu/inc/uno/lbnames.h once again, I think the whole stuff of checking compiler versions and setting CPPU_ENV can be removed from there. I need to do some more testing on that and will probably file a new issue for that, in which case this issue can be closed as invalid, right?
a) yeah, ditch the gcc bug patch as it was apparently snapshot only b) sure, I say just reuse this issue but it doesn't matter either way
I confirm that the snippet from sal-cpprt-gcc-4.5-workaround.diff is not longer needed and can be ignored.
yes, will reuse this issue to fix b)
<http://hg.services.openoffice.org/cws/sb126/rev/e7381920688b> removes the complete block from cppu/inc/uno/lbnames.h that defines CPPU_ENV and checks for specific compiler versions: CPPU_ENV is always already defined: for the OOo build environment it is defined in solenv/inc/tg_compv.mk and solenv/inc/target.mk, for the SDK it is defined in odk/settings/settings.mk, and stand-alone URE users need to define it themselves, see ure/source/uretest/Makefile.pln. (Further proof that it already needs to be defined is that (a) sal/rtl/source/bootstrap.cxx uses CPPU_ENV without including lbnames.h, and (b) for certain GCC versions lbnames.h contained a typo (__CPPU_ENV vs. TMP_CPPU_ENV) and thus would never have set CPPU_ENV, anyway.) Checking for specific compiler versions, if necessary at all, needs to be done during configuration (of OOo build environment or of SDK) or centrally (in sal/config.h), anyway.
.
*** Issue 116196 has been marked as a duplicate of this issue. ***