Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perl 5.8.6 fails to build on IRIX 6.5 due to bizarre preprocessor bug #7759

Closed
p5pRT opened this issue Jan 19, 2005 · 39 comments
Closed

perl 5.8.6 fails to build on IRIX 6.5 due to bizarre preprocessor bug #7759

p5pRT opened this issue Jan 19, 2005 · 39 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 19, 2005

Migrated from rt.perl.org#33849 (status was 'resolved')

Searchable as RT33849$

@p5pRT
Copy link
Author

p5pRT commented Nov 11, 2003

From jim@rrsl.rsmas.miami.edu

Created by jim@rrsl.rsmas.miami.edu

Since I installed IRIX 7.4.1m compiler updates I cannot build
perl (either 5.8.1 or 5.8.2). I get an error compiling gv.c.

How do I workaround or fix this compilation problem?
I don't see anything in README.irix about this issue.

I used IRIX 7.4m compilers to build and install perl 5.8.0.

compile error messages​:
  CCCMD = cc -n32 -DPERL_CORE -c -DPTHREAD_H_FIRST -D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -I/usr/local/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=ON
cc-1020 cc​: ERROR File = gv.c, Line = 1712
  The identifier "copy" is undefined.

  RvDEEPCP(left);
  ^

cc-1162 cc​: ERROR File = gv.c, Line = 1712
  Too few arguments in function call.

  RvDEEPCP(left);
  ^

cc-1018 cc​: ERROR File = gv.c, Line = 1712
  An unmatched left parentheses "(" appears in an expression.

  RvDEEPCP(left);
  ^

3 errors detected in the compilation of "gv.c".

Perl Info

Flags:
    category=install
    severity=critical

Site configuration information for perl v5.8.0:

Configured by jim at Thu May 22 19:13:37 EDT 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=irix, osvers=6.5, archname=IP27-irix
    uname='irix64 jaboticaba 6.5 04100802 ip27 '
    config_args='-d'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc -n32', ccflags ='-D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -OPT:Olimit=0:space=ON -I/usr/local/include -DLANGUAGE_C',
    optimize='-O3',
    cppflags='-D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -OPT:Olimit=0:space=ON -I/usr/local/include -DLANGUAGE_C'
    ccversion='MIPSpro Compilers: Version 7.4', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc -n32', ldflags =' -L/usr/local/lib32 -L/usr/local/lib -Wl,-woff,84'
    libpth=/usr/local/lib /usr/lib32 /lib32 /lib /usr/lib
    libs=-lm -lc
    perllibs=-lm -lc
    libc=/usr/lib32/libc.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-n32 -shared -L/usr/local/lib32 -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.8.0:
    /usr/local/lib/perl5/5.8.0/IP27-irix
    /usr/local/lib/perl5/5.8.0
    /usr/local/lib/perl5/site_perl/5.8.0/IP27-irix
    /usr/local/lib/perl5/site_perl/5.8.0
    /usr/local/lib/perl5/site_perl/5.6.1
    /usr/local/lib/perl5/site_perl
    .


Environment for perl v5.8.0:
    HOME=/usr5/jim
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/dsp/shlib
    LOGDIR (unset)
    PATH=/usr/local/bin:/usr/sbin:/usr/bsd:/sbin:/usr/bin:/usr/bin/X11:/usr/dsp/exe:/usr5/jim/bin:.
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh


@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2003

From @rgarcia

jim@​rrsl.rsmas.miami.edu (via RT) wrote​:

Since I installed IRIX 7.4.1m compiler updates I cannot build
perl (either 5.8.1 or 5.8.2). I get an error compiling gv.c.

How do I workaround or fix this compilation problem?
I don't see anything in README.irix about this issue.

I used IRIX 7.4m compilers to build and install perl 5.8.0.

I'd say it's a bug with your C preprocessor.

Can you try the modification below, to see whether it solves your problem?
(basically it only expands a CAT2 macro)

==== //depot/perl/pp.h#54 - /opt/p4/perl/pp.h ====
@​@​ -385,7 +385,7 @​@​
  changed SV* ref to SV* tmpRef */
#define RvDEEPCP(rv) STMT_START { SV* tmpRef=SvRV(rv); \
  if (SvREFCNT(tmpRef)>1) { \
- SvRV(rv)=AMG_CALLun(rv,copy); \
+ SvRV(rv)=amagic_call(rv,&PL_sv_undef,copy_amg,AMGf_noright | AMGf_unary) \
  SvREFCNT_dec(tmpRef); \
  } } STMT_END

compile error messages​:
CCCMD = cc -n32 -DPERL_CORE -c -DPTHREAD_H_FIRST -D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -I/usr/local/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=ON
cc-1020 cc​: ERROR File = gv.c, Line = 1712
The identifier "copy" is undefined.

  RvDEEPCP\(left\);
  ^

@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2003

From @nwc10

On Fri, Nov 14, 2003 at 10​:15​:07AM +0100, Rafael Garcia-Suarez wrote​:

jim@​rrsl.rsmas.miami.edu (via RT) wrote​:

Since I installed IRIX 7.4.1m compiler updates I cannot build
perl (either 5.8.1 or 5.8.2). I get an error compiling gv.c.

How do I workaround or fix this compilation problem?
I don't see anything in README.irix about this issue.

I used IRIX 7.4m compilers to build and install perl 5.8.0.

I'd say it's a bug with your C preprocessor.

Can you try the modification below, to see whether it solves your problem?
(basically it only expands a CAT2 macro)

==== //depot/perl/pp.h#54 - /opt/p4/perl/pp.h ====
@​@​ -385,7 +385,7 @​@​
changed SV* ref to SV* tmpRef */
#define RvDEEPCP(rv) STMT_START { SV* tmpRef=SvRV(rv); \
if (SvREFCNT(tmpRef)>1) { \
- SvRV(rv)=AMG_CALLun(rv,copy); \
+ SvRV(rv)=amagic_call(rv,&PL_sv_undef,copy_amg,AMGf_noright | AMGf_unary) \
SvREFCNT_dec(tmpRef); \
} } STMT_END

If that just moved the error further on, what happens with the build if

a​: you edit config.h to remove these lines​:

#if 42 == 1
#define CAT2(a,b) a/**/b
#define STRINGIFY(a) "a"
  /* If you can get stringification with catify, tell me how! */
#endif

b​: you replace those lines, and add a #error directive inside them

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Nov 15, 2003

From jim@rrsl.rsmas.miami.edu

Perl 5.8.2 gv.c compiles with this change to pp.h (you left out the ;).
I will report this C preprocessor problem to SGI.
Thank you for your help.

Since I installed IRIX 7.4.1m compiler updates I cannot build
perl (either 5.8.1 or 5.8.2). I get an error compiling gv.c.

How do I workaround or fix this compilation problem?
I don't see anything in README.irix about this issue.

I used IRIX 7.4m compilers to build and install perl 5.8.0.

I'd say it's a bug with your C preprocessor.

Can you try the modification below, to see whether it solves your problem?
(basically it only expands a CAT2 macro)

==== //depot/perl/pp.h#54 - /opt/p4/perl/pp.h ====
@​@​ -385,7 +385,7 @​@​
changed SV* ref to SV* tmpRef */
#define RvDEEPCP(rv) STMT_START { SV* tmpRef=SvRV(rv); \
if (SvREFCNT(tmpRef)>1) { \
- SvRV(rv)=AMG_CALLun(rv,copy); \
+ SvRV(rv)=amagic_call(rv,&PL_sv_undef,copy_amg,AMGf_noright | AMGf_unary); \
SvREFCNT_dec(tmpRef); \
} } STMT_END

