Subject: Problems building some common tools
To: None <tech-misc@netbsd.org>
From: Seth Kurtzberg <seth@cql.com>
List: tech-misc
Date: 09/24/2001 13:25:04
This is a multi-part message in MIME format.

------=_NextPart_000_0011_01C144FC.527CEA10
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hello,

I've encountered some problems building some common GNU tools on NetBSD
1.5.2.

I have fairly extensive experience with Solaris, FreeBSD, and Linux, so I
don't think I'm doing anything entirely simpleminded.  There is probably a
configuration issue, perhaps an autoconf parameter, that is common to all
these problems.  It strikes me as extremely unlikely that there is a serious
problem with GNU tools on NetBSD.

I've encountered errors trying to build gcc (both 2.95 and the recent 3.x
releases), as well as emacs.
The problem with gcc looks to me as if autoconf may be confused about the
type of executable format (a.out, elf, coff) that is supported by the
system.  As far as I can tell from the kernel configuration, all three are
supported by the kernel I have running.  However, the crt0.o file (and other
.o files in /usr/lib) are available in only one format, which the file
command reports as:

    ELF 32-bit LSB relocatable, Intel 80386, version 1, not stripped

autoconf does report that it is building for an elf environment.  However,
later in the process a ld command terminates with an error about a
particular memory location not being on a two byte boundary.

I tried rebuilding binutils, but that made things work, because I think I
ended up with some tools expecting elf formats trying to work with others
expecting a.out (or perhaps coff).

Building emacs, I see two problems.  First, the compile fails for unexec.c.
This is easily fixed by adding an include of <sys/types.h>, and is probably
the result of a missing #if defined type line for NetBSD.  (There is a line
for FreeBSD that forces sys/types.h to be included.)  Anyway, this is easily
worked around.

Then an undefined external occurs, of __progname.  This is again easily
fixed, as there is a section conditionally compiled for FreeBSD that defines
__progname in ecrt0.c.

The last problem, however, I don't know how to fix.  The _start symbol is
undefined.  This is defined in /usr/lib/crt0.o, and should be defined in
ecrt0.c.  Unfortunately, it is defined in ecrt0.c with inline assembly code,
and I don't know what needs to be added.  (Actually, it is defined with
inline assembly for some environments and C code for others.)

Any help will be greatly appreciated.
Seth Kurtzberg
Machine Independent Software
voice:  1-480-661-1849
fax:    1-480-614-8909
email:  seth@cql.com
Pager 1-888-605-9296  or 6059296@skytel.com



------=_NextPart_000_0011_01C144FC.527CEA10
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4611.1300" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486430220-24092001>Hello,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486430220-24092001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486430220-24092001>I've =
encountered=20
some problems building some common GNU tools on NetBSD=20
1.5.2.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486430220-24092001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486430220-24092001>I have =
fairly=20
extensive experience with Solaris, FreeBSD, and Linux, so I don't think =
I'm=20
doing anything entirely simpleminded.&nbsp; There is probably a =
configuration=20
issue, perhaps an autoconf parameter, that is common to all these=20
problems.&nbsp; It strikes me as extremely unlikely that there is a =
serious=20
problem with GNU tools on NetBSD.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486430220-24092001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486430220-24092001>I've =
encountered=20
errors trying to build gcc (both 2.95 and the recent 3.x releases), as =
well as=20
emacs.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486430220-24092001>The =
problem with gcc=20
looks to me as if autoconf may be confused about the type of executable =
format=20
(a.out, elf, coff) that is supported by the system.&nbsp; As far as I =
can tell=20
from the kernel configuration, all three are supported by the kernel I =
have=20
running.&nbsp; However, the crt0.o file (and other .o files in /usr/lib) =
are=20
available in only one format, which the file command reports=20
as:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486430220-24092001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D486430220-24092001>&nbsp;&nbsp;&nbsp;=20
ELF 32-bit LSB relocatable, Intel 80386, version 1, not=20
stripped</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486430220-24092001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D486430220-24092001>autoconf does report=20
that it is building for an elf environment.&nbsp; However, later in the =
process=20
a ld command terminates with an error about a particular memory location =
not=20
being on a two byte boundary.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486430220-24092001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486430220-24092001>I =
tried rebuilding=20
binutils, but that made things work, because I think I ended up with =
some tools=20
expecting elf formats trying to work with others expecting a.out (or =
perhaps=20
coff).</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486430220-24092001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D486430220-24092001>Building emacs, I=20
see two problems.&nbsp; First, the compile fails for unexec.c.&nbsp; =
This is=20
easily fixed by adding an include of &lt;sys/types.h&gt;, and is =
probably the=20
result of a missing #if defined type line for NetBSD.&nbsp; (There is a =
line for=20
FreeBSD that forces sys/types.h to be included.)&nbsp; Anyway, this is =
easily=20
worked around.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486430220-24092001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486430220-24092001>Then =
an undefined=20
external occurs, of __progname.&nbsp; This is again easily fixed, as =
there is a=20
section conditionally compiled for FreeBSD that defines __progname in=20
ecrt0.c.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486430220-24092001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486430220-24092001>The =
last problem,=20
however, I don't know how to fix.&nbsp; The _start symbol is =
undefined.&nbsp;=20
This is defined in /usr/lib/crt0.o, and should be defined in =
ecrt0.c.&nbsp;=20
Unfortunately, it is defined in ecrt0.c with inline assembly code, and I =
don't=20
know what needs to be added.&nbsp; (Actually, it is defined with inline =
assembly=20
for some environments and C code for others.)</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D486430220-24092001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D486430220-24092001>Any =
help will be=20
greatly appreciated.</SPAN></FONT></DIV>
<P><FONT size=3D2>Seth Kurtzberg<BR>Machine Independent =
Software<BR>voice:&nbsp;=20
1-480-661-1849<BR>fax:&nbsp;&nbsp;&nbsp; 1-480-614-8909<BR>email:&nbsp;=20
seth@cql.com<BR>Pager 1-888-605-9296&nbsp; or 6059296@skytel.com</FONT> =
</P>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0011_01C144FC.527CEA10--