Operating System - HP-UX
1753307 Members
6388 Online
108792 Solutions
New Discussion юеВ

Re: CPAN error when compiling C code

 
ken kroel
New Member

CPAN error when compiling C code

greetings,

i'm trying to setup CPAN on our HP 9000, HP-UX 11.0. i run into an error whenever i try to install a module that contains C code:

cc1: Invalid option `-fno-strict-aliasing'
*** Error exit code 1

i saw this when installing LWP to get CPAN past our firewall, but worked around it by removing the option from the makefile. is there a way to tell CPAN to remove this option from all its makefiles? or would it be better to upgrade our gcc so it recognizes the option? we do have the standard HP cc compiler, can i tell CPAN to use that? IIRC, i have to use the same compiler that perl used, which is gcc. if we need to upgrade gcc, is it fairly simple or are there known problems? any advice is appreciated. TIA

ken

version info:
# uname -r
B.11.00

cpan> i /CPAN/
...
Module CPAN (A/AN/ANDK/CPAN-1.76.tar.gz)
..

perl was obtained from http://hpux.connect.org.uk/hppd/hpux/Languages/perl-5.8.3/
# perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
Platform:
osname=hpux, osvers=11.00, archname=PA-RISC2.0
uname='hp-ux ness b.11.00 a 9000780 2012209406 two-user license '
config_args='-d -e -Dcc=gcc -Dprefix=/usr/local useposix=true'
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='gcc', ccflags ='-D_HPUX_SOURCE -fno-strict-aliasing -I/usr/local/include

-D_LARGEFILE_SOURCE',
optimize='-O2',
cppflags='-D_HPUX_SOURCE -D_HPUX_SOURCE -fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='3.3.2', gccosandvers='hpux11.00'
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=4
alignbytes=8, prototype=define
Linker and Libraries:
ld='/usr/bin/ld', ldflags =' -L/usr/local/lib -L/opt/local/lib'
libpth=/usr/local/lib /opt/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lnsl -lnm -lndbm -lgdbm -ldb -lmalloc -ldld -lm
perllibs=-lnsl -lnm -lmalloc -ldld -lm
libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred '
cccdlflags='-fPIC', lddlflags='-b -L/usr/local/lib -L/opt/local/lib'

Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under hpux
Compiled at Feb 2 2004 09:09:51
%ENV:
PERL5LIB="/xxx/xxx/script/perl"
@INC:
/xxx/xxx/script/perl
/usr/local/lib/perl5/5.8.3/PA-RISC2.0
/usr/local/lib/perl5/5.8.3
/usr/local/lib/perl5/site_perl/5.8.3/PA-RISC2.0
/usr/local/lib/perl5/site_perl/5.8.3
/usr/local/lib/perl5/site_perl
.
# gcc -v
Reading specs from /usr/local/lib/gcc-lib/hppa1.0-hp-hpux11.00/2.7.2.3/specs
gcc version 2.7.2.3
3 REPLIES 3
Eiff, Volker
New Member

Re: CPAN error when compiling C code

Hi,

compiling perl modules or other freeware stuff is seldom successful with the original HP-UX cc. All makefiles are designed for gcc.

Since the HP-UX porting center discontinued the 11.00 branch, you can get latest gcc for HP-UX 11.00 from http://mirrors.develooper.com/ .

I successfully compiled perl modules via CPAN with an gcc 3.3.2 on a HP-UX 11.00 system. Since we have an internal CPAN mirror, I have no hassle with any firewalls :-)

Steven E. Protter
Exalted Contributor

Re: CPAN error when compiling C code

Try this:
http://hpux.connect.org.uk/hppd/hpux/Gnu/gcc-3.4.3/

Pay attention to downloading and installing all pre-requisites.

This stuff can be compiled under hpux cc with changes, but its hardly ever worth the trouble.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
ken kroel
New Member

Re: CPAN error when compiling C code

thanks for the replies. i was able to download and install gcc3.4.2, but ran into trouble when i tried replacing the existing gcc 2.7.2.3.

i tried just replacing the gcc executable, but it complained loudly, so i obviously missed switching other things. how can i find out what needs to be replaced/renamed/relinked, etc, to get the new version working?

it installed in /usr/local/pa20_64/bin/gcc

the following are the results of trying to install a module in CPAN, after the switch:

Running make test
/usr/bin/perl /usr/local/lib/perl5/5.8.3/ExtUtils/xsubpp -noprototypes -typemap /usr/local/lib/perl5/5.8.3/ExtUtils/typemap ReadKey.xs > ReadKey.xsc && mv ReadKey.xsc ReadKey.c
gcc -c -D_HPUX_SOURCE -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -O2 -DVERSION=\"2.21\" -DXS_VERSION=\"2.21\" -fPIC "-I/usr/local/lib/perl5/5.8.3/PA-RISC2.0/CORE" ReadKey.c
rm -f blib/arch/auto/Term/ReadKey/ReadKey.sl
LD_RUN_PATH="" /usr/bin/ld -b -L/usr/local/lib -L/opt/local/lib ReadKey.o -o blib/arch/auto/Term/ReadKey/ReadKey.sl
chmod 755 blib/arch/auto/Term/ReadKey/ReadKey.sl
PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" -w test.pl
1 .. 8
/usr/lib/dld.sl: Bad magic number for shared library: blib/arch/auto/Term/ReadKey/ReadKey.sl
/usr/lib/dld.sl: Exec format error
Can't load 'blib/arch/auto/Term/ReadKey/ReadKey.sl' for module Term::ReadKey: Exec format error at /usr/local/lib/perl5/5.8.3/PA-RISC2.0/DynaLoader.pm line 229.
at test.pl line 22
Compilation failed in require at test.pl line 22.
BEGIN failed--compilation aborted at test.pl line 22.
not ok 1
*** Error exit code 255

Stop.
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force