public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* 2.18 ar/ranlib glitch for mips elf64
@ 2010-06-04 17:57 Paul Koning
  2010-06-04 18:19 ` David Daney
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Koning @ 2010-06-04 17:57 UTC (permalink / raw)
  To: binutils

Gents,

In trying to build a toolchain that can handle MIPS N64, I ran into an
issue for that case.  I built a pile of object files (those are
elf64-tradlittlemips BFD format).  Built an archive with "ar cq" and
that worked.  But then attempts to look at that archive with ar or
ranlib fail with "File format is ambiguous" and "matching formats:
elf64-tradlittlemips ecoff-littlemips ecoff-bigmips".

I noticed the same issue applies to the libgcc.a that the GCC build
process creates.  Readelf tells me that every member in the archive is
elf64, so I have no idea where those ecoff things come from.  I see no
way to tell ar what the actual format is.

Should I use a newer binutils?  Should I yank ecoff support out?  (That
certainly wouldn't bother me...)

	paul

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.18 ar/ranlib glitch for mips elf64
  2010-06-04 17:57 2.18 ar/ranlib glitch for mips elf64 Paul Koning
@ 2010-06-04 18:19 ` David Daney
  2010-06-04 18:27   ` Paul Koning
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Daney @ 2010-06-04 18:19 UTC (permalink / raw)
  To: Paul Koning; +Cc: binutils

On 06/04/2010 10:57 AM, Paul Koning wrote:
> Gents,
>
> In trying to build a toolchain that can handle MIPS N64, I ran into an
> issue for that case.  I built a pile of object files (those are
> elf64-tradlittlemips BFD format).  Built an archive with "ar cq" and
> that worked.  But then attempts to look at that archive with ar or
> ranlib fail with "File format is ambiguous" and "matching formats:
> elf64-tradlittlemips ecoff-littlemips ecoff-bigmips".
>
> I noticed the same issue applies to the libgcc.a that the GCC build
> process creates.  Readelf tells me that every member in the archive is
> elf64, so I have no idea where those ecoff things come from.  I see no
> way to tell ar what the actual format is.
>
> Should I use a newer binutils?  Should I yank ecoff support out?  (That
> certainly wouldn't bother me...)

Try the latest released version.

Also which "ar" are you referring to above?  Is it the system ar or the 
ar you just built?  If you are in a cross environment, I don't think you 
can use the system ar.

David Daney

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: 2.18 ar/ranlib glitch for mips elf64
  2010-06-04 18:19 ` David Daney
@ 2010-06-04 18:27   ` Paul Koning
  2010-06-04 18:50   ` Paul Koning
  2010-06-04 21:14   ` Paul Koning
  2 siblings, 0 replies; 7+ messages in thread
From: Paul Koning @ 2010-06-04 18:27 UTC (permalink / raw)
  To: David Daney; +Cc: binutils

> > In trying to build a toolchain that can handle MIPS N64, I ran into
> an
> > issue for that case.  I built a pile of object files (those are
> > elf64-tradlittlemips BFD format).  Built an archive with "ar cq" and
> > that worked.  But then attempts to look at that archive with ar or
> > ranlib fail with "File format is ambiguous" and "matching formats:
> > elf64-tradlittlemips ecoff-littlemips ecoff-bigmips".
> >
> > I noticed the same issue applies to the libgcc.a that the GCC build
> > process creates.  Readelf tells me that every member in the archive
> is
> > elf64, so I have no idea where those ecoff things come from.  I see
> no
> > way to tell ar what the actual format is.
> >
> > Should I use a newer binutils?  Should I yank ecoff support out?
> (That
> > certainly wouldn't bother me...)
> 
> Try the latest released version.

Trying that now.

> Also which "ar" are you referring to above?  Is it the system ar or
the
> ar you just built?  If you are in a cross environment, I don't think
> you
> can use the system ar.

Sorry, I was using shorthand.  I meant the ar and ranlib that were built
in the cross build process.

	paul

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: 2.18 ar/ranlib glitch for mips elf64
  2010-06-04 18:19 ` David Daney
  2010-06-04 18:27   ` Paul Koning
@ 2010-06-04 18:50   ` Paul Koning
  2010-06-04 21:14   ` Paul Koning
  2 siblings, 0 replies; 7+ messages in thread
From: Paul Koning @ 2010-06-04 18:50 UTC (permalink / raw)
  To: David Daney; +Cc: binutils

> > In trying to build a toolchain that can handle MIPS N64, I ran into
> an
> > issue for that case.  I built a pile of object files (those are
> > elf64-tradlittlemips BFD format).  Built an archive with "ar cq" and
> > that worked.  But then attempts to look at that archive with ar or
> > ranlib fail with "File format is ambiguous" and "matching formats:
> > elf64-tradlittlemips ecoff-littlemips ecoff-bigmips".
> >
> > I noticed the same issue applies to the libgcc.a that the GCC build
> > process creates.  Readelf tells me that every member in the archive
> is
> > elf64, so I have no idea where those ecoff things come from.  I see
> no
> > way to tell ar what the actual format is.
> >
> > Should I use a newer binutils?  Should I yank ecoff support out?
> (That
> > certainly wouldn't bother me...)
> 
> Try the latest released version.

That fixes it.
 
Thanks!

	paul

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: 2.18 ar/ranlib glitch for mips elf64
  2010-06-04 18:19 ` David Daney
  2010-06-04 18:27   ` Paul Koning
  2010-06-04 18:50   ` Paul Koning