compile error messages​:
CCCMD = cc -n32 -DPERL_CORE -c -DPTHREAD_H_FIRST -D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -I/usr/local/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=ON
cc-1020 cc​: ERROR File = gv.c, Line = 1712
The identifier "copy" is undefined.

  RvDEEPCP\(left\);
  ^

@p5pRT
Copy link
Author

p5pRT commented Nov 15, 2003

From jim@rrsl.rsmas.miami.edu

I spoke too soon. This change in pp.h resolves the problem in gv.c but
now I get errors in pp_hot.c. Any more ideas?

  CCCMD = cc -n32 -DPERL_CORE -c -DPTHREAD_H_FIRST -D_BSD_TYPES -D_BSD_
TIME -woff 1184,1552 -I/usr/local/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=O
N
cc-1020 cc​: ERROR File = pp_hot.c, Line = 101
  The identifier "TOP" is undefined.

  dSP; dPOPTOPssrl;
  ^

cc-1065 cc​: ERROR File = pp_hot.c, Line = 101
  A semicolon is expected at this point.

  dSP; dPOPTOPssrl;
  ^

cc-1020 cc​: ERROR File = pp_hot.c, Line = 136
  The identifier "concat" is undefined.

  dSP; dATARGET; tryAMAGICbin(concat,opASSIGN);
  ^

cc-1162 cc​: ERROR File = pp_hot.c, Line = 136
  Too few arguments in function call.

  dSP; dATARGET; tryAMAGICbin(concat,opASSIGN);
  ^

cc-1018 cc​: ERROR File = pp_hot.c, Line = 136
  An unmatched left parentheses "(" appears in an expression.

  dSP; dATARGET; tryAMAGICbin(concat,opASSIGN);
  ^

jim@​rrsl.rsmas.miami.edu (via RT) wrote​:

Since I installed IRIX 7.4.1m compiler updates I cannot build
perl (either 5.8.1 or 5.8.2). I get an error compiling gv.c.

How do I workaround or fix this compilation problem?
I don't see anything in README.irix about this issue.

I used IRIX 7.4m compilers to build and install perl 5.8.0.

I'd say it's a bug with your C preprocessor.

Can you try the modification below, to see whether it solves your problem?
(basically it only expands a CAT2 macro)

==== //depot/perl/pp.h#54 - /opt/p4/perl/pp.h ====
@​@​ -385,7 +385,7 @​@​
changed SV* ref to SV* tmpRef */
#define RvDEEPCP(rv) STMT_START { SV* tmpRef=SvRV(rv); \
if (SvREFCNT(tmpRef)>1) { \
- SvRV(rv)=AMG_CALLun(rv,copy); \
+ SvRV(rv)=amagic_call(rv,&PL_sv_undef,copy_amg,AMGf_noright | AMGf_unary); \
SvREFCNT_dec(tmpRef); \
} } STMT_END

compile error messages​:
CCCMD = cc -n32 -DPERL_CORE -c -DPTHREAD_H_FIRST -D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -I/usr/local/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=ON
cc-1020 cc​: ERROR File = gv.c, Line = 1712
The identifier "copy" is undefined.

  RvDEEPCP\(left\);
  ^

@p5pRT
Copy link
Author

p5pRT commented Nov 15, 2003

From jim@rrsl.rsmas.miami.edu

On Fri, Nov 14, 2003 at 10​:15​:07AM +0100, Rafael Garcia-Suarez wrote​:

jim@​rrsl.rsmas.miami.edu (via RT) wrote​:

Since I installed IRIX 7.4.1m compiler updates I cannot build
perl (either 5.8.1 or 5.8.2). I get an error compiling gv.c.

How do I workaround or fix this compilation problem?
I don't see anything in README.irix about this issue.

I used IRIX 7.4m compilers to build and install perl 5.8.0.

I'd say it's a bug with your C preprocessor.

Can you try the modification below, to see whether it solves your problem?
(basically it only expands a CAT2 macro)

==== //depot/perl/pp.h#54 - /opt/p4/perl/pp.h ====
@​@​ -385,7 +385,7 @​@​
changed SV* ref to SV* tmpRef */
#define RvDEEPCP(rv) STMT_START { SV* tmpRef=SvRV(rv); \
if (SvREFCNT(tmpRef)>1) { \
- SvRV(rv)=AMG_CALLun(rv,copy); \
+ SvRV(rv)=amagic_call(rv,&PL_sv_undef,copy_amg,AMGf_noright | AMGf_unary) \
SvREFCNT_dec(tmpRef); \
} } STMT_END

If that just moved the error further on, what happens with the build if

a​: you edit config.h to remove these lines​:

#if 42 == 1
#define CAT2(a,b) a/**/b
#define STRINGIFY(a) "a"
/* If you can get stringification with catify, tell me how! */
#endif

b​: you 'restore' those lines, and add a #error directive inside them

My config.h file has

#if 1 == 1
#define CAT2(a,b) a/**/b
...

and

#if 1 == 42
#define PeRl_CaTiFy(a, b) a ## b
...

Do you want me to switch the 1 == 1 and 1 == 42 guard statements?

@p5pRT
Copy link
Author

p5pRT commented Nov 15, 2003

From @nwc10

On Fri, Nov 14, 2003 at 05​:56​:20PM -0500, jim@​rrsl.rsmas.miami.edu wrote​:

If that just moved the error further on, what happens with the build if

a​: you edit config.h to remove these lines​:

#if 42 == 1
#define CAT2(a,b) a/**/b
#define STRINGIFY(a) "a"
/* If you can get stringification with catify, tell me how! */
#endif

b​: you 'restore' those lines, and add a #error directive inside them

My config.h file has

#if 1 == 1
#define CAT2(a,b) a/**/b
...

and

#if 1 == 42
#define PeRl_CaTiFy(a, b) a ## b
...

Do you want me to switch the 1 == 1 and 1 == 42 guard statements?

