You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Marc Slagle <ma...@online-rewards.com> on 2004/08/19 18:05:35 UTC
[mp2] unable to compile 1.99_14 on solaris 9 + workaround
1. Problem Description:
When compiling mod_perl-1.99_14 on solaris 9, I get the following errors:
[root@cham01 mod_perl-1.99_14]# perl Makefile.PL MP_AP_PREFIX=/usr/app/cham
Reading Makefile.PL args from @ARGV
MP_AP_PREFIX = /usr/app/cham
Configuring Apache/2.0.50 mod_perl/1.99_14 Perl/v5.6.1
...
[root@cham01 mod_perl-1.99_14]# make
cd "src/modules/perl" && make -f Makefile.modperl
make[1]: Entering directory
`/usr/local/build/mod_perl-1.99_14/src/modules/perl'
cc -I/usr/local/build/mod_perl-1.99_14/src/modules/perl
-I/usr/local/build/mod_perl-1.99_14/xs -I/usr/app/cham//include
-I/usr/app/cham//include -I/usr/perl5/5.6.1/lib/i86pc-solaris-64int/CORE
-DMOD_PERL -DMP_COMPAT_1X -DSOLARIS2=9 -D_POSIX_PTHREAD_SEMANTICS
-D_REENTRANT -xO3 -xdepend -KPIC \
-c mod_perl.c && mv mod_perl.o mod_perl.lo
cc: unrecognized option `-KPIC'
cc: language depend not recognized
cc: mod_perl.c: linker input file unused because linking not done
mv: cannot access mod_perl.o
make[1]: *** [mod_perl.lo] Error 2
make[1]: Leaving directory
`/usr/local/build/mod_perl-1.99_14/src/modules/perl'
*** Error code 2
make: Fatal error: Command failed for target `modperl_lib'
It would seem that the version of perl that comes with solaris was
compiled with the -KPIC flag using the sun compiler (see below). When
using gcc to compile mod_perl with the sun compiled version of perl you
will get the above errors. Once you compile perl yourself on the
server, the problem goes away (as long as you dont have the old sun
compiled perl at /usr/bin/perl anymore.)
I realize that most people who compile mod_perl also compile perl
themselves, so this isn't something most people would see. But the perl
that comes with solaris 9 is version 5.6.1 without 5005threads, which
the documentation says is ok. I would suggest that the documentation
reflects this somewhere, since users who are just following the
instructions at
http://perl.apache.org/docs/2.0/user/install/install.html would get this
error while trying to compile on solaris 9.
2. Used Components and their Configuration:
*** mod_perl version 1.9914
*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
MP_AP_PREFIX => /usr/app/cham
MP_COMPAT_1X => 1
MP_GENERATE_XS => 1
MP_LIBNAME => mod_perl
MP_USE_DSO => 1
MP_USE_STATIC => 1
*** /usr/app/cham/bin/httpd -V
Server version: Apache/2.0.50
Server built: Aug 18 2004 16:25:54
Server's Module Magic Number: 20020903:8
Architecture: 32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_PROC_PTHREAD_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/usr/app/proxy"
-D SUEXEC_BIN="/usr/app/proxy/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
*** /usr/perl5/5.6.1/bin/perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
Platform:
osname=solaris, osvers=2.9, archname=i86pc-solaris-64int
uname='sunos localhost 5.9 i86pc i386 i86pc'
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=undef uselongdouble=undef
Compiler:
cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-xO3 -xdepend',
cppflags=''
ccversion='Sun WorkShop', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =''
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc
perllibs=-lsocket -lnsl -ldl -lm -lc
libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-R
/usr/perl5/5.6.1/lib/i86pc-solaris-64int/CORE'
cccdlflags='-KPIC', lddlflags='-G'
Characteristics of this binary (from libperl):
Compile-time options: USE_64_BIT_INT USE_LARGE_FILES
Locally applied patches:
9676 Port the OpenBSD glob() security patch
9678 Addendum to #9676: some missing changes from OpenBSD glob.c
9679 Up $File::Glob::VERSION, add OpenBSD glob version note
9693 $VERSION and Version() on same line provokes CPAN.pm warning
9706 #7210 broke .packlist generation
9707 ExtUtils::Installed doesn't quote regex metacharacters in paths
9775 Typo in utf8.h
9950 Revert integration of #8254,#8255 in #8620 (causes coredump)
10021 Insecure regexes
10091 $ref1 == $ref2 behaves unpredictably if not NV_PRESERVES_UV
10093 Incorrect line numbers in AutoSplit
10100 [20010514.027] PL_last_in_gv may not be GV if stale filehandle
10145 [20010515.004] Segfaults from premature GC
10203 Don't think about UTF8
10250 [20010422.005] perl -e '{s//${}/; //}' segfaults
10394 Leakage of file scope lexicals into predeclared subroutines
10404 eval.t was relying on pre-#10394 buggy behavior
10412 Rationalize locale handling to fix bugs uncovered by #10394
10422 Potential buffer overrun if the radix separator > 1 byte
10448 Lexicals outside eval weren't resolved correctly pre-#10394
10450 Optimize #10448 slightly
10543 Add LC_MESSAGES constant to POSIX module
10667 #10449 broke visibility of lexicals inside DB::DB()
10739 C<eval "/x$\r\n/x"> fails to compile correctly
10939 Proposed fix for Pod::Man
11169 Doc patch for Tie::Hash
11374 Make h2ph grok ccsymbols fo the form 1234L, 1234ULL etc
11427 t/harness wasn't picking up all the tests
11428 run/runenv.t needs fflushNULL sanity
11431 pod/*.t tests not picked up by t/TEST either
11510 eval 'format foo=' would loop indefinitely
11713 UTF8 wasn't printing for PVMGs
11716 UTF8 flag should be meaningful only when POK
11808 [20010831.002] Bug in Term::Cap on Solaris ansi terminal
11847 Typo in perl_clone() code causes local(*foo) breakage
12005 [20010912.007] substr reference core dump
12024 Fix local() precedence bug in #8311
12303 Fix 'local $!=0;undef*STDOUT;' segfault
12304 Pod::Html makes a poor guess at author
12350 Typo in IO::Seekable doc
12496 Carp::shortmess_heavy() doesn't notice trailing newline
12549 readline() doesn't work with 'our' variables
12550 #12549 wasn't aware of strictures
12752 croak(Nullch) wasn't printing the contents of ERRSV
12811 [20011101.069] \stat('.') gives 'free unref scalar' error
12812 Slight modification of #12811
13149 Integrate #13147 from mainline (fixes nit in #10091)
13261 Integrate #8340,#13260 from mainline
Built under solaris
Compiled at Nov 4 2002 01:56:55
%ENV:
PERL_LWP_USE_HTTP_10="1"
@INC:
/usr/perl5/5.6.1/lib/i86pc-solaris-64int
/usr/perl5/5.6.1/lib
/usr/perl5/site_perl/5.6.1/i86pc-solaris-64int
/usr/perl5/site_perl/5.6.1
/usr/perl5/site_perl
/usr/perl5/vendor_perl/5.6.1/i86pc-solaris-64int
/usr/perl5/vendor_perl/5.6.1
/usr/perl5/vendor_perl
.
Thanks,
Marc Slagle
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] unable to compile 1.99_14 on solaris 9 + workaround
Posted by Stas Bekman <st...@stason.org>.
Marc Slagle wrote:
>
>>
>> Why doesn't it use the sun compiler when compilinig mod_perl? where
>> does cc point? How come that it has picked gcc?
>>
>> Compiler:
>> cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
>>
>> mod_perl simply tries to use the same compiler perl was compiled with,
>> so if perl reports cc and it's not the same compiler it was compiled
>> with it's the problem of your installation.
>>
> Theres a link at /usr/local/bin/cc pointing to /usr/local/bin/gcc.
So, that explains the issue. Purhaps perl needs to start embedding a full
path to the compiler to avoid this kind of problem.
>> I think this can and should be fixed on the Makefile.PL level, w/o
>> having any special-case documentation for solaris9 users :) Just help
>> us to figure out what went wrong...
>
>
>
> The problem I've had with solaris over the years is that theres a fake
> cc living in /usr/ucb. Any time you run it (unless you buy the sun
> compiler, I assume) you get an error like "language optional software
> package not installed". And some software that we have had to compile
> just wants "cc" instead of "gcc". Instead of hacking up makefiles and
> such, we just make the link to let those programs compile. Many solaris
> admins don't have access to the sun compiler, and use the same trickery
> to get thier packages to compile.
>
> So what happened is that while the makefile was being built, it saw the
> sun-compiled perl and got the information above (compiler, etc.) During
> make the cc command was called, but was a link to gcc. The gcc compiler
> didn't like the -KPIC flag that the sun-compiled perl was built with and
> choked. This problem will probably pop up on any solaris 9 system with
> the default perl left installed (5.6.1) and 'cc' linked to 'gcc'.
Understood, Marc.
So all we need to add in the 2.0 docs is that a reminder that mod_perl,
must be compiled with the same compiler perl was compiled with. This
applies to any platform, and not specific to solaris 9. We have this in
the mod_perl 1.0 docs, for this exact reason.
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] unable to compile 1.99_14 on solaris 9 + workaround
Posted by Marc Slagle <ma...@online-rewards.com>.
>
> Why doesn't it use the sun compiler when compilinig mod_perl? where
> does cc point? How come that it has picked gcc?
>
> Compiler:
> cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
>
> mod_perl simply tries to use the same compiler perl was compiled with,
> so if perl reports cc and it's not the same compiler it was compiled
> with it's the problem of your installation.
>
Theres a link at /usr/local/bin/cc pointing to /usr/local/bin/gcc.
> I think this can and should be fixed on the Makefile.PL level, w/o
> having any special-case documentation for solaris9 users :) Just help
> us to figure out what went wrong...
The problem I've had with solaris over the years is that theres a fake
cc living in /usr/ucb. Any time you run it (unless you buy the sun
compiler, I assume) you get an error like "language optional software
package not installed". And some software that we have had to compile
just wants "cc" instead of "gcc". Instead of hacking up makefiles and
such, we just make the link to let those programs compile. Many solaris
admins don't have access to the sun compiler, and use the same trickery
to get thier packages to compile.
So what happened is that while the makefile was being built, it saw the
sun-compiled perl and got the information above (compiler, etc.) During
make the cc command was called, but was a link to gcc. The gcc compiler
didn't like the -KPIC flag that the sun-compiled perl was built with and
choked. This problem will probably pop up on any solaris 9 system with
the default perl left installed (5.6.1) and 'cc' linked to 'gcc'.
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: [mp2] unable to compile 1.99_14 on solaris 9 + workaround
Posted by Stas Bekman <st...@stason.org>.
Marc Slagle wrote:
> 1. Problem Description:
>
> When compiling mod_perl-1.99_14 on solaris 9, I get the following errors:
>
> [root@cham01 mod_perl-1.99_14]# perl Makefile.PL MP_AP_PREFIX=/usr/app/cham
> Reading Makefile.PL args from @ARGV
> MP_AP_PREFIX = /usr/app/cham
> Configuring Apache/2.0.50 mod_perl/1.99_14 Perl/v5.6.1
> ...
>
> [root@cham01 mod_perl-1.99_14]# make
> cd "src/modules/perl" && make -f Makefile.modperl
> make[1]: Entering directory
> `/usr/local/build/mod_perl-1.99_14/src/modules/perl'
> cc -I/usr/local/build/mod_perl-1.99_14/src/modules/perl
> -I/usr/local/build/mod_perl-1.99_14/xs -I/usr/app/cham//include
> -I/usr/app/cham//include -I/usr/perl5/5.6.1/lib/i86pc-solaris-64int/CORE
> -DMOD_PERL -DMP_COMPAT_1X -DSOLARIS2=9 -D_POSIX_PTHREAD_SEMANTICS
> -D_REENTRANT -xO3 -xdepend -KPIC \
> -c mod_perl.c && mv mod_perl.o mod_perl.lo
> cc: unrecognized option `-KPIC'
> cc: language depend not recognized
> cc: mod_perl.c: linker input file unused because linking not done
> mv: cannot access mod_perl.o
> make[1]: *** [mod_perl.lo] Error 2
> make[1]: Leaving directory
> `/usr/local/build/mod_perl-1.99_14/src/modules/perl'
> *** Error code 2
> make: Fatal error: Command failed for target `modperl_lib'
>
> It would seem that the version of perl that comes with solaris was
> compiled with the -KPIC flag using the sun compiler (see below). When
> using gcc to compile mod_perl with the sun compiled version of perl you
> will get the above errors. Once you compile perl yourself on the
> server, the problem goes away (as long as you dont have the old sun
> compiled perl at /usr/bin/perl anymore.)
Why doesn't it use the sun compiler when compilinig mod_perl? where does
cc point? How come that it has picked gcc?
Compiler:
cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
mod_perl simply tries to use the same compiler perl was compiled with, so
if perl reports cc and it's not the same compiler it was compiled with
it's the problem of your installation.
> I realize that most people who compile mod_perl also compile perl
> themselves, so this isn't something most people would see. But the perl
> that comes with solaris 9 is version 5.6.1 without 5005threads, which
> the documentation says is ok.
You also realize that the official 5.6.1 (specified in the docs) and the
perl that comes with solaris 9 are not the same thing, as it has a few
dozens patches on top of it:
[...]
> Characteristics of this binary (from libperl):
> Compile-time options: USE_64_BIT_INT USE_LARGE_FILES
> Locally applied patches:
> 9676 Port the OpenBSD glob() security patch
> 9678 Addendum to #9676: some missing changes from OpenBSD glob.c
[.. a few dozens lines snipped ...]
> 13149 Integrate #13147 from mainline (fixes nit in #10091)
> 13261 Integrate #8340,#13260 from mainline
But most likely it's unrelated to this issue.
> I would suggest that the documentation
> reflects this somewhere, since users who are just following the
> instructions at
> http://perl.apache.org/docs/2.0/user/install/install.html would get this
> error while trying to compile on solaris 9.
I think this can and should be fixed on the Makefile.PL level, w/o having
any special-case documentation for solaris9 users :) Just help us to
figure out what went wrong...
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html