@ 2010-06-04 21:14   ` Paul Koning
  2010-06-05  6:44     ` Richard Sandiford
  2 siblings, 1 reply; 7+ messages in thread
From: Paul Koning @ 2010-06-04 21:14 UTC (permalink / raw)
  To: Paul Koning, David Daney; +Cc: binutils

> > > In trying to build a toolchain that can handle MIPS N64, I ran
into
> > an
> > > issue for that case.  I built a pile of object files (those are
> > > elf64-tradlittlemips BFD format).  Built an archive with "ar cq"
> and
> > > that worked.  But then attempts to look at that archive with ar or
> > > ranlib fail with "File format is ambiguous" and "matching formats:
> > > elf64-tradlittlemips ecoff-littlemips ecoff-bigmips".
> > >
> > > I noticed the same issue applies to the libgcc.a that the GCC
build
> > > process creates.  Readelf tells me that every member in the
archive
> > is
> > > elf64, so I have no idea where those ecoff things come from.  I
see
> > no
> > > way to tell ar what the actual format is.
> > >
> > > Should I use a newer binutils?  Should I yank ecoff support out?
> > (That
> > > certainly wouldn't bother me...)
> >
> > Try the latest released version.
> 
> That fixes it.

Well, yes and no.

It cures this particular problem, but replaces it by several others.

I'm trying to build a libc, which involves creating a pile of object
libraries, putting them into an archive (that step now works) and then
feeding that archive to the linker with a whole-archive switch.

That step is blowing up.  The way it blows up depends on whether I fed
the archive to ranlib.

If ranlib is NOT used, I see hundreds of assert failures in
bfd/elfxx-mips.c:3134, which seems to be a check on a GOT index.  (I
don't know what that means or how to debug it.)

If ranlib IS used, then the link fails with "member libc_pic.a() is not
an object".  That prompted me to do "ar -t" on the archive.  I noticed
that it has some blank lines in the output, which is very strange.
Those blank lines also show up in the n64 version of libgcc.a, but not
in the n32 version.

Something that's probably unrelated but I'll mention it just in case:
"readelf" applies to the archive after ranlib has been done on it fails
with a segmentation fault (and no other output).  It works fine on the
archive prior to ranlib.

I think I'm going to try Plan B...

	paul

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.18 ar/ranlib glitch for mips elf64
  2010-06-04 21:14   ` Paul Koning
@ 2010-06-05  6:44     ` Richard Sandiford
  2010-06-05 18:08       ` Paul Koning
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Sandiford @ 2010-06-05  6:44 UTC (permalink / raw)
  To: Paul Koning; +Cc: David Daney, binutils

"Paul Koning" <Paul_Koning@Dell.com> writes:
>> > > In trying to build a toolchain that can handle MIPS N64, I ran
> into
>> > an
>> > > issue for that case.  I built a pile of object files (those are
>> > > elf64-tradlittlemips BFD format).  Built an archive with "ar cq"
>> and
>> > > that worked.  But then attempts to look at that archive with ar or
>> > > ranlib fail with "File format is ambiguous" and "matching formats:
>> > > elf64-tradlittlemips ecoff-littlemips ecoff-bigmips".
>> > >
>> > > I noticed the same issue applies to the libgcc.a that the GCC
> build
>> > > process creates.  Readelf tells me that every member in the
> archive
>> > is
>> > > elf64, so I have no idea where those ecoff things come from.  I
> see
>> > no
>> > > way to tell ar what the actual format is.
>> > >
>> > > Should I use a newer binutils?  Should I yank ecoff support out?
>> > (That
>> > > certainly wouldn't bother me...)
>> >
>> > Try the latest released version.
>> 
>> That fixes it.
>
> Well, yes and no.
>
> It cures this particular problem, but replaces it by several others.
>
> I'm trying to build a libc, which involves creating a pile of object
> libraries, putting them into an archive (that step now works) and then
> feeding that archive to the linker with a whole-archive switch.
>
> That step is blowing up.  The way it blows up depends on whether I fed
> the archive to ranlib.
>
> If ranlib is NOT used, I see hundreds of assert failures in
> bfd/elfxx-mips.c:3134, which seems to be a check on a GOT index.  (I
> don't know what that means or how to debug it.)
>
> If ranlib IS used, then the link fails with "member libc_pic.a() is not
> an object".  That prompted me to do "ar -t" on the archive.  I noticed
> that it has some blank lines in the output, which is very strange.
> Those blank lines also show up in the n64 version of libgcc.a, but not
> in the n32 version.
>
> Something that's probably unrelated but I'll mention it just in case:
> "readelf" applies to the archive after ranlib has been done on it fails
> with a segmentation fault (and no other output).  It works fine on the
> archive prior to ranlib.

Best thing to do is file a bug report with specimen objects and archives.
There isn't really enough information here to tell what's going wrong.

FWIW, I was able to build n64 GLIBCs without problems in the past
(and did it regularly for a time).  Obviously others have too.
So it sounds like your problems might be specific to particular
features of the object files, rather than an ar-and-ranlib-just-
can't-handle-n64 level of problem.

Richard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: 2.18 ar/ranlib glitch for mips elf64
  2010-06-05  6:44     ` Richard Sandiford
@ 2010-06-05 18:08       ` Paul Koning
  0 siblings, 0 replies; 7+ messages in thread
From: Paul Koning @ 2010-06-05 18:08 UTC (permalink / raw)
  To: Richard Sandiford; +Cc: David Daney, binutils

> ...
> Best thing to do is file a bug report with specimen objects and
> archives.
> There isn't really enough information here to tell what's going wrong.
> 
> FWIW, I was able to build n64 GLIBCs without problems in the past
> (and did it regularly for a time).  Obviously others have too.
> So it sounds like your problems might be specific to particular
> features of the object files, rather than an ar-and-ranlib-just-
> can't-handle-n64 level of problem.

Ok, I'll try to isolate the problem.  The library being built in this
case is newlib (on NetBSD).  Also, does the gcc version matter?  I would
hope not since gcc doesn't deal in binaries, but in any case, it's
3.3.3.

	paul

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-06-05 18:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-04 17:57 2.18 ar/ranlib glitch for mips elf64 Paul Koning
2010-06-04 18:19 ` David Daney
2010-06-04 18:27   ` Paul Koning
2010-06-04 18:50   ` Paul Koning
2010-06-04 21:14   ` Paul Koning
2010-06-05  6:44     ` Richard Sandiford
2010-06-05 18:08       ` Paul Koning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).