No, just take out the entire first block (from #if 1 == 1 to its corresponding
#endif)

However, based on your other message I'm not sure that this will actually
solve the preprocessor concatenation problem that you're seeing.
(Which I suspect is a preprocessor bug, but I've been bitten before
by SGI's compiler knowing more than me about the C standard, so I am wary)

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Nov 17, 2003

From @nwc10

Heiko Schlichting said that I could/should forward this to the list.
Seems interesting. I've not yet looked at Configure, or what it's up to
in the CPP tests, but it seems that we have enough information to work
round the problem. (without needing to assign blame either way]

Nicholas Clark

----- Forwarded message from Heiko Schlichting <heiko@​FU-Berlin.DE> -----

Date​: Mon, 17 Nov 2003 18​:17​:42 +0100
From​: Heiko Schlichting <heiko@​FU-Berlin.DE>
To​: jim@​rrsl.rsmas.miami.edu, Nicholas Clark <nick@​ccl4.org>
Subject​: [perl #24471] gv.c​: identifier "copy" is undefined
User-Agent​: Mutt/1.5.4i

Jim, Nick,

I noticed your conversion on the perlbug list but as I'm not on the list
myself please excuse that I bother both of you with personal mail.
I noticed the same problem which Jim reported on my systems using IRIX MIPS
compiler 7.4.1 too. The problem occurs with perl 5.6.1 and 5.8.2 (didn't
tried other versions).

Without the modifications Nick suggested I can fix the problem setting

cpp_stuff='42'

in config.sh before Configure distributes it variables. Looking at the code
of Configure I assume that it is not are problem of the compiler but
a misbehavior of Configure testing with cppstdin instead of cc -E with
input from a file. The IRIX compiler behaves in a different way for input
from stdin and for input from a file​:


| [heiko@​Punkt] 107 (/tmp)​: cat cpp_stuff.c
| #define RCAT(a,b)a/**/b
| #define ACAT(a,b)a ## b
| RCAT(Rei,ser)
| ACAT(Cir,cus)


| [heiko@​Punkt] 108 (/tmp)​: cc -E - < cpp_stuff.c
| # 1 ""
|
|
| Reiser
| Cir ## cus


| [heiko@​Punkt] 109 (/tmp)​: cc -E cpp_stuff.c
| #line 1 "cpp_stuff.c"
|
|
| Rei ser
| Circus


Surprising, but not really a bug. The Configure script tests with input
from stdin but during compilation it used input from a file. Correcting
this manually by changing

cpp_stuff='1'

into

cpp_stuff='42'

seems to fix the problem - at least for me. If you find this information
valuable for someone else you have my permission to forward this text or
the information where ever you want (with or without mentioning me).

Heiko

Heiko Schlichting | Freie Universität Berlin
heiko@​FU-Berlin.DE | Zentraleinrichtung für Datenverarbeitung (ZEDAT)
Telefon +49 30 838-54327 | Fabeckstraße 32
Telefax +49 30 838454327 | 14195 Berlin

----- End forwarded message -----

@p5pRT
Copy link
Author

p5pRT commented Nov 18, 2003

From @doughera88

On Mon, 17 Nov 2003, Nicholas Clark wrote​:

Heiko Schlichting said that I could/should forward this to the list.
Seems interesting. I've not yet looked at Configure, or what it's up to
in the CPP tests, but it seems that we have enough information to work
round the problem. (without needing to assign blame either way]

Nicholas Clark

----- Forwarded message from Heiko Schlichting <heiko@​FU-Berlin.DE> -----

Thanks for this nice diagnosis​:

The IRIX compiler behaves in a different way for input
from stdin and for input from a file​:

-----------------------------------------------
| [heiko@​Punkt] 107 (/tmp)​: cat cpp_stuff.c
| #define RCAT(a,b)a/**/b
| #define ACAT(a,b)a ## b
| RCAT(Rei,ser)
| ACAT(Cir,cus)
-----------------------------------------------
| [heiko@​Punkt] 108 (/tmp)​: cc -E - < cpp_stuff.c
| # 1 ""
|
|
| Reiser
| Cir ## cus
-----------------------------------------------
| [heiko@​Punkt] 109 (/tmp)​: cc -E cpp_stuff.c
| #line 1 "cpp_stuff.c"
|
|
| Rei ser
| Circus
-----------------------------------------------

Yup, Configure's cpp tests did not anticipate this possibility. Is there a
flag one could give to the compiler to make it always use ANSI
preprocessing mode?

If not, then cppstind for IRIX should probably be changed to use the
wrapper script. One way to do that might be to have Configure compare
two tests (as above). If they differ, use the wrapper script.

In any case, could you let us know the exact compiler and OS in question
so that we can at least have accurate comments in the relevant Configure
sections?

Thanks,

  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Sep 29, 2004

From mehrdad.ziaei@senecac.on.ca

Hello

I'm having problem compiling perl 5.8.5 on Irix 5.6.21f

I got some information from system and part of the output.
config.sh is attached just incase you need it.

I cheched pp.h, RvDEEPCP defined as a macro and
uses "copy" as second parameter to AMG_CALLun(rv,copy);
but seems "copy" is not define anywhere before that.

If I just comment SvRV(rv)=AMG_CALLun(rv,copy); in pp.h
the next error will be​:
cc-1020 cc​: ERROR File = pp_hot.c, Line = 101
  The identifier "TOP" is undefined.

  dSP; dPOPTOPssrl;
  ^
and lot more :(

I wonder if you can help me or show me some directions.

Thank you in advance
Mehrdad Ziaei
Seneca College

# bash

bash-2.05b# cc -version
MIPSpro Compilers​: Version 7.41

bash-2.05b# uname -apR
IRIX64 6.5 6.5.21f 07141607 IP27 mips

bash-2.05b# hinv
16 400 MHZ IP27 Processors
CPU​: MIPS R12000 Processor Chip Revision​: 3.5
FPU​: MIPS R12010 Floating Point Chip Revision​: 3.5
Main memory size​: 8192 Mbytes
Instruction cache size​: 32 Kbytes
Data cache size​: 32 Kbytes
Secondary unified instruction/data cache size​: 8 Mbytes

##############################################################

bash-2.05b# sh Configure -Dcc='cc -64' -Duse64bitint
(I see you are using the Korn shell. Some ksh's blow up on Configure,
mainly on older exotic systems. If yours does, try the Bourne shell
instead.)

Beginning of configuration questions for perl5.

Checking echo to see how to suppress newlines...
...using \c
The star should be here-->*

First let's make sure your kit is complete. Checking...
Looks good...

This installation shell script will examine your system and ask you
questions
to determine how the perl5 package should be installed. If you get
stuck on a question, you may use a ! shell escape to start a subshell or
execute a command. Many of the questions will have default answers in
square
brackets; typing carriage return will give you the default.

On some of the questions which ask for file or directory names you are
allowed
to use the ~name construct to specify the login directory belonging to
"name",
even if you don't have a shell which knows about that. Questions where this
is
allowed will be marked "(~name ok)".
......

Locating common programs...
awk is in /usr/bin/awk.
cat is in /sbin/cat.
chmod is in /sbin/chmod.
comm is in /usr/bin/comm.
cp is in /sbin/cp.
echo is in /sbin/echo.
expr is in /sbin/expr.
grep is in /sbin/grep.
ls is in /sbin/ls.
mkdir is in /sbin/mkdir.
rm is in /sbin/rm.
sed is in /sbin/sed.
sort is in /usr/bin/sort.
touch is in /sbin/touch.
tr is in /usr/bin/tr.
uniq is in /usr/bin/uniq.

Don't worry if any of the following aren't found...
I don't see Mcc out there, offhand.
ar is in /usr/bin/ar.
bison is in /usr/bin/bison.
I don't see byacc out there, either.
cpp is in /usr/lib/cpp.
csh is in /sbin/csh.
date is in /sbin/date.
egrep is in /usr/bin/egrep.
gmake is in /usr/freeware/bin/gmake.
gzip is in /usr/sbin/gzip.
I don't see less out there, either.
ln is in /sbin/ln.
make is in /sbin/make.
more is in /usr/bsd/more.
nm is in /usr/bin/nm.
I don't see nroff out there, either.
pg is in /usr/bin/pg.
test is in /sbin/test.
uname is in /sbin/uname.
zip is in /usr/freeware/bin/zip.
Using the test built into your sh.

Checking compatibility between /sbin/echo and builtin echo (if any)...
They are compatible. In fact, they may be identical.

Symbolic links are supported.

Checking how to test for symbolic links...
You can test for symbolic links with 'test -h'.

Good, your tr supports [​:lower​:] and [​:upper​:] to convert case.
Using [​:upper​:] and [​:lower​:] to convert case.

First time through, eh? I have some defaults handy for some systems
that need some extra help getting the Configure answers right​:

3b1 dos_djgpp isc_2 os2 svr4
aix dynix linux os390 svr5
aix_3 dynixptx lynxos os400 ti1500
aix_4 epix machten posix-bc titanos
altos486 esix4 machten_2 powerux ultrix_4
amigaos fps mint qnx umips
apollo freebsd mips rhapsody unicos
atheos genix mpc sco unicosmk
aux_3 gnu mpeix sco_2_3_0 unisysdynix

beos greenhills ncr_tower sco_2_3_1 utekv
bsdos hpux netbsd sco_2_3_2 uts
convexos i386 newsos4 sco_2_3_3 uwin
cxux irix_4 next_3 sco_2_3_4 vmesa
cygwin irix_5 next_3_0 solaris_2 vos
darwin irix_6 next_4 stellar
dcosx irix_6_0 nonstopux sunos_4_0
dec_osf irix_6_1 openbsd sunos_4_1
dgux isc opus super-ux

You may give one or more space-separated answers, or "none" if appropriate.
A well-behaved OS will have no hints, so answering "none" or just "Policy"
is a good thing. DO NOT give a wrong version or a wrong OS.

Which of these apply, if any? [irix_6]

....
I chose default for all questions.
....

Finding dependencies for perlmain.o.
  echo Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH
makedir.SH myconfig.SH writemain.SH pod/Makefile.SH | tr ' ' '\n' >.shlist
Updating makefile...
  test -s perlmain.c && touch perlmain.c
  cd x2p; make depend
  sh ../makedepend MAKE=make
  echo hash.c str.c util.c walk.c | tr ' ' '\n' >.clist
Finding dependencies for hash.o.
Finding dependencies for str.o.
Finding dependencies for util.o.
Finding dependencies for walk.o.
  echo Makefile.SH cflags.SH | tr ' ' '\n' >.shlist
Updating makefile...
Now you must run 'make'.

If you compile perl5 on a different machine or from a different object
directory, copy the Policy.sh file from this object directory to the
new one before you run Configure -- this will help you with most of
the policy defaults.

###########################################################

bash-2.05b# make
  `sh cflags "optimize='-O3 -OPT​:Olimit=0​:space=ON'" miniperlmain.o`
miniperlmain.c
  CCCMD = cc -64 -DPERL_CORE -c -D_BSD_TYPES -D_BSD_TIME -woff
1184,1552 -I/usr/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=ON
  `sh cflags "optimize='-O3 -OPT​:Olimit=0​:space=ON'" perl.o` perl.c
  CCCMD = cc -64 -DPERL_CORE -c -D_BSD_TYPES -D_BSD_TIME -woff
1184,1552 -I/usr/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=ON
  `sh cflags "optimize='-O3 -OPT​:Olimit=0​:space=ON'" gv.o` gv.c
  CCCMD = cc -64 -DPERL_CORE -c -D_BSD_TYPES -D_BSD_TIME -woff
1184,1552 -I/usr/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=ON
cc-1020 cc​: ERROR File = gv.c, Line = 1713
  The identifier "copy" is undefined.

  RvDEEPCP(left);
  ^

cc-1162 cc​: ERROR File = gv.c, Line = 1713
  Too few arguments in function call.

  RvDEEPCP(left);
  ^

cc-1018 cc​: ERROR File = gv.c, Line = 1713
  An unmatched left parentheses "(" appears in an expression.

  RvDEEPCP(left);
  ^

3 errors detected in the compilation of "gv.c".
*** Error code 2 (bu21)

@p5pRT
Copy link
Author

p5pRT commented Sep 29, 2004

@p5pRT
Copy link
Author

p5pRT commented Sep 30, 2004

From @iabyn

On Wed, Sep 29, 2004 at 10​:47​:37PM -0000, Mehrdad Ziaei wrote​:

I'm having problem compiling perl 5.8.5 on Irix 5.6.21f

It looks like Perl is having trouble with the CAT2 macro, which is
designed to be a compiler-independent way of concatenating two
pre-processor tokens together.

The entry in your config.sh,

  cpp_stuff='1'

indicates that Perl has determined that your C-preprocessor isn't
ANSI-compatible, ie that it can't handle the a ## b syntax.

This seems fairly unlikely in this day and age, so it's probably
something else getting messed up during the Configure phase.
But that's about the limit of my expertise.

Dave.

--
Any [programming] language that doesn't occasionally surprise the
novice will pay for it by continually surprising the expert.
  -- Larry Wall

@p5pRT
Copy link
Author

p5pRT commented Sep 30, 2004

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Sep 30, 2004

From easmith@beatrice.rutgers.edu

In message <20040930193957.GB1897@​iabyn.com> (on 30 September 2004 20​:39​:58
+0100), davem@​iabyn.com (Dave Mitchell) wrote​:

On Wed, Sep 29, 2004 at 10​:47​:37PM -0000, Mehrdad Ziaei wrote​:

I'm having problem compiling perl 5.8.5 on Irix 5.6.21f

It looks like Perl is having trouble with the CAT2 macro, which is
designed to be a compiler-independent way of concatenating two
pre-processor tokens together.

The entry in your config.sh,

cpp_stuff='1'

indicates that Perl has determined that your C-preprocessor isn't
ANSI-compatible, ie that it can't handle the a ## b syntax.

The /usr/bin/cpp preprocessor is _not_ an ANSI C preprocessor; for an ANSI C
preprocessor, see /usr/lib/acpp. Note, however, that SGI says in its manpage
that acpp may not be supported for much longer - people are supposed to use
cc -E (-E meaning only do preprocessing stuff) instead. (This also should
help with that any other (probably IRIX-specific) compliation flags that
happen to affect preprocessor tokens should be used in any preprocessing
steps.)

  -Allen

--
Allen Smith http​://cesario.rutgers.edu/easmith/
February 1, 2003 Space Shuttle Columbia
Ad Astra Per Aspera To The Stars Through Asperity

@p5pRT
Copy link
Author

p5pRT commented Sep 30, 2004

From @Tux

On Thu 30 Sep 2004 22​:01, Ed Allen Smith <easmith@​beatrice.rutgers.edu> wrote​:

In message <20040930193957.GB1897@​iabyn.com> (on 30 September 2004 20​:39​:58
+0100), davem@​iabyn.com (Dave Mitchell) wrote​:

On Wed, Sep 29, 2004 at 10​:47​:37PM -0000, Mehrdad Ziaei wrote​:

I'm having problem compiling perl 5.8.5 on Irix 5.6.21f

It looks like Perl is having trouble with the CAT2 macro, which is
designed to be a compiler-independent way of concatenating two
pre-processor tokens together.

The entry in your config.sh,

cpp_stuff='1'

indicates that Perl has determined that your C-preprocessor isn't
ANSI-compatible, ie that it can't handle the a ## b syntax.

The /usr/bin/cpp preprocessor is _not_ an ANSI C preprocessor; for an ANSI C
preprocessor, see /usr/lib/acpp. Note, however, that SGI says in its manpage
that acpp may not be supported for much longer - people are supposed to use
cc -E (-E meaning only do preprocessing stuff) instead. (This also should
help with that any other (probably IRIX-specific) compliation flags that
happen to affect preprocessor tokens should be used in any preprocessing
steps.)

Unless the system has an already existing executable cpp wrapper called
cppstdin, '$cc -E' is the first thing Configure is going to use as
preprocessor command (see line 4284 in Configure), so if your bet is on a
wrong preprocessor detection, /my/ bet would be an existing (but wrong)
cppstdin

--
H.Merijn Brand Amsterdam Perl Mongers (http​://amsterdam.pm.org/)
using perl-5.6.1, 5.8.3, & 5.9.x, and 809 on HP-UX 10.20 & 11.00, 11i,
  AIX 4.3, SuSE 9.0, and Win2k. http​://www.cmve.net/~merijn/
http​://archives.develooper.com/daily-build@​perl.org/ perl-qa@​perl.org
send smoke reports to​: smokers-reports@​perl.org, QA​: http​://qa.perl.org

@p5pRT
Copy link
Author

p5pRT commented Sep 30, 2004

From easmith@beatrice.rutgers.edu

In message <20040930222145.16FD.H.M.BRAND@​hccnet.nl> (on 30 September 2004
22​:23​:43 +0200), h.m.brand@​hccnet.nl (H.Merijn Brand) wrote​:

On Thu 30 Sep 2004 22​:01, Ed Allen Smith <easmith@​beatrice.rutgers.edu> wrote​:

In message <20040930193957.GB1897@​iabyn.com> (on 30 September 2004 20​:39​:58
+0100), davem@​iabyn.com (Dave Mitchell) wrote​:

On Wed, Sep 29, 2004 at 10​:47​:37PM -0000, Mehrdad Ziaei wrote​:

I'm having problem compiling perl 5.8.5 on Irix 5.6.21f

It looks like Perl is having trouble with the CAT2 macro, which is
designed to be a compiler-independent way of concatenating two
pre-processor tokens together.

The entry in your config.sh,

cpp_stuff='1'

indicates that Perl has determined that your C-preprocessor isn't
ANSI-compatible, ie that it can't handle the a ## b syntax.

The /usr/bin/cpp preprocessor is _not_ an ANSI C preprocessor; for an ANSI C
preprocessor, see /usr/lib/acpp. Note, however, that SGI says in its manpage
that acpp may not be supported for much longer - people are supposed to use
cc -E (-E meaning only do preprocessing stuff) instead. (This also should
help with that any other (probably IRIX-specific) compliation flags that
happen to affect preprocessor tokens should be used in any preprocessing
steps.)

Unless the system has an already existing executable cpp wrapper called
cppstdin, '$cc -E' is the first thing Configure is going to use as
preprocessor command (see line 4284 in Configure),

Ah, good, I thought I remembered something like that.

so if your bet is on a wrong preprocessor detection, /my/ bet would be an
existing (but wrong) cppstdin

Possible. The only cppstdin I find on an IRIX 6.5.20m system is one that
appears to be from a Perl install (at least from its file date as compared
to the /usr/share/src/perl-5.8.0/cppstdin file, and that the two files are
identical). So an earlier install (possibly something from SGI installing an
older version of Perl, especially since we're talking about an IRIX 6.5.#_f_
system (feature release instead of maintenance release - feature == less
stable)) could have put in one that doesn't work. (I can't read the attached
version of config.sh, so I can't tell by it.)

  -Allen

--
Allen Smith http​://cesario.rutgers.edu/easmith/
February 1, 2003 Space Shuttle Columbia
Ad Astra Per Aspera To The Stars Through Asperity

@p5pRT
Copy link
Author

p5pRT commented Sep 30, 2004

From @iabyn

On Thu, Sep 30, 2004 at 04​:39​:32PM -0400, Ed Allen Smith wrote​:

Possible. The only cppstdin I find on an IRIX 6.5.20m system is one that
appears to be from a Perl install (at least from its file date as compared
to the /usr/share/src/perl-5.8.0/cppstdin file, and that the two files are
identical). So an earlier install (possibly something from SGI installing an
older version of Perl, especially since we're talking about an IRIX 6.5.#_f_
system (feature release instead of maintenance release - feature == less
stable)) could have put in one that doesn't work. (I can't read the attached
version of config.sh, so I can't tell by it.)

Your config.sh has

  cppstdin='cc -64 -E'

and the relevant test in ./Configure is

  $cat >cpp_stuff.c <<'EOCP'
  #define RCAT(a,b)a/**/b
  #define ACAT(a,b)a ## b
  RCAT(Rei,ser)
  ACAT(Cir,cus)
  EOCP
  $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
  if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
  echo "Oh! Smells like ANSI's been here." >&4
  echo "We can catify or stringify, separately or together!"
  cpp_stuff=42

--
"You're so sadly neglected, and often ignored.
A poor second to Belgium, When going abroad."
  -- Monty Python - "Finland"

@p5pRT
Copy link
Author

p5pRT commented Sep 30, 2004

From easmith@beatrice.rutgers.edu

In message <20040930212255.GD1897@​iabyn.com> (on 30 September 2004 22​:22​:55
+0100), davem@​iabyn.com (Dave Mitchell) wrote​:

On Thu, Sep 30, 2004 at 04​:39​:32PM -0400, Ed Allen Smith wrote​:

Possible. The only cppstdin I find on an IRIX 6.5.20m system is one that
appears to be from a Perl install (at least from its file date as compared
to the /usr/share/src/perl-5.8.0/cppstdin file, and that the two files are
identical). So an earlier install (possibly something from SGI installing an
older version of Perl, especially since we're talking about an IRIX 6.5.#_f_
system (feature release instead of maintenance release - feature == less
stable)) could have put in one that doesn't work. (I can't read the attached
version of config.sh, so I can't tell by it.)

Your config.sh has

Not mine, but the original poster's, but don't worry about it.

cppstdin='cc -64 -E'

Huh. That ought to cause a ANSI C preprocess, unless there's a -cckr flag in
there someplace or the SGI_CC environment variable is cckr; the first does
not appear to be the case and the latter of which is unlikely... but there
may be a wrapper _needed_ - see below.

and the relevant test in ./Configure is

$cat >cpp_stuff.c <<'EOCP'
#define RCAT(a,b)a/**/b
#define ACAT(a,b)a ## b
RCAT(Rei,ser)
ACAT(Cir,cus)
EOCP
$cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
echo "Oh! Smells like ANSI's been here." >&4
echo "We can catify or stringify, separately or together!"
cpp_stuff=42

On an IRIX 6.5.20m machine, cpp_stuff.out for cc -64 -E cpp_stuff.c is​:

#line 1 "cpp_stuff.c"

Rei ser
Circus

However, there appears to be a problem with doing it via stdin​:

cc -64 -E < cpp_stuff.c > cpp_stuff.out
cc ERROR​: no source or object file given

cc -64 -E - < cpp_stuff.c > cpp_stuff.out
cc ERROR parsing -​: unknown flag
cc ERROR​: no source or object file given

So a wrapper is necessary. Here, config.sh includes​:

cppminus=''
cppstdin='cppstdin'

  -Allen

--
Allen Smith http​://cesario.rutgers.edu/easmith/
February 1, 2003 Space Shuttle Columbia
Ad Astra Per Aspera To The Stars Through Asperity

@p5pRT
Copy link
Author

p5pRT commented Sep 30, 2004

From mehrdad.ziaei@senecac.on.ca

I installed fw_gcc package from SGI.
$ gcc --version
gcc (GCC) 3.3
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

And using gcc I was able to install perl 5.8.5 without any major problem,
though I got lots of warnings.
Still would be good to find a solution to compile with SGI's cc.

Next step is installing bioperl!

Appreciate all your help
Mehrdad Ziaei

-----Original Message-----
From​: Dave Mitchell via RT [mailto​:perlbug-followup@​perl.org]
Sent​: September 30, 2004 5​:23 PM
To​: mehrdad.ziaei@​senecac.on.ca
Subject​: Re​: [perl #31769] problem compiling perl 5.8.5 on Irix 6.5.21f

On Thu, Sep 30, 2004 at 04​:39​:32PM -0400, Ed Allen Smith wrote​:

Possible. The only cppstdin I find on an IRIX 6.5.20m system is one that
appears to be from a Perl install (at least from its file date as compared
to the /usr/share/src/perl-5.8.0/cppstdin file, and that the two files are
identical). So an earlier install (possibly something from SGI installing
an
older version of Perl, especially since we're talking about an IRIX
6.5.#_f_
system (feature release instead of maintenance release - feature == less
stable)) could have put in one that doesn't work. (I can't read the
attached
version of config.sh, so I can't tell by it.)

Your config.sh has

  cppstdin='cc -64 -E'

and the relevant test in ./Configure is

  $cat >cpp_stuff.c <<'EOCP'
  #define RCAT(a,b)a/**/b
  #define ACAT(a,b)a ## b
  RCAT(Rei,ser)
  ACAT(Cir,cus)
  EOCP
  $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
  if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
  echo "Oh! Smells like ANSI's been here." >&4
  echo "We can catify or stringify, separately or together!"
  cpp_stuff=42

--
"You're so sadly neglected, and often ignored.
A poor second to Belgium, When going abroad."
  -- Monty Python - "Finland"

@p5pRT
Copy link
Author

p5pRT commented Jan 19, 2005

From jon-perlbug@earth.li

Hi,

perl 5.8.6 will not build out-of-the-box on IRIX 6.5 with the standard
MIPSpro compilers. After running `sh Configure -de` :

$ uname -a
IRIX64 dirac 6.5 10060437 IP27
$ cc -version
MIPSpro Compilers​: Version 7.4
$ ./myconfig
Summary of my perl5 (revision 5 version 8 subversion 6) configuration​:
  Platform​:
  osname=irix, osvers=6.5, archname=IP27-irix
  uname='irix64 dirac 6.5 10060437 ip27 '
  config_args='-de'
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
  useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
  use64bitint=undef use64bitall=undef uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc -n32', ccflags ='-D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -I/usr/local/include -DLANGUAGE_C',
  optimize='-O3 -OPT​:Olimit=0​:space=ON',
  cppflags='-D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -I/usr/local/include -DLANGUAGE_C'
  ccversion='MIPSpro Compilers​: Version 7.4', gccversion='', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='cc -n32', ldflags =' -Wl,-woff,84 -L/usr/local/lib'
  libpth=/usr/local/lib /usr/lib32 /lib32 /lib /usr/lib
  libs=-ldb -lm -lc
  perllibs=-lm -lc
  libc=/usr/lib32/libc.so, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags='-n32 -shared -L/usr/local/lib'

$ make
`sh cflags "optimize='-O3 -OPT​:Olimit=0​:space=ON'" miniperlmain.o` miniperlmain.c
  CCCMD = cc -n32 -DPERL_CORE -c -D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -I/usr/local/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=ON
`sh cflags "optimize='-O3 -OPT​:Olimit=0​:space=ON'" perl.o` perl.c
  CCCMD = cc -n32 -DPERL_CORE -c -D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -I/usr/local/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=ON
`sh cflags "optimize='-O3 -OPT​:Olimit=0​:space=ON'" gv.o` gv.c
  CCCMD = cc -n32 -DPERL_CORE -c -D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -I/usr/local/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=ON
cc-1020 cc​: ERROR File = gv.c, Line = 1722
  The identifier "copy" is undefined.

  RvDEEPCP(left);
  ^

cc-1162 cc​: ERROR File = gv.c, Line = 1722
  Too few arguments in function call.

  RvDEEPCP(left);
  ^

cc-1018 cc​: ERROR File = gv.c, Line = 1722
  An unmatched left parentheses "(" appears in an expression.

  RvDEEPCP(left);
  ^

3 errors detected in the compilation of "gv.c".
make​: *** [gv.o] Error 2
$

After some extremely helpful discussions with Nicholas Clark, I verified
that the problem is due to token concatenation in the C preprocessor.
Building gv.i shows that line 1722 of gv.c expands to​:

  do { SV* tmpRef=((XRV*) (left)->sv_any)->xrv_rv; if ((tmpRef)->sv_refcnt>1) { ((XRV*) (left)->sv_any)->xrv_rv=Perl_amagic_call(left,&PL_sv_undef, copy _amg,1 | 8); Perl_sv_free((SV*)(tmpRef)); } } while (0);

..with a space between "copy" and "_amg" ; this can be traced to the use
of the CAT2 macro in AMG_CALLun.

It turns out that if you run "cc -E cpp_stuff.c" on IRIX, it will invoke
/usr/lib32/cmplrs/fec , which is an ANSI preprocessor which correctly
interprets the ## operator. However, if you run "cc -E - < cpp_stuff.c"
(as the Configure script does to determine whether cpp is K&R or ANSI),
then it will instead invoke /usr/lib32/cmplrs/cpp , which is K&R, and
will *not* do anything with the ## operator.

The Configure script (lines 17283-17309) appears to test the IRIX cpp
from stdin, and then assume that cpp is *always* K&R. It then defines
the CAT2 macro to use "A/**/B" to concatenate two tokens -- the comment
is interpreted by an ANSI cpp as whitespace, giving rise to the failure
on line 1722 of gv.c

If I run "sh Configure -de", and then change config.sh so that
cpp_stuff='42' (rather than cpp_stuff='1'), then perl will then build
and install, although it still fails t/op/pwent , t/op/taint ,
ext/Fcntl/t/fcntl , ext/Fcntl/t/syslfs , and lib/ExtUtils/t/Constant .

Apologies for the somewhat convoluted bug report. I am not aware of any
way of making MIPSPro cc preprocess more sanely.

  -jc

@p5pRT
Copy link
Author

p5pRT commented Nov 8, 2006

@doughera88 - Status changed from 'open' to 'stalled'

@p5pRT
Copy link
Author

p5pRT commented Jan 22, 2008

From @doughera88

On Sat, 19 Jan 2008, Rick Delaney wrote​:

On Jan 18 2008, Nicholas Clark wrote​:

On Fri, Jan 18, 2008 at 03​:01​:13PM +0000, David Cantrell wrote​:

cc-1162 cc​: ERROR File = gv.c, Line = 1925
Too few arguments in function call.

  RvDEEPCP\(left\);
  ^

Crap. This is the bug in the Irix CPP where it switches to K&R mode, isn't it?
The one that SGI weren't aware of until we found it for them?
How did we work round it?

These bugs seem relevant​:

http&#8203;://rt\.perl\.org/rt3/Public/Bug/Display\.html?id=33849
http&#8203;://rt\.perl\.org/rt3/Public/Bug/Display\.html?id=31769

The first one is brief and informative. In summary, `cc -E` can't deal
with stdin so it needs a wrapper. It looks like configure will
generate one (cppstdin) but I'm not sure how to trick it into using the
wrapper instead of the K&R cpp it finds.

Thanks for the RT link. Yes, that's familiar. Funny thing is, ever since
5.005, the perl source assumes ANSI mode anyway, so that Configure probe
isn't even needed. We could simply replace it with cpp_stuff=42.
However, then Configure wouldn't be back-portable all the way back to
pre-5.005 perl versions.

Another tack is to patch hints/irix_6.sh to account for this bizarre
situation. That's what I suggest here​:

Inline Patch
--- perl-current/hints/irix_6.sh	Tue Jun 13 15:29:12 2006
+++ perl-andy/hints/irix_6.sh	Tue Jan 22 11:55:34 2008
@@ -337,6 +337,18 @@
     ;;
 esac
 
+
+# Workaround [perl #33849]: perl 5.8.6 fails to build on IRIX 6.5 due to 
+# bizarre preprocessor bug:  cc -E - unfortunately goes into K&R mode, but
+# cc -E file.c doesn't.  Force a wrapper to always get the ANSI mode.
+# (We only need to do this for cc, not for gcc.  ccversion is computed above.)
+case "$ccversion" in
+'')  ;; # gcc.  Do nothing.
+*)  cppstdin=`pwd`/cppstdin
+    cpprun="$cppstdin"
+    ;;
+esac
+
 EOCCBU
 
 # End of cc.cbu callback unit. - Allen

-- 

  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Jan 22, 2008

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jan 22, 2008

From @smpeters

On Tue Jan 22 09​:01​:09 2008, doughera wrote​:

On Sat, 19 Jan 2008, Rick Delaney wrote​:

On Jan 18 2008, Nicholas Clark wrote​:

On Fri, Jan 18, 2008 at 03​:01​:13PM +0000, David Cantrell wrote​:

cc-1162 cc​: ERROR File = gv.c, Line = 1925
Too few arguments in function call.

  RvDEEPCP\(left\);
  ^

Crap. This is the bug in the Irix CPP where it switches to K&R
mode, isn't it?
The one that SGI weren't aware of until we found it for them?
How did we work round it?

These bugs seem relevant​:

http&#8203;://rt\.perl\.org/rt3/Public/Bug/Display\.html?id=33849
http&#8203;://rt\.perl\.org/rt3/Public/Bug/Display\.html?id=31769

The first one is brief and informative. In summary, `cc -E` can't
deal
with stdin so it needs a wrapper. It looks like configure will
generate one (cppstdin) but I'm not sure how to trick it into using
the
wrapper instead of the K&R cpp it finds.

Thanks for the RT link. Yes, that's familiar. Funny thing is, ever
since
5.005, the perl source assumes ANSI mode anyway, so that Configure
probe
isn't even needed. We could simply replace it with cpp_stuff=42.
However, then Configure wouldn't be back-portable all the way back to
pre-5.005 perl versions.

Another tack is to patch hints/irix_6.sh to account for this bizarre
situation. That's what I suggest here​:

--- perl-current/hints/irix_6.sh Tue Jun 13 15​:29​:12 2006
+++ perl-andy/hints/irix_6.sh Tue Jan 22 11​:55​:34 2008
@​@​ -337,6 +337,18 @​@​
;;
esac

+
+# Workaround [perl #33849]​: perl 5.8.6 fails to build on IRIX 6.5 due
to
+# bizarre preprocessor bug​: cc -E - unfortunately goes into K&R
mode, but
+# cc -E file.c doesn't. Force a wrapper to always get the ANSI mode.
+# (We only need to do this for cc, not for gcc. ccversion is
computed above.)
+case "$ccversion" in
+'') ;; # gcc. Do nothing.
+*) cppstdin=`pwd`/cppstdin
+ cpprun="$cppstdin"
+ ;;
+esac
+
EOCCBU

# End of cc.cbu callback unit. - Allen

Thanks, I applied your patch as change #33040.

@p5pRT
Copy link
Author

p5pRT commented Jan 22, 2008

@smpeters - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed Jan 22, 2008
@p5pRT
Copy link
Author

p5pRT commented Jan 24, 2008

From david@cantrell.org.uk

On Tue, Jan 22, 2008 at 11​:59​:47AM -0500, Andrew Dougherty wrote​:

Another tack is to patch hints/irix_6.sh to account for this bizarre
situation. That's what I suggest here​:

--- perl-current/hints/irix_6.sh Tue Jun 13 15​:29​:12 2006
+++ perl-andy/hints/irix_6.sh Tue Jan 22 11​:55​:34 2008
...
+case "$ccversion" in
+'') ;; # gcc. Do nothing.
+*) cppstdin=`pwd`/cppstdin
+ cpprun="$cppstdin"
+ ;;
+esac

