<div dir="ltr"><br><br>Looks like a failing in the GDB configure magic which finds libiconv<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <strong class="gmail_sendername" dir="auto">John Baldwin</strong> <span dir="auto"><<a href="mailto:jhb@freebsd.org">jhb@freebsd.org</a>></span><br>Date: Fri, Nov 8, 2019 at 11:20 AM<br>Subject: Re: Build Error on FreeBSD 12<br>To:  <<a href="mailto:joel@rtems.org">joel@rtems.org</a>>,  <<a href="mailto:gdb@sourceware.org">gdb@sourceware.org</a>><br></div><br><br>On 10/30/19 11:41 AM, Joel Sherrill wrote:<br>
> Hi<br>
> <br>
> When building gdb 8.3 for *-rtems5 targets on FreeBSD 12, we are getting<br>
> undefined errors for libiconv symbols. The messages are like this:<br>
> <br>
> ================================<br>
>  CXXLD  gdb<br>
> charset.o: In function `convert_between_encodings(char const*, char const*,<br>
> unsigned char const*, unsigned int,<br>
> int, obstack*, transliterations)':<br>
> charset.c:(.text+0x251): undefined reference to `libiconv_open'<br>
> charset.c:(.text+0x2df): undefined reference to `libiconv'<br>
> charset.c:(.text+0x434): undefined reference to `libiconv_close'<br>
> charset.c:(.text+0x486): undefined reference to `libiconv_close'<br>
> charset.o: In function `wchar_iterator::wchar_iterator(unsigned char<br>
> const*, unsigned int, char const*, unsigned<br>
>  int)':<br>
> charset.c:(.text+0x4f9): undefined reference to `libiconv_open'<br>
> ================================<br>
> <br>
> Q1: The compile line is shortened in the output so I can't tell what it is<br>
> linking command is really doing. What's the magic for having the full<br>
> command lines printed?<br>
> <br>
> Q2: Does this sound familiar to anyone? We build fine on other OSes and<br>
> apparently this<br>
> doesn't happen on FreeBSD 11. Any hint is appreciated.<br>
> <br>
> The config.log does show it found iconv().<br>
<br>
Hmm, I haven't had a bare ./configure work on FreeBSD for quite some time<br>
as it doesn't add the needed -L /usr/local/lib for libiconv even though<br>
the configure scripts figure out that it needs -I /usr/local/include.<br>
However, that was true for me on older releases, not just 12.  The FreeBSD<br>
port (and my own build scripts for doing gdb work) work around this by<br>
defining LDFLAGS="-L /usr/local/lib" in the environment when invoking<br>
./configure, e.g.:<br>
<br>
env LDFLAGS="-L /usr/local/lib" ./configure<br>
<br>
-- <br>
John Baldwin<br>
</div></div>