Bug 214538 - sysutils/lnav: fails to build if databases/sqlite3 was built with ICU=on
Summary: sysutils/lnav: fails to build if databases/sqlite3 was built with ICU=on
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: Jan Beich
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2016-11-15 16:39 UTC by Jan Beich
Modified: 2016-12-11 17:03 UTC (History)
2 users (show)

See Also:


Attachments
Path to add ICU. (632 bytes, patch)
2016-11-16 04:28 UTC, Pavel Volkov
no flags Details | Diff
Path to add ICU. (615 bytes, patch)
2016-11-16 04:34 UTC, Pavel Volkov
no flags Details | Diff
Dynamic linking (734 bytes, patch)
2016-11-16 07:37 UTC, Pavel Volkov
no flags Details | Diff
Dynamic linking (873 bytes, patch)
2016-11-16 08:10 UTC, Pavel Volkov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2016-11-15 16:39:09 UTC
c++  -O2 -pipe -fstack-protector -fno-strict-aliasing  -Lsrc/static-libs    -pthread -fstack-protector -L/usr/local/lib -L/usr/lib -L//lib -o lnav lnav.o dump-pid-sh.o help.o init-sql.o default-log-formats-json.o default-config-json.o dhclient-summary.opartition-by-boot.o libdiag.a -lreadline -lncursesw -lsqlite3  -lpcrecpp -lpcrecpp -lpcre -ltinfo -lexecinfo -lbz2 -lz -lutil
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuRegexpFunc':
(.text+0x1a2eb): undefined reference to `uregex_open'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuRegexpFunc':
(.text+0x1a338): undefined reference to `uregex_setText'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuRegexpFunc':
(.text+0x1a35d): undefined reference to `uregex_matches'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuRegexpFunc':
(.text+0x1a39a): undefined reference to `uregex_setText'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuCaseFunc16':
(.text+0x1a498): undefined reference to `u_strToUpper'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuCaseFunc16':
(.text+0x1a4bf): undefined reference to `u_strToLower'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuLikeFunc':
(.text+0x1a6be): undefined reference to `utf8_nextCharSafeBody'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuLoadCollation':
(.text+0x1a798): undefined reference to `ucol_open'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuLoadCollation':
(.text+0x1a7e7): undefined reference to `ucol_close'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuFunctionError':
(.text+0x1a843): undefined reference to `u_errorName'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuCollationColl':
(.text+0x1a8f3): undefined reference to `ucol_strcoll'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuCollationDel':
(.text+0x1a90e): undefined reference to `ucol_close'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuLikeCompare':
(.text+0x1a9eb): undefined reference to `u_foldCase'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuLikeCompare':
(.text+0x1a9fe): undefined reference to `u_foldCase'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuRegexpDelete':
(.text+0x1aa99): undefined reference to `uregex_close'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuOpen':
(.text+0x3112f): undefined reference to `utf8_nextCharSafeBody'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuOpen':
(.text+0x3114e): undefined reference to `u_foldCase'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuOpen':
(.text+0x31284): undefined reference to `utf8_nextCharSafeBody'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuOpen':
(.text+0x312ba): undefined reference to `ubrk_open'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuOpen':
(.text+0x312dd): undefined reference to `ubrk_first'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuClose':
(.text+0x312ff): undefined reference to `ubrk_close'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuNext':
(.text+0x31338): undefined reference to `ubrk_current'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuNext':
(.text+0x31345): undefined reference to `ubrk_next'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuNext':
(.text+0x313a5): undefined reference to `u_isspace'
src/static-libs/libsqlite3.a(sqlite3.o): In function `icuNext':
(.text+0x3141e): undefined reference to `u_strToUTF8'
c++: error: linker command failed with exit code 1 (use -v to see invocation)


http://package22.nyi.freebsd.org/data/103i386-default-PR214384/2016-11-14_20h14m36s/logs/errors/lnav-0.8.1.log
Comment 1 Pavel Volkov 2016-11-16 04:28:14 UTC
Created attachment 177050 [details]
Path to add ICU.

Hello.
ICU Library is not part of the SQLite library.
Although SQLite may depend on the ICU.
In this case, you simply need to add the ICU as depend to your port.
Comment 2 Pavel Volkov 2016-11-16 04:34:24 UTC
Created attachment 177051 [details]
Path to add ICU.

I'm sorry. Change space char to tab. (portlint)
Comment 3 Jan Beich freebsd_committer freebsd_triage 2016-11-16 06:13:31 UTC
Comment on attachment 177051 [details]
Path to add ICU.

> +ICU_BUILD_DEPENDS=	${LOCALBASE}/bin/icu-config:devel/icu
> +ICU_LIB_DEPENDS=	libicudata.so:devel/icu

If the port depends on sqlite3 which is built against ICU then the latter is always available.

> +ICU_CPPFLAGS=	`${LOCALBASE}/bin/icu-config --cppflags`

Would only be needed if sqlite3 leaks ICU API.

> +ICU_LDFLAGS=	`${LOCALBASE}/bin/icu-config --ldflags`

It would link against ICU dynamically. Maybe pass CONFIGURE_ARGS=--disable-static instead. Static linking (or bundling) by default is discouraged, anyway.
Comment 4 Pavel Volkov 2016-11-16 07:37:57 UTC
Created attachment 177057 [details]
Dynamic linking

I agree. Dynamic linking is a good idea, if applicable to this port.
Comment 5 Pavel Volkov 2016-11-16 08:10:14 UTC
Created attachment 177058 [details]
Dynamic linking

PORTREVISION++
I'm sorry.
Comment 6 commit-hook freebsd_committer freebsd_triage 2016-12-11 17:02:27 UTC
A commit references this bug:

Author: jbeich
Date: Sun Dec 11 17:01:34 UTC 2016
New revision: 428364
URL: https://svnweb.freebsd.org/changeset/ports/428364

Log:
  sysutils/lnav: more dynamic linking

  Some libraries were still linked dynamically and it broke if
  databases/sqlite3 was built with ICU=on. To avoid missing out
  on stability and security fixes link all dependencies dynamically.

  PR:		214538
  Submitted by:	Pavel Volkov <pavelivolkov@gmail.com>
  Approved by:	maintainer timeout (3 weeks)

Changes:
  head/sysutils/lnav/Makefile