That doesn't fix it, I'm afraid.

--
David Cantrell | Enforcer, South London Linguistic Massive

  If I could read only one thing it would be the future, in the
  entrails of the bastard denying me access to anything else.

@p5pRT
Copy link
Author

p5pRT commented Feb 1, 2008

From @doughera88

On Thu, 24 Jan 2008, David Cantrell wrote​:

On Tue, Jan 22, 2008 at 11​:59​:47AM -0500, Andrew Dougherty wrote​:

Another tack is to patch hints/irix_6.sh to account for this bizarre
situation. That's what I suggest here​:

--- perl-current/hints/irix_6.sh Tue Jun 13 15​:29​:12 2006
+++ perl-andy/hints/irix_6.sh Tue Jan 22 11​:55​:34 2008
...
+case "$ccversion" in
+'') ;; # gcc. Do nothing.
+*) cppstdin=`pwd`/cppstdin
+ cpprun="$cppstdin"
+ ;;
+esac

That doesn't fix it, I'm afraid.

[Sorry I overlooked this reply earlier. Thanks to our valiant
summarizer, I now have noticed it.]

Oh, rats. I forgot that this chunk is in a call-back unit, and hence runs
down in the UU directory. Here's a fix on top of current blead. I hope
this will work. Sorry for the inconvenience.

