🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #583

-fpic coredumps on a sparc

#583
From: Roger West
Date: Sun, 08 Nov 1992 04:33
81 lines
2207 bytes
Has anyone gotten gcc 2.3.1 to sucessfully generate position independent code
on a sparc?  Is PIC code generation even expected to be working yet?  Here's
what I'm getting...

    gcc2 -fpic -S -o fun.s fun.c
    gcc2: Internal compiler error: program cc1 got fatal signal 6


This is what I'm trying to compile..

    extern void puts();

    void fun() {
	puts("Called fun.");
    }


This is as far as gcc gets...

    gcc2_compiled.:
    .text
	    .align 8
    LC0:
	    .ascii "Called fun.\0"
	    .align 4
	    .global _fun
	    .proc	020
    _fun:
	    !#PROLOGUE# 0
	    save %sp,-112,%sp
    L2:
	    call L3
	    nop
    L3:
	    sethi %hi(__GLOBAL_OFFSET_TABLE_-(


Here's what the Sun cc compiler produces...

    LL0:
	    .seg	"data"
	    .seg	"text"
	    .proc 020
	    .global	_fun
    _fun:
	    !#PROLOGUE# 0
	    sethi	%hi(LF13),%g1
	    add		%g1,%lo(LF13),%g1
	    save	%sp,%g1,%sp
    1:
	    call    	2f
	    sethi	%hi(__GLOBAL_OFFSET_TABLE_ - (1b-.)), %l7
    2:
	    or		%l7, %lo(__GLOBAL_OFFSET_TABLE_ - (1b-.)), %l7
	    add		%l7, %o7, %l7
	    !#PROLOGUE# 1
	    .seg	"data1"
    L15:
	    .ascii	"Called fun.\0"
	    .seg	"text"
	    ld		[%l7+L15],%o0
	    call	_puts,1
	    nop
    LE13:
	    ret
	    restore
	   LF13 = -96
	    LP13 = 96
	    LST13 = 96
	    LT13 = 96
	    .seg	"data"


Thanks for any responses.
--
   _____________________________________________________________
   |   Roger West              Internet: west@tsd.itg.ti.com   |
   |   Texas Instruments Inc.    TI MSG: RWES                  |
   |   PO Box 149149, MS 2201     Voice: (512) 250-7372        |
   |___Austin, TX 78714-9149________Fax: (512) 250-7104________|
Technical Details
Message-ID: <WEST.92Nov7223312@chance.tsd.itg.ti.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!fstop.csc.ti.com!fstop!west

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!fstop.csc.ti.com!fstop!west
From: west@chance.tsd.itg.ti.com (Roger West)
Subject: -fpic coredumps on a sparc
Message-ID: <WEST.92Nov7223312@chance.tsd.itg.ti.com>
Sender: usenet@csc.ti.com
Nntp-Posting-Host: chance.tsd.itg.ti.com
Organization: Texas Instruments, Speech Mushrooms.
Date: Sun, 8 Nov 1992 04:33:12 GMT
Lines: 81