Issue 109853 - enable build with gcc-4.5
Summary: enable build with gcc-4.5
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: OOO320m12
Hardware: PC All
: P3 Trivial (vote)
Target Milestone: 3.4.1
Assignee: Stephan Bergmann
QA Contact: issues@porting
URL:
Keywords:
: 116196 (view as issue list)
Depends on:
Blocks:
 
Reported: 2010-03-05 18:34 UTC by pmladek
Modified: 2010-12-22 08:41 UTC (History)
4 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch to enable build with gcc-4.5 in cppu/inc/uno/lbnames.h (840 bytes, patch)
2010-03-05 18:36 UTC, pmladek
no flags Details | Diff
Workaround for gcc#43257 (428 bytes, patch)
2010-03-05 18:37 UTC, pmladek
no flags Details | Diff
lets just get rid of that version test (1.57 KB, patch)
2010-05-20 16:29 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description pmladek 2010-03-05 18:34:19 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.
Comment 1 pmladek 2010-03-05 18:36:02 UTC
Created attachment 68175 [details]
Patch to enable build with gcc-4.5 in cppu/inc/uno/lbnames.h
Comment 2 pmladek 2010-03-05 18:37:52 UTC
Created attachment 68176 [details]
Workaround for gcc#43257
Comment 3 rene 2010-04-25 22:19:25 UTC
see also issue 111141 (no idea whether it's actually gcc-4.5 related, but it's
filed as such)
Comment 4 rene 2010-04-26 09:14:22 UTC
forget my last comment...
Comment 5 caolanm 2010-05-20 16:29:52 UTC
Created attachment 69545 [details]
lets just get rid of that version test
Comment 6 caolanm 2010-05-20 16:32:43 UTC
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
Comment 7 Stephan Bergmann 2010-05-20 16:42:37 UTC
@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?
Comment 8 caolanm 2010-05-20 16:48:28 UTC
nah, we shouldn't error on any new gcc versions anymore IMO
Comment 9 pmladek 2010-05-20 18:14:38 UTC
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...
Comment 10 Stephan Bergmann 2010-05-20 21:36:02 UTC
@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
Comment 11 Stephan Bergmann 2010-05-21 09:17:49 UTC
@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?
Comment 12 caolanm 2010-05-21 09:20:34 UTC
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
Comment 13 pmladek 2010-05-21 09:48:36 UTC
I confirm that the snippet from sal-cpprt-gcc-4.5-workaround.diff is not longer
needed and can be ignored.
Comment 14 Stephan Bergmann 2010-06-18 09:44:17 UTC
yes, will reuse this issue to fix b)
Comment 15 Stephan Bergmann 2010-06-23 10:16:48 UTC
<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.
Comment 16 Stephan Bergmann 2010-07-15 09:27:41 UTC
.
Comment 17 Stephan Bergmann 2010-10-06 14:24:19 UTC
.
Comment 18 Stephan Bergmann 2010-12-22 08:41:13 UTC
*** Issue 116196 has been marked as a duplicate of this issue. ***