Inline Patch
--- perl-current/hints/irix_6.sh	2008-01-22 18:50:52.000000000 -0500
+++ perl-andy/hints/irix_6.sh	2008-02-01 12:36:25.363130232 -0500
@@ -344,7 +344,9 @@
 # (We only need to do this for cc, not for gcc.  ccversion is computed above.)
 case "$ccversion" in
 '')  ;; # gcc.  Do nothing.
-*)  cppstdin=`pwd`/cppstdin
+*)  # Inside this call-back unit, we are down in the UU/ subdirectory,
+    # but Configure will look for cppstdin one level up.
+    cd ..; cppstdin=`pwd`/cppstdin; cd UU
     cpprun="$cppstdin"
     ;;
 esac


-- 

  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Feb 7, 2008

From @rgs

On 01/02/2008, Andy Dougherty <doughera@​lafayette.edu> wrote​:

Oh, rats. I forgot that this chunk is in a call-back unit, and hence runs
down in the UU directory. Here's a fix on top of current blead. I hope
this will work. Sorry for the inconvenience.

--- perl-current/hints/irix_6.sh 2008-01-22 18​:50​:52.000000000 -0500
+++ perl-andy/hints/irix_6.sh 2008-02-01 12​:36​:25.363130232 -0500

Thanks, applied as #33246.
(I know, I lag.)

@p5pRT
Copy link
Author

p5pRT commented Feb 11, 2008

From david@cantrell.org.uk

On Fri, Feb 01, 2008 at 12​:39​:39PM -0500, Andy Dougherty wrote​:

Oh, rats. I forgot that this chunk is in a call-back unit, and hence runs
down in the UU directory. Here's a fix on top of current blead. I hope
this will work. Sorry for the inconvenience ...

Sorry it's taken me so long to get back on this - the Irix machine I use
was down for a few days.

With that patch applied it gets quite a bit further, but stops at ...

Extracting lib.pm (with variable substitutions)
  AutoSplitting perl library
  ./miniperl -Ilib -e 'use AutoSplit; \
  autosplit_lib_modules(@​ARGV)' lib/*.pm
  ./miniperl -Ilib -e 'use AutoSplit; \
  autosplit_lib_modules(@​ARGV)' lib/*/*.pm
  make lib/re.pm
  cp ext/re/re.pm lib/re.pm
  ./miniperl minimod.pl > lib/ExtUtils/Miniperl.pm
  cd lib/unicore && ../../miniperl -I../../lib mktables -w
  touch uni.data
  `sh cflags "optimize='-O3 -OPT​:Olimit=0​:space=ON'" perlmain.o` perlmain.c
  CCCMD = cc -n32 -DPERL_CORE -c -D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -I/usr/local/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=ON
  Making DynaLoader (static)
ext/util/make_ext[129]​: 63275 Bus error(coredump)
Warning​: No Makefile!
don't know how to make config (bu42).
make config failed, continuing anyway...
don't know how to make all (bu42).
*** Error code 1 (bu21)

--
David Cantrell | Hero of the Information Age

@p5pRT
Copy link
Author

p5pRT commented Feb 11, 2008

From @doughera88

On Mon, 11 Feb 2008, David Cantrell wrote​:

Sorry it's taken me so long to get back on this - the Irix machine I use
was down for a few days.

With that patch applied it gets quite a bit further, but stops at ...

Extracting lib.pm (with variable substitutions)
AutoSplitting perl library
./miniperl -Ilib -e 'use AutoSplit; \
autosplit_lib_modules(@​ARGV)' lib/*.pm
./miniperl -Ilib -e 'use AutoSplit; \
autosplit_lib_modules(@​ARGV)' lib/*/*.pm
make lib/re.pm
cp ext/re/re.pm lib/re.pm
./miniperl minimod.pl > lib/ExtUtils/Miniperl.pm
cd lib/unicore && ../../miniperl -I../../lib mktables -w
touch uni.data
`sh cflags "optimize='-O3 -OPT​:Olimit=0​:space=ON'" perlmain.o` perlmain.c
CCCMD = cc -n32 -DPERL_CORE -c -D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -I/usr/local/include -DLANGUAGE_C -O3 -OPT​:Olimit=0​:space=ON
Making DynaLoader (static)
ext/util/make_ext[129]​: 63275 Bus error(coredump)
Warning​: No Makefile!
don't know how to make config (bu42).
make config failed, continuing anyway...
don't know how to make all (bu42).
*** Error code 1 (bu21)

(I assume that the 'coredump' is from miniperl.)

At this point, I usually suspect the optimizer, probably having trouble
with the regex code.

Two diagnostic things to try​:

1. make minitest

This should run the test suite for miniperl. There will likely be lots of
irrelevant test failures if various parts of the test suite use modules
that haven't been built yet. Still, much of the test suite ought to run,
and might point to where the problem lies.

2. Rebuild without -O3 optimization. (The easiest way to do this is
hand-edit config.sh to change -O3 into -O1 or maybe even get rid of it
altogether) and then

  rm *.o
  sh Configure -S
  make depend
  make

If you're really adventurous, you can try recompiling file-by-file,
perhaps guided or inspired by the results of 'make minitest', and figure
out which file (if any) is causing the problem. You can then add that
specific file as an exception to the hints file. (See the existing
pp_ctl_cflags workaround in the irix hints file for an example.)

Good luck,

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Feb 11, 2008

From @nwc10

On Mon, Feb 11, 2008 at 12​:59​:24PM -0500, Andy Dougherty wrote​:

If you're really adventurous, you can try recompiling file-by-file,
perhaps guided or inspired by the results of 'make minitest', and figure
out which file (if any) is causing the problem. You can then add that
specific file as an exception to the hints file. (See the existing
pp_ctl_cflags workaround in the irix hints file for an example.)

If you haven't installed it (yet), ccache is definately your friend for these
sorts of games.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Jun 24, 2012

From @doy

Does anything else need to be done here? Or can this ticket be closed?

@p5pRT
Copy link
Author

p5pRT commented Jun 24, 2012

The RT System itself - Status changed from 'stalled' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jun 27, 2012

From @nwc10

On Sun, Jun 24, 2012 at 04​:12​:01PM -0700, Jesse Luehrs via RT wrote​:

Does anything else need to be done here? Or can this ticket be closed?

Yes, there is something we could still do, in that the suggested change to
Configure was never made (to the best of my knowledge).
Configure tests the C pre-processor on stdin, but the build system runs it
against a file.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Jun 27, 2012

From @doughera88

On Wed, 27 Jun 2012, Nicholas Clark wrote​:

On Sun, Jun 24, 2012 at 04​:12​:01PM -0700, Jesse Luehrs via RT wrote​:

Does anything else need to be done here? Or can this ticket be closed?

Yes, there is something we could still do, in that the suggested change to
Configure was never made (to the best of my knowledge).
Configure tests the C pre-processor on stdin, but the build system runs it
against a file.

I'm pretty sure nothing has changed here. I've taken this ticket and
added it to my growing pile.

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Sep 3, 2012

From @doughera88

On Wed Jun 27 09​:16​:50 2012, doughera wrote​:

On Wed, 27 Jun 2012, Nicholas Clark wrote​:

On Sun, Jun 24, 2012 at 04​:12​:01PM -0700, Jesse Luehrs via RT wrote​:

Does anything else need to be done here? Or can this ticket be closed?

Yes, there is something we could still do, in that the suggested
change to
Configure was never made (to the best of my knowledge).
Configure tests the C pre-processor on stdin, but the build system
runs it
against a file.

I'm pretty sure nothing has changed here. I've taken this ticket and
added it to my growing pile.

I was wrong. This problem was indeed already addressed by changing the
Irix hints file with commit 8c5d564156fedb3379080cf8d14db501bd06f5e back
in 2008. It was also in a separate ticket, [perl #33849]. I have
merged the relevant RT tickets and resolved them.

@p5pRT
Copy link
Author

p5pRT commented Sep 3, 2012

From [Unknown Contact. See original ticket]

On Wed Jun 27 09​:16​:50 2012, doughera wrote​:

On Wed, 27 Jun 2012, Nicholas Clark wrote​:

On Sun, Jun 24, 2012 at 04​:12​:01PM -0700, Jesse Luehrs via RT wrote​:

Does anything else need to be done here? Or can this ticket be closed?

Yes, there is something we could still do, in that the suggested
change to
Configure was never made (to the best of my knowledge).
Configure tests the C pre-processor on stdin, but the build system
runs it
against a file.

I'm pretty sure nothing has changed here. I've taken this ticket and
added it to my growing pile.

I was wrong. This problem was indeed already addressed by changing the
Irix hints file with commit 8c5d564156fedb3379080cf8d14db501bd06f5e back
in 2008. It was also in a separate ticket, [perl #33849]. I have
merged the relevant RT tickets and resolved them.

@p5pRT
Copy link
Author

p5pRT commented Sep 3, 2012

From @nwc10

On Mon, Sep 03, 2012 at 10​:10​:11AM -0700, Andy Dougherty via RT wrote​:

I was wrong. This problem was indeed already addressed by changing the
Irix hints file with commit 8c5d564156fedb3379080cf8d14db501bd06f5e back
  08c5d56

Are you using MS Excel as your e-mail client? :-)

in 2008. It was also in a separate ticket, [perl #33849]. I have
merged the relevant RT tickets and resolved them.

Thanks for tracking this down, and getting a record of the solution
into the right place.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Sep 3, 2012

From @doughera88

On Mon, 3 Sep 2012, Nicholas Clark wrote​:

On Mon, Sep 03, 2012 at 10​:10​:11AM -0700, Andy Dougherty via RT wrote​:

I was wrong. This problem was indeed already addressed by changing the
Irix hints file with commit 8c5d564156fedb3379080cf8d14db501bd06f5e back
08c5d56

Are you using MS Excel as your e-mail client? :-)

No, that was me cutting & pasting from an xterm into the RT web interface.
I am apparently not to be trusted with a mouse.

--
  Andy Dougherty doughera@​lafayette.edu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant