[Xapian-tickets] [Xapian] #775: xapian-omega can't find non-system iconv installations

Xapian nobody at xapian.org
Wed Jan 30 23:24:03 GMT 2019


#775: xapian-omega can't find non-system iconv installations
-------------------------------+-------------------
        Reporter:  ryandesign  |      Owner:  olly
            Type:  defect      |     Status:  new
        Priority:  normal      |  Milestone:
       Component:  Omega       |    Version:  1.4.9
        Severity:  normal      |   Keywords:
      Blocked By:              |   Blocking:
Operating System:  All         |
-------------------------------+-------------------
 Hello, I'm investigating the possibility of
 [https://trac.macports.org/ticket/29654 adding xapian-omega to MacPorts].
 I used the `--with-iconv` configure flag, which resulted in the error
 message:

 {{{
 checking for library containing iconv... no
 configure: error: iconv not found, but --with-iconv specified
 }}}

 The config.log says:

 {{{
 configure:17416: checking for library containing iconv
 configure:17447: ccache /usr/bin/clang++ -o conftest -pipe -Os
 -stdlib=libc++ -arch x86_64 -arch i386 -std=gnu++11 -I/opt/local/include
 -I/opt/local/include -L/opt/local/lib -Wl,-headerpad_max_install_names
 -arch x86_64 -arch i386 conftest.cpp  >&5
 Undefined symbols for architecture x86_64:
   "_iconv", referenced from:
       _main in conftest-5ad1ad.o
 ld: symbol(s) not found for architecture x86_64
 clang: error: linker command failed with exit code 1 (use -v to see
 invocation)
 }}}

 and then:

 {{{
 configure:17447: ccache /usr/bin/clang++ -o conftest -pipe -Os
 -stdlib=libc++ -arch x86_64 -arch i386 -std=gnu++11 -I/opt/local/include
 -I/opt/local/include -L/opt/local/lib -Wl,-headerpad_max_install_names
 -arch x86_64 -arch i386 conftest.cpp -liconv   >&5
 Undefined symbols for architecture x86_64:
   "_iconv", referenced from:
       _main in conftest-519ed3.o
 ld: symbol(s) not found for architecture x86_64
 clang: error: linker command failed with exit code 1 (use -v to see
 invocation)
 }}}

 So it tried to find iconv both with and without `-liconv` and failed both
 times. libiconv is installed with !MacPorts so it should have succeeded
 when using `-liconv`.

 The reason it failed is that it is searching only for a symbol called
 `iconv`. Only a primary libiconv installation, such as that provided by an
 operating system vendor (and configured with `LIBICONV_PLUG` set), will
 have the symbol `iconv`. But in any secondary copies of libiconv, such as
 the one provided by !MacPorts, Fink, Homebrew, or manually compiled by the
 user, the symbol will instead be called `libiconv`. Other symbols in
 secondary libiconv installations are similarly mangled. This symbol
 mangling is intentional, so that a user-supplied copy of libiconv does not
 interfere with a system-provided possibly older version of libiconv or
 even a non-libiconv iconv implementation.

 As long as you `#include <iconv.h>` this symbol renaming is transparent to
 you. So you probably only need to modify the configure script to include
 that header in that test. I'm not an autotools expert and don't know the
 best way to accomplish that. There is an iconv.m4 file provided by gettext
 which you might be able to look at for ideas.

--
Ticket URL: <https://trac.xapian.org/ticket/775>
Xapian <https://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list