public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* x86 gas "hides" reported egcs/dwarf build problem
@ 1998-05-16  1:18 Robert Lipe
  1998-05-16 16:45 ` H.J. Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Lipe @ 1998-05-16  1:18 UTC (permalink / raw)
  To: egcs

Within the last week, several OpenServer users reported that EGCS had
stopped building for them.   The exact errors varied a little, but the
common theme was unresolved labels in dwarf debugging for the C++ part
of the build.

Linux works.  (Of course.)   So I stared at the generated assembly from
the same version of egcs targeted for both OpenServer and Linux.   We
may have more than one bug here.

This program will assemble on Linux gas 2.8.1 as shipped with RH5.  It
won't link.

$ cat /tmp/x.s
.section        .debug
        .4byte  .L_T88
.previous

On OpenServer, it assembles with GAS but doesn't assemble with the native
assembler.   Unfortunately, the native assembler really is required for
EGCS on OpenServer.

(robertl) rjlhome:/play/negcs
$ /usr/ccs//bin/as -belf -o x.o /tmp/x.s
(EOF):undefined name: .L_T88
(robertl) rjlhome:/play/negcs
$ /usr/local//bin/as -belf -o x.o /tmp/x.s
(robertl) rjlhome:/play/negcs


The compile line that got me here was the same as I'd described before:


$ cat /tmp/ckill
/home/play/negcs/gcc/xgcc -B/home/play/negcs/gcc/ -gdwarf -fverbose-asm -g -c  -O2 -Wall  \
        -fno-implicit-templates -I. -I/net/rjlhome/home/play//egcs/libio -nostdinc++   \
        /net/rjlhome/home/play//egcs/libio/builtinbuf.cc

(robertl) rjlhome:/play/negcs/gcc
$ sh /tmp/ckill
(EOF):undefined name: .L_T87




Now, if I hop back to the Linux box and look at the generated builtinbuf.o,
there's a "dangling" reference to this same label.   (OK, the label itself
is different, but it's the same place in the generated .s file.)

$ nm builtinbuf.o
         U .L_T88
00000000 ? __FRAME_BEGIN__
         U _pthread_cleanup_pop_restore
         U _pthread_cleanup_push_defer
00000000 t gcc2_compiled.


Is it possible that this just shows up as an assembler error on OpenServer
and will show up on Linux as a link error when the user tries to link
against  'builtinbuf.o'?

So, since .L's are typically program internal labels and this one is
being referenced but not defined, that's probably an EGCS bug.   I don't
know which assembler is "more correct", but if the test cases don't try
to link against this object file, that explains why this problem is 
showing up on OpenServer during build and not Linux during the testsuite.


Oh.  Duh.  Another reason this doesn't show up on Linux is that dwarf
isn't the default.  You have to whack Linux with -gdwarf to get it to fail.
That is a far better reason why the Linux test results haven't been going
up in flames.

Let's go back to the Linux box for one last test:

$ rm -f libraries/libio/builtinbuf.o
(robertl) rjlgemini:/home/robertl/tmp/negcs
$ make LANGUAGES="c c++" CXXFLAGS="-g -O2" > /dev/null
(robertl) rjlgemini:/home/robertl/tmp/negcs
$ nm libraries/libio/builtinbuf.o
00000000 ? __FRAME_BEGIN__
         U _pthread_cleanup_pop_restore
         U _pthread_cleanup_push_defer
(robertl) rjlgemini:/home/robertl/tmp/negcs
$ rm -f libraries/libio/builtinbuf.o
(robertl) rjlgemini:/home/robertl/tmp/negcs
$ make LANGUAGES="c c++" CXXFLAGS="-gdwarf -O2" > /dev/null
(robertl) rjlgemini:/home/robertl/tmp/negcs
$ nm libraries/libio/builtinbuf.o
         U .L_T88
00000000 ? __FRAME_BEGIN__
         U _pthread_cleanup_pop_restore
         U _pthread_cleanup_push_defer
00000000 t gcc2_compiled.



I suppose the punchline is that it isn't OpenServer-specific.  It's 
visible on two dwarf-x86 targets and the failure case differs becuase
of the differences in the assemblers.


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

* Re: x86 gas "hides" reported egcs/dwarf build problem
  1998-05-16  1:18 x86 gas "hides" reported egcs/dwarf build problem Robert Lipe
@ 1998-05-16 16:45 ` H.J. Lu
  1998-05-16 19:47   ` Robert Lipe
  0 siblings, 1 reply; 3+ messages in thread
From: H.J. Lu @ 1998-05-16 16:45 UTC (permalink / raw)
  To: Robert Lipe; +Cc: egcs

> 
> Oh.  Duh.  Another reason this doesn't show up on Linux is that dwarf
> isn't the default.  You have to whack Linux with -gdwarf to get it to fail.
> That is a far better reason why the Linux test results haven't been going
> up in flames.
> 

That is one reason why Linux doesn't use DWARF as default. My time
is better spent on something else.

H.J.

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

* Re: x86 gas "hides" reported egcs/dwarf build problem
  1998-05-16 16:45 ` H.J. Lu
@ 1998-05-16 19:47   ` Robert Lipe
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Lipe @ 1998-05-16 19:47 UTC (permalink / raw)
  To: egcs

RJL> Oh.  Duh.  Another reason this doesn't show up on Linux is that
RJL> dwarf isn't the default.  You have to whack Linux with -gdwarf to
RJL> get it to fail.

HJL> That is one reason why Linux doesn't use DWARF as default. My time
HJL> is better spent on something else.

Considering the state of the GNU tools w.r.t. DWARF at the time
you made that decision for Linux, it was clearly the right one.  I
understand that it's been fairly recently that the functionality of
DWARF debugging with GNU tools has reached that of the STABS format.
But GAS (required for STABS) doesn't deliver all the functionality we
need in OpenServer-land without a lot of largely pointless work.

The point wasn't that I was trying to break Linux or pressure anyone to
switch the default.  It was that the problem I cited preproducable on
Linux which is a much more common host/target on this list.


RJL

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

end of thread, other threads:[~1998-05-16 19:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-05-16  1:18 x86 gas "hides" reported egcs/dwarf build problem Robert Lipe
1998-05-16 16:45 ` H.J. Lu
1998-05-16 19:47   ` Robert Lipe

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).