Apache OpenOffice (AOO) Bugzilla – Issue 13385
new flex breaks OOo build (in transex3 and connectivity)
Last modified: 2013-08-07 15:01:37 UTC
flex 2.5.31 (which entered Debian unstable a few days ago) breaks building of OpenOffice.org (among other packages like XFree86 and binutils). Manoj Srivastava - the Debian flex maintainer has written an explanation in this posting: http://lists.debian.org/debian-openoffice/2003/debian-openoffice-200304/msg00065.html So we might not get a "fixed" flex and need to fix OOo itself. I am going to attach the relevant buildlog excerpt, the .l file and the .c files with the old and the new flex together with a diff between them to this issue. This bug holds OpenOffice.org back in unstable, so we hope that it can be fixed soon..
Created attachment 5632 [details] Buildlog excerpt for transex3
Created attachment 5633 [details] flex input file (OOo 1.0.3)
Created attachment 5634 [details] flex output with the old flex
Created attachment 5635 [details] flex output with the new flex
Created attachment 5636 [details] unified diff between old and new flex output
Since it seems I am too dumb (or too tired) to attach these files correctly and not getting an attachment with the path to my files on my laptop, all these files can be found under http://people.debian.org/~rene/ooo-flex-error/
Confirming. Installing flex 2.5.31 on a system which otherwise builds OOo correctly breaks the build.
Created attachment 5680 [details] Patch to work around shortcoming in new debian flex.
We have a break in connectivity now. The new flex is defining YY_FLUSH_BUFFER and then undefining it at the end of it's internal processing. Here are the messages. In file included from ../../unxlngi4.pro/inc/com/sun/star/beans/XPropertySetInfo.hpp:20, from ../../unxlngi4.pro/inc/com/sun/star/beans/XPropertySet.hpp:32, from ../../inc/connectivity/sqlnode.hxx:71, from ../inc/internalnode.hxx:65, from ../../unxlngi4.pro/misc/sqlflex.cxx:1809: /data3/office/solver/644/unxlngi4.pro/inc/com/sun/star/uno/Sequence.hxx: In function `const com::sun::star::uno::Type& getCppuType(const com::sun::star::uno::Sequence<E>*)': /data3/office/solver/644/unxlngi4.pro/inc/com/sun/star/uno/Sequence.hxx:230: warning: `typename com::sun::star::uno::Sequence<E>::ElementType' is implicitly a typename /data3/office/solver/644/unxlngi4.pro/inc/com/sun/star/uno/Sequence.hxx:230: warning: implicit typename is deprecated, please see the documentation for details ../../unxlngi4.pro/misc/sqlflex.cxx: In function `sal_Int32 gatherString(long int, long int)': ../../unxlngi4.pro/misc/sqlflex.cxx:3805: `yytext_ptr' undeclared (first use this function) ../../unxlngi4.pro/misc/sqlflex.cxx:3805: (Each undeclared identifier is reported only once for each function it appears in.) ../../unxlngi4.pro/misc/sqlflex.cxx: In member function `virtual void connectivity::OSQLScanner::SQLyyerror(sal_Char*)': ../../unxlngi4.pro/misc/sqlflex.cxx:4055: `YY_FLUSH_BUFFER' undeclared (first use this function) dmake: Error code 1, while making '../../unxlngi4.pro/slo/sqlflex.obj'
I just talked with Manoj about the connectivity break (gave him a link to this issue): 17:33 < Manoj> _rene_: yes, there are things available in the rules section that are cleaned up before we get into the user section 17:33 < infinity> con-fuse : I know. :) [...] 17:33 < Manoj> _rene_: the actions, then, have these things available, but now flex tries to avoid polluting the user namespace [...] 17:34 < Manoj> _rene_: you understand this is needed, since now we can have dozens of scanners in a program [...] 17:35 < _rene_> Manoj: so how to fix that? :) (/me is totally flex-incompetent) [...] 17:35 < Manoj> _rene_: only use YY_FLUSH_BUFFER in the action section? 17:35 < _rene_> Hmm [...] 17:35 < Manoj> flex has 3 sections: definition, rules/action, and user
_Maybe_ this post is interesting too http://lists.debian.org/debian-devel/2003/debian-devel-200304/msg01098.html
DL->NF: The new flex breaks the OOo build (at least in transex3).
Ken, I'm not sure about the current state. You wrote "Patch to work around shortcoming in new debian flex.". Does this mean there is no more action for the transex3 problem required?
I have currently downgraded and lockedout upgrades. a) The transex3 patch is not applied. It is very simple change ]] to ] ]. b) The break in connectivity is unfixed.
I don't have time to work on this. I have currently locked down my flex to a version before breakage. Can you assign as appropriate to get someone to work with this problem. Ta Ken...
OK, here are important new information regarding this: Manoj told me, that the new flex needs a more self-contained rules section. So moving gather* into rules embedded into %{ %} should work. Well, the problem is that when you are doing that, flex 2.5.31 (which actually processed that sqlflex.l this time) generated nested functions on which gcc obviously chokes. I unfortunatly seems to have lost my build logs showing the errors the compiler gave, but it seems a really grave bug in flex 2.5.31 and upstream didn't react to bug reports of this kind in any way.. Well, Debian sid is proposed to get a flex-old deb being 2.5.4a again, but this issue should be leaved open to get fixed if the new flex did not generate bad code and the "moving into %{ %} sections of the rules section" fix can be done. Regards, Rene
Hi, it seems that the fix (or a workaround) is much easier then we all have thought. The following fix (thanks to Jarno Elonen <elonen@iki.fi) fixes the failure in connectivity: --- oo_1.0.3_src/connectivity/source/parse/sqlflex.l 2003-05-09 22:46:08.000000000 +0300 +++ oo_1.0.3_src/connectivity/source/parse/sqlflex.l 2003-05-11 12:04:59.000000000 +0300 @@ -338,6 +338,20 @@ %% +// Kludge around a bug (well, Posix incompatibility) in flex 2.5.x +// http://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=189332 +#if YY_FLEX_MAJOR_VERSION >= 2 && YY_FLEX_MINOR_VERSION >= 5 + + #ifndef YY_FLUSH_BUFFER + #define YY_FLUSH_BUFFER SQLyy_flush_buffer(YY_CURRENT_BUFFER ) + #endif + + #ifndef yytext_ptr + #define yytext_ptr SQLyytext + #endif + +#endif + /* * Read SQL string literal * Valid strings: Regards, Rene
I have applied this bug and built Openoffice.org completely with the new flex. This looks OK to go.
Implemented patches to allow this to compile cleanly on the beta2 tag.
NF->OJ: The transex3 part is done. If I'm its your task, now.
I've applied the patch for the current version (beta2). Bye. Ocke
This has been built with old and new flex version, closing issue.
Verifying issue, also built on other platforms.
Closing.