[Bug 266241] devel/libdatrie build fails if converters/libiconv is installed

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 05 Sep 2022 21:18:08 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266241

            Bug ID: 266241
           Summary: devel/libdatrie build fails if converters/libiconv is
                    installed
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: se@FreeBSD.org

If converters/libiconv is installed, the devel/libdatrie runs a configure test
with -liconv, but ${ICONV_LIB} is expanded to an empty string on systems that
have iconv functionality in libc.so.

But the iconv functionality in libc.so is incomplete, it does specifically lack
the locale_charset() function that is provided by libiconv.so (that had been
used by the configure script).

libtool: link: cc -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem
/usr/local/include -fno-strict-aliasing -fstack-protector-strong -o
.libs/trietool trietool.o  -L/usr/local/lib ../datrie/.libs/libdatrie.so
-Wl,-rpath -Wl,/usr/local/lib
ld: error: undefined symbol: locale_charset
>>> referenced by trietool.c
>>>               trietool.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

To reproduce install converters/libiconv on the base system and then try to
build the devel/libdatrie port on the base system.


The magic in Uses/iconv.mk does not cover the case where locale_charset() is
required by a port.

A solution could be to forcefully depend on converters/libiconv and to link
against -liconv (instead of ${ICONV_LIB}).

Another possibility is to link against libunistring.so in addition to libc.so
(but that does only move the extra dependency to a different port).

Patching the port to not require locale_charset() but to use nl_langinfo()
instead could also allow the port to build in all cases.

-- 
You are receiving this mail because:
You are the assignee for the bug.