[comp.sys.pyramid] Building G++ on Pyramid

anthony@monu6.cc.monash.edu.au (Anthony Baxter) (06/22/91)

Has anyone had any luck using g++ on a Pyramid? I've managed to get
it compiled, but it produces assembler with labels like __$_FooBar,
and the Pyramid as doesnt allow $ as a valid character in a label.
Has anyone had any luck with this, or could anyone tell me where
I might begin looking in the code to fix this?

(btw, its a Pyramid MIS-2/01, running OSx 5.1a-910305)

Thanks in advance...

Anthony

-- 
 'He took the response of solid state technicians     |   Caulfield Campus,  
  everywhere, and kicked the living quartz out of it' |   Monash University, 
                    - Blake's 7                       |      Australia.      
  anthony@monu6.cc.monash.edu.au  anthony@phoenix.pub.uu.oz 

jonathan@beta.isor.vuw.ac.nz (Jonathan Stone) (06/23/91)

In article <1991Jun22.145936.14935@monu6.cc.monash.edu.au> anthony@monu6.cc.monash.edu.au (Anthony Baxter) writes:
>Has anyone had any luck using g++ on a Pyramid? I've managed to get
>it compiled, but it produces assembler with labels like __$_FooBar,
>and the Pyramid as doesnt allow $ as a valid character in a label.
>Has anyone had any luck with this, or could anyone tell me where
>I might begin looking in the code to fix this?
>(btw, its a Pyramid MIS-2/01, running OSx 5.1a-910305)


The short answer is, unfortunately, that it may not be worth your
while trying to get g++ working on a Pyramid.


You don't want to look in the G++ source code to fix this.  The
standard workaround to this problem is to use some character other than '$',
but the Pyramid assembler also rejects that character in labels.
There just aren't any characters to use for this name mangling.

About two years ago there was a modified and unsupported assembler
that allowed '$', in labels, which one could obtain if you asked the
right people.  If you explain your problem to your Pyramid rep, you
may or may not be able to obtain such a thing.


The next thing you will discover is that the GNU loader, gnu-ld, does
not properly link NMAGIC-style .o files.  The Pyramid assembler (at
least on OSx4.n) was the only loader in the known galaxy that produces
NMAGIC .o files by default, so this problem ony affects Pyramid users.
To link these files, which contain entries the Pyramid linker does not
understand, you need either a hack to the g++ driver to run an extra
linker pass to convert the .o files from NMAGIC to ZMAGIC, or a patch
to the GNU loader to make it work with NMAGIC .o files.  I can supply
either of these.


If and when you get a suitable assembler and linker, you will find
that libg++ simply does not work on Pyramids, due to argument passing
incompatibilites.  This will be fixed in gcc 2.0. Until then, there
are patches to support g++ 1.37.1 available from
ftp.isor.vuw.ac.nz:pub/misc.  (1.37.1 was the most recent version when
the Pyramid here was decommissioned).

Enjoy,
--Jonathan

petri@tubsibr.uucp (Stefan Petri) (06/24/91)

>In article <1991Jun22.145936.14935@monu6.cc.monash.edu.au> anthony@monu6.cc.monash.edu.au (Anthony Baxter) writes:
>> Has anyone had any luck using g++ on a Pyramid? I've managed to get
>> it compiled, but it produces assembler with labels like __$_FooBar,
>> and the Pyramid as doesnt allow $ as a valid character in a label.
>> Has anyone had any luck with this, or could anyone tell me where
>> I might begin looking in the code to fix this?
>> (btw, its a Pyramid MIS-2/01, running OSx 5.1a-910305)

and

In article <1991Jun23.015823.25711@comp.vuw.ac.nz> jonathan@beta.isor.vuw.ac.nz (Jonathan Stone) answers:
> The short answer is, unfortunately, that it may not be worth your
> while trying to get g++ working on a Pyramid.
>
>Enjoy,
>--Jonathan

I #defined NO_DOLLAR_IN_LABEL somewhere in the g++-Sources, I used the
GNU-ld that is distributed with the GNU-binutils, plus a few patches
(may those patches are in the distribution by now, I didnt check
recently), and I applied the VUW-patches from ftp.isor.vuw.ac.nz (by
Hand, to g++-1.39, btw). With all this, only 4 of the libg++ - tests
will coredump, opposed to ``all but 2'' with unmodified g++.
And then, we got a handful of sparc-stations, and nobody is interested
in working on the pyramid anymore :-} (actually a Nixdorf Targon/35 M50,
alias pyramid 98x, OSx4.4).

Not so much to enjoy in this case :-}

S.P.

bgg@pta.pyramid.com.au (Ben Golding) (06/25/91)

In article <1991Jun23.015823.25711@comp.vuw.ac.nz> jonathan@beta.isor.vuw.ac.nz (Jonathan Stone) writes:
>In article <1991Jun22.145936.14935@monu6.cc.monash.edu.au> anthony@monu6.cc.monash.edu.au (Anthony Baxter) writes:
>>Has anyone had any luck using g++ on a Pyramid? I've managed to get
>>it compiled, but it produces assembler with labels like __$_FooBar,
>>and the Pyramid as doesnt allow $ as a valid character in a label.
>
>You don't want to look in the G++ source code to fix this.  The
>standard workaround to this problem is to use some character other than '$',
>but the Pyramid assembler also rejects that character in labels.

If you're trying to prevent accidental name collisions you could use
"." -- the assembler accepts that in labels.

If you insist on "$" being labels then you're out of luck.  It's
already used for immediate operands.  A special version of the
assembler would be ugly.  Consider "$name", what does it refer to?

	Ben.