[comp.lang.perl] compiling perl 4.003 on a Convex, take 2

tchrist@convex.com (Tom Christiansen) (05/09/91)

Perl will compile cleanly without modifications on a Convex if you 
simply use -pcc mode.

--tom  
--
Tom Christiansen		tchrist@convex.com	convex!tchrist
		"So much mail, so little time." 

tchrist@convex.COM (Tom Christiansen) (05/13/91)

From the keyboard of weg@convx1.ccit.arizona.edu (Eythan Weg):
:In article <tchrist.673729327@convex.convex.com> tchrist@convex.com (Tom Christiansen) writes:
:
:   Perl will compile cleanly without modifications on a Convex if you 
:   simply use -pcc mode.
:
:I tried that.  It compiled but failed the groups test.  Any ideas?

Yup: you declared getgroups() as returning gid_t instead of int.  In pcc
mode, they are ints, in ext mode, they are gid_t's.  Crazy, eh?

[I'll go back and check my version to make sure.]

--tom
--
Tom Christiansen		tchrist@convex.com	convex!tchrist
		"So much mail, so little time." 

karrer@bernina.ethz.ch (Andreas Karrer) (05/17/91)

tchrist@convex.com (Tom Christiansen) writes:

>Perl will compile cleanly without modifications on a Convex if you 
>simply use -pcc mode.

On ConvexOS 8.1 this will give you a perl that indeed passes all test,
but which fails on:

	root# perl4.003 -e 'print "$<$>"; $<=1; $>=1; print "$<$>\n"'
	0001
but:
	root# perl4.003 -e 'print "$<$>"; $>=1; $<=1; print "$<$>\n"'
	0011

perl4.003 on SunOS/Ultrix/Dynix/Alliant prints "0011" in both cases.


It seems a few more test that test features restricted to the
super-user are needed (Assignment to $<, $>, chroot(), chown() etc).

+-----------
  Andi Karrer, Communication Systems, ETH Zuerich, Switzerland
  karrer@bernina.ethz.ch                 - terible simplifieur

jones@chpc.utexas.edu (Bill Jones) (05/17/91)

Set the shell variable:

setenv CCOPTIONS '-pcc'

And then rebuild perl on you convex (make clean and then make).

If you just set the '-pcc' flag you will only effect the compilation
of the perl binaries not its loading.  The Configure command is carefully 
to  separate out the compilation flags from the load flags.  Unfortunately
it does not prompt you for any load flags?

The problem that you are seeing under Convex OS 8.x is due to the use
of a busted setruid/seteuid POSIX compliant library.
Since you did not specify '-pcc' on the load you get the POSIX library.

Under Convex OS 9.x the get group system call will fail if you don't
specify the "-pcc" option on the load.  Again, since you did not specify
the "-pcc" on the load command you get POSIX compliant library.
Under Convex OS 9.x they fixed setruid/seteuid but the changed
the definition of the array that getgroups returns form a
int * (32 bits) to a short * (16 bits).

Bill  Jones

tchrist@convex.COM (Tom Christiansen) (05/18/91)

From the keyboard of jones@chpc.utexas.edu (Bill Jones):
:Under Convex OS 9.x the get group system call will fail if you don't
:specify the "-pcc" option on the load.  Again, since you did not specify
:the "-pcc" on the load command you get POSIX compliant library.
:Under Convex OS 9.x they fixed setruid/seteuid but the changed
:the definition of the array that getgroups returns form a
:int * (32 bits) to a short * (16 bits).

Actually, it will work if you use -ext, but several other things 
need tweaking if you do that.  The important thing is to know
that you need a getgroups grouptype of int in -pcc mode and gid_t,
which is u_short, otherwise.  And you're right: you need the load
to get pcc mode to, or you get he wrong library.  

I just set CCOPTIONS in my environment to "-pcc -tm c1 -fn" and get on
with life.  I'm generally much happier this way.  Our ANSI and POSIX folks
here have the attitude that pcc mode is deprecated and think me an old
stick-in-the-mud trapped in the past.  So be it: there's a lot more pcc
code out there than ANSI, methinks.  Be warned that they won't make any
new functions available in pcc mode (grumble, whine), so you can't get
waitpid(2), which is a pain.  You can always use ar to pull it out of the
library (if you can figure out which it is!) and load it by hand.

I still think God intended code to be compiled in pcc mode.  ANSI 
and POSIX were invented by lawyers and pharisees.  :-)

--tom
--
Tom Christiansen		tchrist@convex.com	convex!tchrist
		"So much mail, so little time." 

rbj@uunet.uu.net (Root Boy Jim) (05/21/91)

tchrist@convex.COM (Tom Christiansen) writes:

>I just set CCOPTIONS in my environment ...

Um, shouldn't that be CFLAGS?
Which program believes in them anyway, make or cc?

If make believes imports CFLAGS from the environment,
there is no reason that cc should use CCOPTIONS.

>I still think God intended code to be compiled in pcc mode.  ANSI 
>and POSIX were invented by lawyers and pharisees.  :-)

ANSI and POSIX are mutually exclusive. POSIX is more important.
-- 
		[rbj@uunet 1] stty sane
		unknown mode: sane

tchrist@convex.COM (Tom Christiansen) (05/21/91)

From the keyboard of rbj@uunet.uu.net (Root Boy Jim):
:tchrist@convex.COM (Tom Christiansen) writes:
:
:>I just set CCOPTIONS in my environment ...
:
:Um, shouldn't that be CFLAGS?
:Which program believes in them anyway, make or cc?

Our official Convex make doesn't import things from the environment last
time I checked.  It's cc that believes it.  Hey, if you like that, you can
use CPPOPTIONS to get a reasonable cpp, and LINTOPTIONS for lint.  It's 
become a multi-universe nightmare.  (Speaking as a user, not an employee,
of course.)

--tom
--
Tom Christiansen		tchrist@convex.com	convex!tchrist
		"So much mail, so little time." 

rbj@uunet.uu.net (Root Boy Jim) (05/22/91)

tchrist@convex.COM (Tom Christiansen) writes:
>
>Our official Convex make doesn't import things from the environment last
>time I checked.  It's cc that believes it.  Hey, if you like that, you can
>use CPPOPTIONS to get a reasonable cpp, and LINTOPTIONS for lint.  It's 
>become a multi-universe nightmare.  (Speaking as a user, not an employee,
>of course.)

I suppose this is another reason that "universes" are bad.

I object to importing things from the environment because it
takes the explicitness away from how to build things.

I guess it's pretty hopeless. From Sun's "man 7 intro"...

Name                Appears on Page     Description

ansic               ansic(7V)            ANSI C  lint library
bsd                 bsd(7)               overview of the Berkeley 4.3 env
posix               posix(7V)            overview of the (POSIX.1) environment
SunOS               sunos(7)             overview of the SunOS Release 4.1 env
svidii              svidii(7V)           overview of the System V environment
svidiii             svidiii(7V)          SVIDIII lint library
xopen               x/open(7V)           overview of the XPG Issue 2  env
-- 
		[rbj@uunet 1] stty sane
		unknown mode: sane