Bug 214699 - databases/xapian-core: compilation error on 9-STABLE (missing symbol: SOCK_CLOEXEC)
Summary: databases/xapian-core: compilation error on 9-STABLE (missing symbol: SOCK_CL...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-21 08:35 UTC by Arrigo Marchiori
Modified: 2016-11-22 15:34 UTC (History)
2 users (show)

See Also:


Attachments
Proposed patch (1.66 KB, patch)
2016-11-21 21:12 UTC, Raphael Kubo da Costa
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arrigo Marchiori 2016-11-21 08:35:02 UTC
The port databases/xapian-core does not build on 9-STABLE, because the symbol SOCK_CLOEXEC is not defined.

The offending file is backends/flint_lock.cc, lines 208 and 232.

https://wiki.freebsd.org/AtomicCloseOnExec says that the SOCK_CLOEXEC feature is only supported since FreeBSD release 10.0.
Comment 1 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-11-21 21:12:52 UTC
Created attachment 177250 [details]
Proposed patch

The attached patch fixes the build by defining SOCK_CLOEXEC to 0 when it is not already defined (the 1.4 xapian series does basically the same thing with safesyssocket.h).
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-11-21 21:27:21 UTC
A commit references this bug:

Author: rakuco
Date: Mon Nov 21 21:26:59 UTC 2016
New revision: 426759
URL: https://svnweb.freebsd.org/changeset/ports/426759

Log:
  Unbreak the build on FreeBSD 9 after r426647.

  SOCK_CLOEXEC was introduced in FreeBSD 10, so define it to 0 on FreeBSD 9 (the
  code already handles this case). Xapian 1.4 has a safesyssocket.h that does the
  same thing.

  PR:		214699
  Approved by:	portmgr (antoine)

Changes:
  head/databases/xapian-core/Makefile
  head/databases/xapian-core/files/extrapatch-backends_flint__lock.cc
Comment 3 Arrigo Marchiori 2016-11-22 15:34:38 UTC
Thank you, Raphael! I confirm I could build it successfully.