compiling gdb-6.3 [minix3.1.8-vmware]

19 views
Skip to first unread message

r0ller

unread,
Nov 6, 2010, 5:06:18 AM11/6/10
to minix3
Hi all,

I saw gdb-6.3 on svn and gave it a try and managed to get through
quite a many problems (like missing st_blksize and st_blocks members
in struct stat in stat.h whose corresponding types I defined in minix/
types.h:) but now I'm stucked. When finally building gdb itself, I
get:

libgdb.a(inflow.o): In function `_gdb_has_a_terminal':
/home/r0ller/trunk/gdb-6.3/build/gdb/../../gdb/inflow.c:142: undefined
reference to `_tcgetpgrp'
libgdb.a(inflow.o): In function `_terminal_ours_1':
/home/r0ller/trunk/gdb-6.3/build/gdb/../../gdb/inflow.c:349: undefined
reference to `_tcgetpgrp'
/home/r0ller/trunk/gdb-6.3/build/gdb/../../gdb/inflow.c:378: undefined
reference to `_tcsetpgrp'
libgdb.a(inflow.o): In function `_terminal_inferior':
/home/r0ller/trunk/gdb-6.3/build/gdb/../../gdb/inflow.c:275: undefined
reference to `_tcsetpgrp'
collect2: ld returned 1 exit status

I tried to look up the header and the library needed which as far as I
know are unistd.h and libc. Actually, libc.a resides in a few places
in different minix directories (/usr/gnu/lib, /usr/lib, /usr/lib/i386)
of which I tried all but none of them helped. Does anyone has any idea
what shall I try now Any ideas are welcome since I already hacked the
system way too much to get gdb work. By the way, to configure gdb I
simply disabled nls (--disable-nls) since I couldn't get through
problems during make like: 'don't know how to make ../intl/libintl.a'.

Thanks,
r0ller

Erik van der Kouwe

unread,
Nov 6, 2010, 5:19:52 AM11/6/10
to minix3
Hi,

> I saw gdb-6.3 on svn and gave it a try and managed to get through
> quite a many problems (like missing st_blksize and st_blocks members
> in struct stat in stat.h whose corresponding types I defined in minix/
> types.h:) but now I'm stucked. When finally building gdb itself, I
> get:

Thanks for working on this, it would be great to have GDB.

One warning though: I don't know much about the attempted GDB port on
SVN, but I'm afraid these compile errors may be the least of your
worries. Debuggers such as GDB are based on ptrace, a non-POSIX call
which is completely non-portable. If this hasn't been done yet you
will have to change Linux ptrace calls into MINIX ones. I don't know
much about it, but they may not map onto each other well. I recommend
you check whether this part is feasible before investing a lot of time
in GDB.

The missing terminal control functions are not implemented in MINIX,
even though there is a prototype in the headers and an ioctl. The
ioctl always returns ENOTTY, so you could attempt to fix the issue by
adding stub functions which do the same.

We are working on getting the netbsd lic in MINIX, which will probably
provide these features off the shelf. It is therefore not worthwhile
to implement them now.

With kind regards,
Erik

Antoine LECA

unread,
Nov 8, 2010, 4:00:39 AM11/8/10
to min...@googlegroups.com
r0ller wrote:
> Actually, libc.a resides in a few places in different minix directories
> (/usr/gnu/lib,

Antic (i.e., up to 3.1.8) libc for COMPILER_TYPE=gnu; you should
probably get rid of it if you have the next one, it might cause harm
(also if you got build.minix which references it, remove the /gnu/).
This is the SVN revision 8245
http://gforge.cs.vu.nl/gf/project/minix/scmsvn/?action=browse&path=/&view=rev&revision=8245;
right now .o members are in MINIX3-specific a.out format, stored into
ASCII archive with BSD-style binary index (named __.SYMDEF) and
GNU-style long filenames table ("ARFILENAMES/" pseudo member), even if I
guess the latter does not really matter and is just an artefact of the
tool used, nowadays most archivers also understand the #1/ format from
BSD 4.4+; you can (really should) use the MINIX3-specific GNU linker
[g]ld and archiver ar to make use of them.

> /usr/lib,

Up to date place for libc.a (and others) for COMPILER_TYPE=gnu; same
format as described above, logically.

> /usr/lib/i386)

The usual libc.a for COMPILER_TYPE=ack; ACK-specific (COFF-like) "out.h"
format, stored into V7-style (i.e. PDP11-ordering, 14-chars limit)
archives with index (named __.SYMDEF): the result is that about only ACK
linker (em_led) and ACK archiver (aal) can make use of them.


Hope it helps.

Antoine

Reply all
Reply to author
Forward
0 new messages