Bug 207697 - editors/libreoffice4: fix build with boost 1.60
Summary: editors/libreoffice4: fix build with boost 1.60
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: FreeBSD Office Team
URL:
Keywords: needs-qa, patch
Depends on: 199601
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-04 11:50 UTC by Don Lewis
Modified: 2016-11-23 13:06 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (office)


Attachments
patch to unbreak editors/libreoffice4 when building with boost 1.60 (11.68 KB, patch)
2016-03-04 11:50 UTC, Don Lewis
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Lewis freebsd_committer freebsd_triage 2016-03-04 11:50:20 UTC
Created attachment 167709 [details]
patch to unbreak editors/libreoffice4 when building with boost 1.60

The libreoffice4 build fails if the boost port is upgraded to version 1.60.  The attached patch contains two sets of changes to fix this problem.  The first part is the upstream commit 45dfbdca6a9afba1a6aef21623ec025ded635a4d.  The other part is a small fragment of the upstream commit e00a3a684e22f45f36b4002ce726cb2975cb36ae to add -DBOOST_ERROR_CODE_HEADER_ONLY and -DBOOST_SYSTEM_NO_DEPRECATED to the compiler flags.

The upstream commit 45dfbdca6a9afba1a6aef21623ec025ded635a4d works with both boost 1.60 as well as the current in-tree boost 1.55.  Unfortunately the other change is not compatible with boost 1.55 for unknown reasons.

Without this second change, the build with boost 1.60 fails with this error:

[build LNK] StaticLibrary/libwriterperfect_importtestbase.a
/wrkdirs/usr/ports/editors/libreoffice4/work/libreoffice-4.3.7.2/workdir/LinkTarget/StaticLibrary/libpdfimport_s.a(pdfparse.o): In function `global constructors keyed to a':
/wrkdirs/usr/ports/editors/libreoffice4/work/libreoffice-4.3.7.2/sdext/source/pdfimport/pdfparse/pdfparse.cxx:(.text+0x34c): undefined reference to `boost::system::generic_category()'
/wrkdirs/usr/ports/editors/libreoffice4/work/libreoffice-4.3.7.2/sdext/source/pdfimport/pdfparse/pdfparse.cxx:(.text+0x358): undefined reference to `boost::system::generic_category()'
/wrkdirs/usr/ports/editors/libreoffice4/work/libreoffice-4.3.7.2/sdext/source/pdfimport/pdfparse/pdfparse.cxx:(.text+0x364): undefined reference to `boost::system::system_category()'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
/wrkdirs/usr/ports/editors/libreoffice4/work/libreoffice-4.3.7.2/solenv/gbuild/LinkTarget.mk:444: recipe for target '/wrkdirs/usr/ports/editors/libreoffice4/work/libreoffice-4.3.7.2/workdir/LinkTarget/Executable/pdfunzip' failed
gmake[2]: *** [/wrkdirs/usr/ports/editors/libreoffice4/work/libreoffice-4.3.7.2/workdir/LinkTarget/Executable/pdfunzip] Error 1


With this second change, the build with boost 1.59 fails with this error:

In file included from /wrkdirs/usr/ports/editors/libreoffice4/work/libreoffice-4.3.7.2/sc/qa/unit/helper/qahelper.cxx:10:
In file included from /wrkdirs/usr/ports/editors/libreoffice4/work/libreoffice-4.3.7.2/sc/qa/unit/helper/qahelper.hxx:14:
In file included from /wrkdirs/usr/ports/editors/libreoffice4/work/libreoffice-4.3.7.2/sc/qa/unit/helper/debughelper.hxx:27:
In file included from /usr/local/include/mdds/mixed_type_matrix.hpp:33:
In file included from /usr/local/include/mdds/mixed_type_matrix_storage.hpp:39:
In file included from /usr/local/include/boost/pool/object_pool.hpp:18:
In file included from /usr/local/include/boost/pool/poolfwd.hpp:24:
In file included from /usr/local/include/boost/pool/detail/mutex.hpp:14:
In file included from /usr/local/include/boost/thread/mutex.hpp:16:
In file included from /usr/local/include/boost/thread/pthread/mutex.hpp:12:
In file included from /usr/local/include/boost/thread/exceptions.hpp:22:
In file included from /usr/local/include/boost/system/system_error.hpp:14:
/usr/local/include/boost/system/error_code.hpp:516:13: fatal error: 'boost/../libs/system/src/error_code.cpp' file not found
#   include <boost/../libs/system/src/error_code.cpp>
            ^

The problem is that error_code.hpp contains:

# ifdef BOOST_ERROR_CODE_HEADER_ONLY
#   include <boost/../libs/system/src/error_code.cpp>
# endif

and error_code.cpp is not installed.  I think this was fixed in boost 1.56.0.


For some unknown reason, editors/libreoffice which uses -DBOOST_ERROR_CODE_HEADER_ONLY and -DBOOST_SYSTEM_NO_DEPRECATED does not suffer this same fate.

Unfortunately I also haven't been able to think of a clean way of detecting the boost version and tweaking the use of these flags to DTRT.
Comment 1 Don Lewis freebsd_committer freebsd_triage 2016-03-11 18:59:14 UTC
(In reply to Don Lewis from comment #0)

> With this second change, the build with boost 1.59 fails with this error:

That should actually be boost 1.55.

I've figured out what this error does not occur with editors/libreoffice.
It turns out that editors/libreoffice does not use <mdds/mixed_type_matrix.hpp>, so it is likely that <boost/pool/object_pool.hpp> and the thread stuff is never needed, so the broken version of <boost/system/system_error.hpp> is never used with -DBOOST_ERROR_CODE_HEADER_ONLY.
Comment 2 Don Lewis freebsd_committer freebsd_triage 2016-03-24 22:49:17 UTC
Swap ordering of this PR and bug #199601.  They are mutually dependent and the boost upgrade will happen first.
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-11-23 12:46:53 UTC
A commit references this bug:

Author: jbeich
Date: Wed Nov 23 12:46:12 UTC 2016
New revision: 426909
URL: https://svnweb.freebsd.org/changeset/ports/426909

Log:
  editors/libreoffice4: unbreak build with boost 1.62

  workdir/LinkTarget/StaticLibrary/libpdfimport_s.a(pdfparse.o): In function `_GLOBAL__sub_I_pdfparse.cxx':
  sdext/source/pdfimport/pdfparse/pdfparse.cxx:(.text+0x2f8): undefined reference to `boost::system::generic_category()'
  sdext/source/pdfimport/pdfparse/pdfparse.cxx:(.text+0x303): undefined reference to `boost::system::generic_category()'
  sdext/source/pdfimport/pdfparse/pdfparse.cxx:(.text+0x30e): undefined reference to `boost::system::system_category()'
  c++: error: linker command failed with exit code 1 (use -v to see invocation)

  In file included from canvas/source/cairo/cairo_spritecanvashelper.cxx:35:
  In file included from canvas/source/cairo/cairo_canvascustomsprite.hxx:37:
  include/canvas/base/canvascustomspritebase.hxx:257:24: warning: 'getPriority' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
          virtual double getPriority() const
                         ^
  include/canvas/base/sprite.hxx:92:37: note: overridden virtual function is here
          virtual double              getPriority() const = 0;
                                      ^
  canvas/source/cairo/cairo_spritecanvashelper.cxx:409:41: error: call to deleted function 'cref'
                                          boost::cref(mpOwningSpriteCanvas->getBufferSurface()),
                                          ^~~~~~~~~~~
  /usr/local/include/boost/core/ref.hpp:179:24: note: candidate function [with T = boost::shared_ptr<cairo::Surface>] has been explicitly deleted
  template<class T> void cref(T const&&) BOOST_REF_DELETE;
                         ^
  /usr/local/include/boost/core/ref.hpp:150:80: note: candidate function [with T = boost::shared_ptr<cairo::Surface>]
  template<class T> BOOST_FORCEINLINE reference_wrapper<T const> BOOST_REF_CONST cref( T const & t )
                                                                                 ^
  canvas/source/cairo/cairo_spritecanvashelper.cxx:407:26: error: no matching function for call to 'bind'
                           ::boost::bind( &repaintBackground,
                           ^~~~~~~~~~~~~
  /usr/local/include/boost/bind/bind.hpp:1899:5: note: candidate template ignored: couldn't infer template argument 'R'
      BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
      ^
  /usr/local/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
   #define BOOST_BIND bind
                      ^
  [...]

  PR:		207697
  Submitted by:	truckman
  Obtained from:	upstream
  Exp-run by:	antoine

Changes:
  head/editors/libreoffice4/files/patch-45dfbdca6a9afba1a6aef21623ec025ded635a4d
  head/editors/libreoffice4/files/patch-solenv_gbuild_platform_com__GCC__defs.mk