public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* arch=i686, -fPIC won't play nice on OSR5
@ 1998-06-18 13:51 Robert Lipe
  1998-06-29 23:17 ` analysis: " Robert Lipe
       [not found] ` <19980629225242.A18742.cygnus.egcs@dgii.com>
  0 siblings, 2 replies; 3+ messages in thread
From: Robert Lipe @ 1998-06-18 13:51 UTC (permalink / raw)
  To: egcs

I won't bother with the full testsuite results becuase they're so noisy
as to be uninteresting.   Here's the punchline.

$ cat /tmp/x.c
main()
{
  exit(0);
}

foo(){}

$ ./xgcc -march=i586 -B./ -fPIC  /tmp/x.c
(robertl) rjlhome:/play/negcs/gcc
$ ./xgcc -march=i686 -B./ -fPIC  /tmp/x.c
(EOF):useless specification of size and/or type for name: .LPR0


Let's look at the generated code:

$ ./xgcc -march=i686 -B./ -fPIC  -S /tmp/x.c
(robertl) rjlhome:/play/negcs/gcc
$ head x.s
        .file   "x.c"
        .version        "01.01"
gcc2_compiled.:
__gnu_compiled_c:
        .text
        .align 4
        .type    .LPR0,@function
.LPR0:
        movl (%esp),%ebx
        ret


Since the label .LPR0 isn't global, the SCO assembler is squawking about
it having a debugging type.  If I insert '.globl .LPR0' it assembles.
If I change all occurrences of '.LPR0' to 'LPR0' it assembles.


For some reason, this particular sequence of events is unique (?) to
-fPIC and -march=i686.  The Linux GNU assembler that I tested (the one
on RH5.1) doesn't seem to mind this construct.

I just tested 1.0.3 with the same source and command line invocation as
above, and it worked.  I can't pinpoint an exact breaking point between
there and here since this is my first P6 build.

Any ideas?


RJL

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

* analysis: arch=i686, -fPIC won't play nice on OSR5
  1998-06-18 13:51 arch=i686, -fPIC won't play nice on OSR5 Robert Lipe
@ 1998-06-29 23:17 ` Robert Lipe
       [not found] ` <19980629225242.A18742.cygnus.egcs@dgii.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Lipe @ 1998-06-29 23:17 UTC (permalink / raw)
  To: egcs; +Cc: jpr

This is my first venture into i386.c and the land of RTL, so please be
gentle.  I think I have a solution for this problem, but I'd like input
from the folks that actually understand what's going on in here before I
actually submit a patch.

Summarized, the SCO ELF assembler howls if you give a ".type
blah,function" to a non-global label.   (I assume this is becuase
it knows that it's silly to try to stick debugging info onto a label
that won't be seen by the debugger.)

I poked around in i386.c and found asm_output_function_prefix() has
a test that looks like it'll only light up on P6 (which includes
my pentium-II) and for PIC.  This exactly describes the test
cases I hit below, so I figured I was on the right path.  After
calling gen_label_rtx() and ASM_GENERATE_INTERNAL_LABEL(), it calls
ASM_DECLARE_FUNCTION_NAME().   This results in the debugging info
(.type) being spat out.   For an internal label, is this really
desirable?   I just replaced the  

#ifdef ASM_DECLARE_FUNCTION_NAME
	ASM_DECLARE_FUNCTION_NAME(file, pic_label_name,prologue_node)
#endif

with
	ASM_OUTPUT_LABEL (file, pic_label_name);

and a quick test on both OpenServer and RH5.1 of:
	 make -k check-g77 RUNTESTFLAGS="--target_board 'unix{-fPIC,}'" 
give consistent results for the pic and pic-not cases on each OS with no
additional failures noted on Linux, where this problem didn't show up.
	
If this sounds like the right solution, let me know and I'll do the
patch thing.

Thanx,
RJL



Robert Lipe wrote:

> I won't bother with the full testsuite results becuase they're so noisy
> as to be uninteresting.   Here's the punchline.
> 
> $ cat /tmp/x.c
> main()
> {
>   exit(0);
> }
> 
> foo(){}
> 
> $ ./xgcc -march=i586 -B./ -fPIC  /tmp/x.c
> (robertl) rjlhome:/play/negcs/gcc
> $ ./xgcc -march=i686 -B./ -fPIC  /tmp/x.c
> (EOF):useless specification of size and/or type for name: .LPR0
> 
> 
> Let's look at the generated code:
> 
> $ ./xgcc -march=i686 -B./ -fPIC  -S /tmp/x.c
> (robertl) rjlhome:/play/negcs/gcc
> $ head x.s
>         .file   "x.c"
>         .version        "01.01"
> gcc2_compiled.:
> __gnu_compiled_c:
>         .text
>         .align 4
>         .type    .LPR0,@function
> .LPR0:
>         movl (%esp),%ebx
>         ret
> 
> 
> Since the label .LPR0 isn't global, the SCO assembler is squawking about
> it having a debugging type.  If I insert '.globl .LPR0' it assembles.
> If I change all occurrences of '.LPR0' to 'LPR0' it assembles.
> 
> 
> For some reason, this particular sequence of events is unique (?) to
> -fPIC and -march=i686.  The Linux GNU assembler that I tested (the one
> on RH5.1) doesn't seem to mind this construct.
> 
> I just tested 1.0.3 with the same source and command line invocation as
> above, and it worked.  I can't pinpoint an exact breaking point between
> there and here since this is my first P6 build.
> 
> Any ideas?
> 
> 
> RJL

-- 
Robert Lipe       http://www.dgii.com/people/robertl       robertl@dgii.com
              (WEB ADDRESS MAY BE TEMPORARILY UNAVAILABLE)



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

* Re: analysis: arch=i686, -fPIC won't play nice on OSR5
       [not found] ` <19980629225242.A18742.cygnus.egcs@dgii.com>
@ 1998-06-30 11:53   ` Ulrich Drepper
  0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Drepper @ 1998-06-30 11:53 UTC (permalink / raw)
  To: egcs

robertl@dgii.com (Robert Lipe) writes:

> If this sounds like the right solution, let me know and I'll do the
> patch thing.

It's correct that the internal labels need no type information.  If
your patch simply avoids adding the .type line it is correct.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

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

end of thread, other threads:[~1998-06-30 11:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-06-18 13:51 arch=i686, -fPIC won't play nice on OSR5 Robert Lipe
1998-06-29 23:17 ` analysis: " Robert Lipe
     [not found] ` <19980629225242.A18742.cygnus.egcs@dgii.com>
1998-06-30 11:53   ` Ulrich Drepper

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