Subject: Bug in ar?
To: NetBSD digest <port-mac68k@netbsd.org>
From: Larry Kollar <Larry.Kollar@arris-i.com>
List: port-mac68k
Date: 09/02/1998 11:17:34
Before I get started, I've had some feedback on my Install-HOWTO
document (yay!).  I should have the edits up this weekend, if
Earl doesn't decide to visit the north Georgia mountains.

Now to the matter at hand.  This is on a Mac IIsi, 17MB RAM,
NetBSD 1.3.

I downloaded the SGML-Tools tarball & attempted to compile.  Oops,
we need gmake, got the binary package, it started grinding away
at the source.  The compile uses c++ rather heavily.

While building the library libsp.a, "ar" apparantly chokes on
several files.  My first indication of a problem was when gmake
tried to link an executable with this library: "malformatted
__.SYMDEF" was the dying gasp from ld.  This was the same
problem I had trying to compile pine some time back.

Breaking the huge ar command into about 20 separate commands
let me pinpoint the trouble to certain .o files.  When you
add one of these files, the next ar -t or ar -r spits up an
error "libsp.a: inappropriate file type or format."  The
library apparantly gets corrupted when you add them but does
not give any indication of a problem at the time.

=====================
What I've determined:

Size matters, but not always.
    At first, I thought it was a problem with .o files over
    64K in size; that's not necessarily the case but large .o
    files are overrepresented.  Some 50KB files give trouble,
    while one or two files that are 68KB or bigger don't.

Warnings aren't a factor.
    Several files compiled with warnings, but this doesn't
    seem to have a bearing on the problem.

File name length doesn't matter.
    According to the manpages, older library files had trouble
    with large (16+ char) file names, but most of the problem
    files have shorter names.

========================
What I haven't done yet:

Filed a send-pr.
	I don't know if it's just me yet, and I'd like to pinpoint
    the problem first.  I didn't find anything in the send-pr
    bug list.

Replaced ar.
    It seems to work for most of the files, so I don't think
    it's corrupt.  Is there a different utility?

Upgraded to 1.3.2.
    But I will if it'll fix this problem.  Any assurances?

Tried a different compiler.
    I suppose it *could* be a compiler bug.  But isn't c++
    linked to gcc or gpp or whatever?

I presume this problem has been fixed somewhere, since a
binary package for pine (which has also given me trouble) is
available on ftp.netbsd.org.

If anyone would like to pile on this problem, I'd appreciate
it.  This should be reproducible by downloading SGML-Tools &
trying to compile it (you'll need gmake too).

Thanks,

	Larry