Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Aug 2014 14:49:06 -0500
From:      Pedro Giffuni <pfg@freebsd.org>
To:        Don Lewis <truckman@FreeBSD.org>
Cc:        office@FreeBSD.org
Subject:   Re: OpenOffice 4.1 build persistently fails on my FreeBSD-10-stable/AMD64
Message-ID:  <10F07273-778A-4B42-B566-73B86BC906B7@freebsd.org>
In-Reply-To: <201408241839.s7OIdsd9055757@gw.catspoiler.org>
References:  <201408241839.s7OIdsd9055757@gw.catspoiler.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Don;

Il giorno 24/ago/2014, alle ore 13:39, Don Lewis <truckman@FreeBSD.org> =
ha scritto:

> On 23 Aug, Pedro Giffuni wrote:
>>=20
>> Il giorno 23/ago/2014, alle ore 20:32, Don Lewis
>> <truckman@FreeBSD.org> ha scritto:
>>=20
>>> On 23 Aug, Pedro Giffuni wrote:
>>>>=20
>>>> On 08/23/14 13:51, Don Lewis wrote:
>>>>> On 22 Aug, Pedro Giffuni wrote:
>>>>>> FWIW,
>>>>>>=20
>>>>>> AOO 4.1 is known to have bugs and AOO 4.1.1 will be released
>>>>>> really soon to address them. The patch in PR 192545 unbreaks the
>>>>>> AOO 4.1.0 build on FreeBSD 10 and
>>>>> 11: <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D192545>;
>>>>>=20
>>>>> The patch in PR 192557 upgrades openoffice-devel to 4.1.1-RC3:
>>>>> <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D192557>;
>>>>>=20
>>>>=20
>>>> The patch in PR 181044 fixes Boost so that it can be used as
>>>> an external dependency for OpenOffice:
>>>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D181044
>>>=20
>>> Still no joy  B-(
>>>=20
>>> When I was first working on 4.1.0, I ran into the #include_next
>>> problem and tried to work around it by adding
>>> -DBOOST_TR1_DISABLE_INCLUDE_NEXT to CFLAGS.  The errors still
>>> occurred, but with different message text.
>>>=20
>>> With this patch applied, I see the same thing as in my earlier
>>> experiments:
>>>=20
>>> In file included from /usr/local/include/boost/tr1/tr1/vector:16:0,
>>>                from
>>>                =
/wrkdirs/usr/ports/editors/openoffice-devel/work/aoo-4.1.1/main/solver/411=
/unxfbsdx.pro/inc/stl/vector:31,
>>>                from
>>>                =
/wrkdirs/usr/ports/editors/openoffice-devel/work/aoo-4.1.1/main/xml2cmp/so=
urce/finder/dependy.hxx:28,
>>>                from
>>>                =
/wrkdirs/usr/ports/editors/openoffice-devel/work/aoo-4.1.1/main/xml2cmp/so=
urce/finder/dependy.cxx:25:
>>> /usr/local/include/boost/tr1/detail/config_all.hpp:163:41: fatal
>>> error: ../4.7/utility: No such file or directory compilation
>>> terminated.
>>=20
>> Ugh=1B$B!D=1B(B this looks familiar :(
>>=20
>> The problem is really messy: the original OpenOffice was developed in
>> the dark ages of C++ libraries and used STLport as it=1B$B!G=1B(Bs =
STL
>> implementation. STLport doesn=1B$B!G=1B(Bt work with modern compilers =
(like in
>> MacOSX) so Boost is very handy because it has TR1 implementation =
which
>> can be very useful to complement older versions of libstdc++. With a
>> good native STL library, AOO makes very little use, if any, of boost.
>>=20
>> In order to be less disruptive, AOO has some wrappers for the STL
>> libraries in main/stlport/systemstl and for some reason this works
>> fine on for linux, Windows and MacOSX but it always gets those wrong
>> on FreeBSD.
>>=20
>> AOO appears to be the only package that exercises include_next =
because
>> the definition was wrong before my patch and no one had noticed. The
>> explanation is here:
>>=20
>> https://svn.boost.org/trac/boost/ticket/8944
>>=20
>> Perhaps the path may need adjusting for gcc4.7. Extra eyes are
>> certainly welcome.
>=20
> main/solver/411/unxfbsdx.pro/inc/stl/vector contains this:
>=20
> #ifdef HAVE_STL_INCLUDE_PATH
>        // TODO: use computed include file name
>        #include_next <vector>
> #elif defined(_MSC_VER)
>        #include <../../VC/include/vector>
> #else // fall back to boost/tr1
>        #include <boost/tr1/tr1/vector>
> #endif
>=20
> which gets us into boost and it's emulation of #include_next.
>=20
>=20

FWIW, this doesn=1B$B!G=1B(Bt work with libc++. I recall I had to define =
HAVE_STL_INCLUDE_PATH
manually to start the build with libc++.

> If we were using our old gcc 4.2 in base, then we'd want to pick up =
the
> second of these:
>=20
> %find /usr/include -name vector -print
> /usr/include/c++/4.2/debug/vector
> /usr/include/c++/4.2/vector
>=20
> so your patch would work.
>=20
>=20


OK. This makes sense: when I was working on this my main interest was to =
keep building
AOO with the base compiler in FreeBSD 9.


> Using gcc 4.7, we want the last one of these:
>=20
> %find /usr/local/lib/gcc47/include -name vector -print
> /usr/local/lib/gcc47/include/c++/profile/vector
> /usr/local/lib/gcc47/include/c++/debug/vector
> /usr/local/lib/gcc47/include/c++/vector
>=20

This is really ugly: includes under the lib directory are probably =
against out heir(7) structure.
The explanation is that it is not the base compiler, of course, and =
having them in
/usr/local/include may cause collisions with the compiler in base.

> If I tweak the path in your patch to this:
> +#      define BOOST_TR1_STD_HEADER(name) <../c++/name>
> I can successfully build OpenOffice with system boost.
>=20
> It looks like this should also work with the gcc 4.6 port.
>=20
> If you tweak your patch to distinguish between gcc 4.2 and later
> versions and select the path accordingly, it should work for all =
cases.
>=20

I would really prefer not to tweak Boost for this. The truth is the =
include_next
trick is only meant to cover for deficiencies in the base compiler. The =
real fix
would be using libc++, but since we cant at this time, a valid =
workaround
would be accounting for that within AOO in the STLport wrapper
(not sure if that will be something easy though).


>=20
> Back to the original build failure ... for some reason unopkg.bin is
> segfaulting when linked with the system libgraphite.  I noticed that =
the
> silgraphite port picked up one of the patches silgraphite patches from
> OpenOffice with some tweaks, but not the rest.
>=20

The vast majority of the libgraphite patches in AOO were meant to =
account
for STLport, and were not needed in the port. I do see AOO has made at =
least
two important fixes that we should merge:
http://svn.apache.org/viewvc/openoffice/trunk/main/graphite/?view=3Dlog

All in all =1B$B!D=1B(B you could also turn off silgraphite and leave it =
as an option:
FreeType improved a lot the Adobe support lately and there are not many
graphite enabled fonts anyways.

Pedro.

> GNU gdb 6.1.1 [FreeBSD]
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and =
you are
> welcome to change it and/or distribute copies of it under certain =
conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for =
details.
> This GDB was configured as "i386-marcel-freebsd"...
> (gdb) run
> Starting program: =
/mnt2/tmp/mnt2/usr/ports/editors/openoffice-devel/work/aoo-4.1.1/main/inst=
setoo_native/unxfbsdi.pro/Apache_OpenOffice/archive/install/en-US_witherro=
r/Apache_OpenOffice_4.1.1_FreeBSD_install-arc_en-US/openoffice4/program/un=
opkg.bin=20
> [New LWP 100780]
> [New Thread 8a803080 (LWP 100780/unopkg.bin)]
>=20
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 8a803080 (LWP 100780/unopkg.bin)]
> 0x00000000 in ?? ()
> (gdb) tr
> trace command requires an argument
> (gdb) bt
> #0  0x00000000 in ?? ()
> #1  0x88290bf4 in __dynamic_cast (src_ptr=3D0x8832fc40, =
src_type=3D0x88326684,=20
>    dst_type=3D0x88326540, src2dst=3D0)
>    at ../../.././../gcc-4.7.4/libstdc++-v3/libsupc++/dyncast.cc:61
> #2  0x882bf021 in std::has_facet<std::ctype<char> > =
(__loc=3D@0x8832f9b0)
>    at locale_classes.tcc:257
> #3  0x882b273a in std::basic_ios<char, std::char_traits<char> =
>::_M_cache_locale (this=3D0x8832f944, __loc=3D@0x8832f9b0) at =
basic_ios.tcc:160
> #4  0x882b27e9 in std::basic_ios<char, std::char_traits<char> >::init =
(
>    this=3D0x8832f944, __sb=3D0x8832f540) at basic_ios.tcc:133
> #5  0x882a42c3 in std::ios_base::Init::Init (this=3D0x8853264c) at =
ostream:83
> #6  0x8832f944 in std::cout () from =
/usr/local/lib/gcc47/libstdc++.so.6
> #7  0x8832f540 in __gnu_internal::buf_cin_sync ()
>   from /usr/local/lib/gcc47/libstdc++.so.6
> Previous frame inner to this frame (corrupt stack?)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?10F07273-778A-4B42-B566-73B86BC906B7>