* Failure to link GDB 7.6
@ 2012-08-18 12:42 Eli Zaretskii
2012-08-18 15:51 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2012-08-18 12:42 UTC (permalink / raw)
To: gdb-patches
On GNU/Linux, I get the following link error trying to build GDB 7.5:
gcc -g -O2 \
-o gdb gdb.o amd64-tdep.o amd64-linux-tdep.o i386-tdep.o i387-tdep.o i386-linux-tdep.o glibc-tdep.o solib-svr4.o symfile-mem.o linux-tdep.o linux-record.o ser-base.o ser-unix.o ser-pipe.o ser-tcp.o inf-ptrace.o fork-child.o i386-nat.o amd64-nat.o amd64-linux-nat.o linux-nat.o linux-osdata.o proc-service.o linux -thread-db.o linux-fork.o linux-procfs.o linux-ptrace.o remote.o dcache.o tracepoint.o ax-general.o ax-gdb.o remote-fileio.o cli-dump.o cli-decode.o cli-script.o cli-cmds.o cli-setshow.o cli-logging.o cli-interp.o cli-utils.o mi-out.o mi-console.o mi-cmds.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o mi-cmd-file.o mi-cmd-disas.o mi-symbol-cmds.o mi-cmd-target.o mi-cmd-info.o mi-interp.o mi-main.o mi-parse.o mi-getopt.o tui-command.o tui-data.o tui-disasm.o tui-file.o tui-hooks.o tui-interp.o tui-io.o tui-layout.o tui-out.o tui-regs.o tui-source.o tui-stack.o tui-win.o tui-windata.o tui-wingeneral.o tui-winsource.o tui.o python.o py-auto-load.o py-block.o py-bpe
../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lncurses -lz -lm -L/home/e/eliz/lib/python2.6/config -lpthread -ldl -lutil -lm -lpython2.6 -Xlinker -export-dynamic /home/e/eliz/lib/libexpat.so -Wl,-rpath -Wl,/home/e/eliz/lib ../libiberty/libiberty.a build-gnulib/import/libgnu.a -ldl -rdynamic
/home/e/eliz/lib/python2.6/config/libpython2.6.a(posixmodule.o): In function `posix_tmpnam':
/home/e/eliz/Python-2.6.1/./Modules/posixmodule.c:7079: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/home/e/eliz/lib/python2.6/config/libpython2.6.a(posixmodule.o): In function `posix_tempnam':
/home/e/eliz/Python-2.6.1/./Modules/posixmodule.c:7034: warning: the use of `tempnam' is dangerous, better use `mkstemp'
charset.o: In function `do_cleanup_iterator':
/home/e/eliz/gdb-7.5/gdb/charset.c:615: undefined reference to `libiconv_close'
charset.o: In function `validate':
/home/e/eliz/gdb-7.5/gdb/charset.c:325: undefined reference to `libiconv_open'
/home/e/eliz/gdb-7.5/gdb/charset.c:329: undefined reference to `libiconv_close'
/home/e/eliz/gdb-7.5/gdb/charset.c:331: undefined reference to `libiconv_open'
/home/e/eliz/gdb-7.5/gdb/charset.c:335: undefined reference to `libiconv_close'
charset.o: In function `wchar_iterate':
/home/e/eliz/gdb-7.5/gdb/charset.c:648: undefined reference to `libiconv'
charset.o: In function `make_wchar_iterator':
/home/e/eliz/gdb-7.5/gdb/charset.c:594: undefined reference to `libiconv_open'
charset.o: In function `convert_between_encodings':
/home/e/eliz/gdb-7.5/gdb/charset.c:487: undefined reference to `libiconv_open'
/home/e/eliz/gdb-7.5/gdb/charset.c:509: undefined reference to `libiconv'
charset.o: In function `cleanup_iconv':
/home/e/eliz/gdb-7.5/gdb/charset.c:465: undefined reference to `libiconv_close'
collect2: ld returned 1 exit status
It uses libiconv I built myself:
checking how to link with libiconv... /home/e/eliz/lib/libiconv.so -Wl,-rpath -Wl,/home/e/eliz/lib
checking for iconv declaration... install-shextern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
What is wrong with my libiconv? (There's no other libiconv on this
system, which is why I built my own some time ago.)
TIA
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Failure to link GDB 7.6
2012-08-18 12:42 Failure to link GDB 7.6 Eli Zaretskii
@ 2012-08-18 15:51 ` Joel Brobecker
2012-08-18 17:03 ` Failure to link GDB 7.5 Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2012-08-18 15:51 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
> What is wrong with my libiconv? (There's no other libiconv on this
> system, which is why I built my own some time ago.)
I do not think it's your libiconv. It looks like the link command is
missing the reference to libiconv (something like -liconv, or /path/to/
libiconv.so in your case [which I find a little unusual on a Unix system]).
It is probably a consequence of how you configured GDB. I think that
if you configure with --with-libiconv-prefix=/path/to/libiconv/prefix,
everything should work (famous last words).
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Failure to link GDB 7.5
2012-08-18 15:51 ` Joel Brobecker
@ 2012-08-18 17:03 ` Eli Zaretskii
2012-08-18 17:17 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2012-08-18 17:03 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
> Date: Sat, 18 Aug 2012 08:51:36 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb-patches@sourceware.org
>
> > What is wrong with my libiconv? (There's no other libiconv on this
> > system, which is why I built my own some time ago.)
>
> I do not think it's your libiconv. It looks like the link command is
> missing the reference to libiconv (something like -liconv, or /path/to/
> libiconv.so in your case [which I find a little unusual on a Unix system]).
> It is probably a consequence of how you configured GDB. I think that
> if you configure with --with-libiconv-prefix=/path/to/libiconv/prefix,
> everything should work (famous last words).
It didn't work (note that in the original build, I showed a line from
the configure script output that found my libiconv).
But your suggestion pointed me in the right direction: I eventually
succeeded by running "make INTL='-L/home/e/eliz/lib -liconv'".
I wonder why the default command didn't work. Let me know if you need
me to dig deeper.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Failure to link GDB 7.5
2012-08-18 17:03 ` Failure to link GDB 7.5 Eli Zaretskii
@ 2012-08-18 17:17 ` Joel Brobecker
0 siblings, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2012-08-18 17:17 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
> But your suggestion pointed me in the right direction: I eventually
> succeeded by running "make INTL='-L/home/e/eliz/lib -liconv'".
You shouldn't need that, it should all be done automatically.
But to figure out why, you'll probably need to dig into the AM_ICONV
function. Personally, I find it simplest to embed the libiconv sources
in my GDB sources, and let GDB do all the work (if the libiconv sources
are in-tree, it automatically builds them, and GDB automatically uses
that build).
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-18 17:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-18 12:42 Failure to link GDB 7.6 Eli Zaretskii
2012-08-18 15:51 ` Joel Brobecker
2012-08-18 17:03 ` Failure to link GDB 7.5 Eli Zaretskii
2012-08-18 17:17 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox