Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

different compiler for perl and module (SGI-cc and gcc)

14 views
Skip to first unread message

Michiel Kreutzer

unread,
Sep 1, 1999, 3:00:00 AM9/1/99
to
I am trying to compile the DBI perl module on SGI IRIX 6.5.4m. I have
the perl software that came with irix (eoe.sw.gifts-perl or something)
and gcc 2.8.1. from the freeware.sgi.com site. This is the first perl
module I ever tried.

I did 'perl Makefile.PL', which creates a Makefile. This makefile get
information about the system from Config.pm, which in turn hold the
information used to build perl. Perl on my system was build with the
MIPSPro compiler, which I don't have. I use gcc.

I edited the makefile by hand, see below for details. This way I managed
to build with some warnings (below), but the subsequent 'make test'
fails (again, below).

Searching dejanews, I did not find the answer. Some suggest to build
perl with the compiler, etc, that will be used for modules. Do perl and
perl-modules have to be compiled with same compiler, or can config.pm
safely be edited to hold _current_ information about the system? Has
anybody ever done this for the Irix-gcc combination?

Building perl with gcc on Irix is troublesome, I have to patch gcc to do
that (has to do with integer sizes in n32), as someone suggested.

Or am I missing the point here?

Thanks in advance for any input!
At the real bottom some system info is given:


### Changes to Makefile
CC = gcc -fno-builtin -mips3
CCFLAGS = -D_BSD_SIGNALS -D_BSD_TYPES -D_BSD_TIME
-DLANGUAGE_C -DEMBEDMYMALLOC

LD = ld
LDDLFLAGS = -n32 -mips3 -shared
LDFLAGS = -n32

# --- MakeMaker cflags section:

CCFLAGS = -D_BSD_SIGNALS -D_BSD_TYPES -D_BSD_TIME
OPTIMIZE = -O

### gmake warnings

/usr/share/lib/perl5/irix-n32/5.00404/CORE/perlsdio.h:268: warning:
`getc_unlocked' redefined
/usr/include/stdio.h:394: warning: this is the location of the previous
definition

/usr/share/lib/perl5/irix-n32/5.00404/CORE/perlsdio.h:270: warning:
`putc_unlocked' redefined
/usr/include/stdio.h:396: warning: this is the location of the previous
definition
DBI.xs: In function `set_trace_file':
DBI.xs:406: warning: passing arg 1 of `setlinebuf' from incompatible
pointer type

### 'gmake test' output
[michiel@Indigo2 /disk4/src/DBI-1.11] > gmake test
PERL_DL_NONLAZY=1 /usr/sbin/perl -I./blib/arch
-I./blib/lib -I/usr/share/lib/perl5/irix-n32/5.00404
-I/usr/share/lib/perl5 -e 'u est::Harness
qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/basics............dubious
Test returned status 0 (wstat 138, 0x8a)
Number found where operator expected at (eval 103) line 1, near "*(138"
(Missing operator before 138?)
t/dbidrv............dubious
Test returned status 0 (wstat 138, 0x8a)
Number found where operator expected at (eval 105) line 1, near "*(138"
(Missing operator before 138?)
t/examp.............dubious
Test returned status 0 (wstat 138, 0x8a)
Number found where operator expected at (eval 107) line 1, near "*(138"
(Missing operator before 138?)
t/meta..............dubious
Test returned status 0 (wstat 138, 0x8a)
Number found where operator expected at (eval 109) line 1, near "*(138"
(Missing operator before 138?)
t/proxy.............dubious
Test returned status 0 (wstat 138, 0x8a)
Number found where operator expected at (eval 111) line 1, near "*(138"
(Missing operator before 138?)
t/shell.............skipping test on this platform
t/subclass..........dubious
Test returned status 0 (wstat 138, 0x8a)
Number found where operator expected at (eval 113) line 1, near "*(138"
(Missing operator before 138?)
FAILED--7 test scripts could be run, alas--no output ever seen
gmake: *** [test_dynamic] Error 138

### system info
[Indigo2 /disk4/src/DBI-1.11] > gcc -v
Reading specs from
/usr/freeware/lib/gcc-lib/mips-sgi-irix6.2/2.8.1/specs
gcc version 2.8.1
[Indigo2 /disk4/src/DBI-1.11] > uname -aR
IRIX Indigo2 6.5 6.5.4m
[Indigo2 /disk4/src/DBI-1.11] > perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
Platform:
osname=irix, osvers=6.5, archname=irix-n32
uname='irix hoshi 6.5 11251326 ip22 '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=y useperlio=define d_sfio=undef
Compiler:
cc='cc -n32 -mips3', optimize='-O3 -mips3', gccversion=
cppflags='-D_BSD_SIGNALS -D_BSD_TYPES -D_BSD_TIME
-OPT:Olimit=0:space=ON -DLANGUAGE_C -DEMBEDMYMALLOC'
ccflags ='-D_BSD_SIGNALS -D_BSD_TYPES -D_BSD_TIME -woff
1009,1110,1184 -OPT:Olimit=0:space=ON -DLANGUAGE_C
-DEMBEDMYMALLOC' stdchar='unsigned char', d_stdstdio=define,
usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='cc', ldflags ='-n32'
libpth=/usr/lib32 /lib32
libs=-lm
libc=/usr/lib32/libc.so, so=so
useshrplib=true, libperl=libperl.so.4.4
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=''
cccdlflags=' ', lddlflags='-n32 -mips3 -shared'

Characteristics of this binary (from libperl):
Built under irix
Compiled at Apr 30 1998 00:54:41
@INC:
/usr/share/lib/perl5/irix-n32/5.00404
/usr/share/lib/perl5
/usr/share/lib/perl5/site_perl/irix-n32
/usr/share/lib/perl5/site_perl
/usr/share/lib/perl5/sgi_perl
.

--
M.T. Kreutzer
m.t.kr...@nospam.chem.rug.nl
m.t.kr...@nospam.stm.tudelft.nl


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

Tye McQueen

unread,
Sep 2, 1999, 3:00:00 AM9/2/99
to
[Posted and e-mailed.]

Michiel Kreutzer <mkre...@my-deja.com> writes:
) Do perl and
) perl-modules have to be compiled with same compiler, or can config.pm
) safely be edited to hold _current_ information about the system?

In general, compiling modules with a compiler other than the one
used to build Perl is not supported.

When you build Perl, a great deal of information about your
operating system, compiler, include files, and run-time libraries
is analysed. The results of this analysis and some personal
preferences about how you want Perl built end up in Config.pm
and a bunch of C include files that end up someplace like
lib/core/*.h.

Changing Config.pm and lib/core/*.h to match what they would have
been had you used a different compiler to build Perl can be quite
a challenge and can also result in modules being built that are
not compatible with your copy of Perl.

There are many ordered pairs of combinations of systems,
compilers, and Perl options where modules built under one set
will work with Perls built on the other. While it can be easy to
determine that a given pair does *not* belong to this set, trying
to show that a given pair *does* belong to this set can be a
daunting task. It may appear to work for a while and then you
start running into strange errors.

) Building perl with gcc on Irix is troublesome, I have to patch gcc to do
) that (has to do with integer sizes in n32), as someone suggested.

This sounds like the type of thing that would break a Perl module
built with an unpatched version of gcc anyway. It sounds like
you'll end up with incompatible structs between Perl and the module.

) Number found where operator expected at (eval 103) line 1, near "*(138"
) (Missing operator before 138?)

I don't see how you could get such an error. If you are curious,
you could use the Perl debugger to get more data on this. But I
think you'll just have to build your own copy of Perl in the end.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)

0 new messages