You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Brad Lanam <bl...@gentoo.com> on 2003/12/24 21:41:09 UTC

[mp2] apr-ext/uuid.t fails on solaris

1. Problem Description:

    apr-ext/uuid.t fails to run on Solaris x86.

    apr-ext/uuid....Can't load
    '/export/home/sadm/Work/mod_perl-1.99_12/t/../blib/arch/Apache2/auto/APR/APR.so'
    for module APR: ld.so.1: /usr/local/bin/perl: fatal: libapr-0.so.0: open
    failed: No such file or directory at
    /usr/local/lib/perl5/5.8.2/i86pc-solaris-thread-multi/DynaLoader.pm line
    229. at apr-ext/uuid.t line 25
    Compilation failed in require at apr-ext/uuid.t line 25.
    1..3
    # Running under perl version 5.008002 for solaris
    # Current time local: Wed Dec 24 12:15:07 2003
    # Current time GMT:   Wed Dec 24 20:15:07 2003
    # Using Test.pm version 1.24
    dubious
    	Test returned status 255 (wstat 65280, 0xff00)
    DIED. FAILED tests 1-3
    	Failed 3/3 tests, 0.00% okay
    Failed Test    Stat Wstat Total Fail  Failed  List of Failed
    -------------------------------------------------------------------------------
    apr-ext/uuid.t  255 65280     3    6 200.00%  1-3
    *** server localhost:8529 shutdown
    !!! error running tests (please examine t/logs/error_log)
    +--------------------------------------------------------+
    | Please file a bug report: http://perl.apache.org/bugs/ |
    +--------------------------------------------------------+
    *** Error code 1
    make: Fatal error: Command failed for target `run_tests'

ldd `find . -name 'APR.so' -print`
        libapr-0.so.0 =>         (file not found)
        libsendfile.so.1 =>      /usr/lib/libsendfile.so.1
        librt.so.1 =>    /usr/lib/librt.so.1
        libm.so.1 =>     /usr/lib/libm.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libpthread.so.1 =>       /usr/lib/libpthread.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libaprutil-0.so.0 =>     (file not found)
        libexpat.so.0 =>         /usr/local/lib/libexpat.so.0
        libc.so.1 =>     /usr/lib/libc.so.1
        libaio.so.1 =>   /usr/lib/libaio.so.1
        libmd5.so.1 =>   /usr/lib/libmd5.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        libthread.so.1 =>        /usr/lib/libthread.so.1

2. Used Components and their Configuration:

*** mod_perl version 1.9912

*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_APXS         => /export/apache2_dev/bin/apxs
  MP_CCOPTS       => -DMP_IOBUFSIZE=32768
  MP_COMPAT_1X    =>
  MP_GENERATE_XS  => 1
  MP_INST_APACHE2 => 1
  MP_LIBNAME      => mod_perl
  MP_USE_DSO      => 1
  MP_USE_STATIC   => 1


*** /export/apache2_dev/bin/httpd -V
Server version: Apache/2.0.48
Server built:   Dec 24 2003 11:01:19
Server's Module Magic Number: 20020903:4
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/worker"
 -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="/export/apache2_dev"
 -D SUEXEC_BIN="/export/apache2_dev/bin/suexec"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"


*** /usr/local/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
  Platform:
    osname=solaris, osvers=2.9, archname=i86pc-solaris-thread-multi
    uname='sunos www 5.9 generic_112234-08 i86pc i386 i86pc '
    config_args='-Dcc=cc -Dprefix=/usr/local -Dccflags=-xO3 -I/usr/local/include -Dldflags=-xO3 -L/usr/local/lib -R/usr/local/lib  -d -s -e -O -Dusethreads -Duseperlio -Uinstallusrbinperl -Ubincompat5005 -Uusesfio -Duseshrplib'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -xO3 -I/usr/local/include -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-D_REENTRANT -xO3 -I/usr/local/include -I/usr/local/include'
    ccversion='Sun C 5.5 2003/03/12', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-xO3 -L/usr/local/lib -R/usr/local/lib  -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib '
    libpth=/usr/lib /usr/ccs/lib /opt/SUNWspro/prod/lib /usr/local/lib
    libs=-lsocket -lnsl -ldb -ldl -lm -lpthread -lc
    perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc
    libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -R /usr/local/lib/perl5/5.8.2/i86pc-solaris-thread-multi/CORE'
    cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib -R/usr/local/lib -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Built under solaris
  Compiled at Nov 26 2003 15:48:01
  %ENV:
    PERL_LWP_USE_HTTP_10="1"
  @INC:
    /usr/local/lib/perl5/5.8.2/i86pc-solaris-thread-multi
    /usr/local/lib/perl5/5.8.2
    /usr/local/lib/perl5/site_perl/5.8.2/i86pc-solaris-thread-multi
    /usr/local/lib/perl5/site_perl/5.8.2
    /usr/local/lib/perl5/site_perl/5.8.0
    /usr/local/lib/perl5/site_perl
    .

*** Packages of interest status:

Apache::Request: -
CGI            : 3.01
LWP            : 5.76
mod_perl       : 1.28

--
   -- Brad Lanam      bll@gentoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Stas Bekman <st...@stason.org>.
Brad Lanam wrote:
> On Fri, Jan 02, 2004 at 03:50:11PM -0800, Stas Bekman wrote:
> 
>>What's the mnemonic for $tflags?
> 
> 
>     temp flags.
>     s/tflags/newlddlflags/g

OK, Thanks.

>>does this work?
> 
> 
>     Yes.  Makefile is correct.  APR.so is linked correctly.

Perfect. Now committed (with extra comments). Thanks a lot for you help, Brad.

__________________________________________________________________
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Brad Lanam <bl...@gentoo.com>.
On Fri, Jan 02, 2004 at 03:50:11PM -0800, Stas Bekman wrote:
> What's the mnemonic for $tflags?

    temp flags.
    s/tflags/newlddlflags/g

> does this work?

    Yes.  Makefile is correct.  APR.so is linked correctly.

    -- Brad

LD_RUN_PATH="/export/apache2_dev/lib:/usr/lib" cc
-L/export/apache2_dev/lib -R/export/apache2_dev/lib
-L/export/apache2_dev/lib -R/export/apache2_dev/lib -G -L/usr/local/lib
-R/usr/local/lib -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib APR.o
-xO3 -L/usr/local/lib -R/usr/local/lib -L/usr/lib -L/usr/ccs/lib
-L/opt/SUNWspro/prod/lib -o ../../../blib/arch/Apache2/auto/APR/APR.so
-L/export/apache2_dev/lib -lapr-0 -lsendfile -lrt -lm -lsocket -lnsl
-lresolv -lpthread -ldl -L/export/apache2_dev/lib -laprutil-0 -lexpat

--
   -- Brad Lanam      bll@gentoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Stas Bekman <st...@stason.org>.
Brad Lanam wrote:
> On Fri, Jan 02, 2004 at 02:21:13PM -0800, Stas Bekman wrote:
> 
>>How about the following trickery. It arranges that LDDFLAGS will come after
>>LIBS, making sure that apache's -Rpath will come in first. This is untested.
> 
> 
>     No.  I don't think that's a good idea.
>     LDDLFLAGS has a bunch of -L args, and those have to appear
>     before the libraries.
> 
>     This patch works:

good, a few comments:

> +if (SOLARIS) {
> +    # make sure that all -L, -R from libs are moved
> +    # to lddflags.
> +    my $tflags = $libs;

What's the mnemonic for $tflags?

> +    $tflags =~ s{-[^LR]\S+}{}g;

So you want $tflags to contain only /-[LR]\S+/g. Which means that a different 
pattern is needed. How about:

my $tflags = join " ", $libs =~ /(-[LR]\S+)/g;

> +    # -R makes sure that these paths will be used
> +    $tflags =~ s{-L(\S+)}{-L$1 -R$1}g;
> +    $args{LDDLFLAGS} = $tflags . $build->perl_config('lddlflags');

$args{LDDLFLAGS} = $tflags . " " . $build->perl_config('lddlflags');

does this work?

Index: xs/APR/APR/Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v
retrieving revision 1.18
diff -u -r1.18 Makefile.PL
--- xs/APR/APR/Makefile.PL      5 Nov 2003 08:29:17 -0000       1.18
+++ xs/APR/APR/Makefile.PL      2 Jan 2004 23:38:26 -0000
@@ -6,10 +6,18 @@
  use Apache::Build ();
  use Config;

-use constant WIN32 => Apache::Build::WIN32;
+use constant WIN32   => Apache::Build::WIN32;
+use constant SOLARIS => $^O eq 'solaris';
+
+my %args = (
+    'NAME'         => 'APR',
+    'VERSION_FROM' => 'APR.pm',
+);

  my $libs = '';
-if (my $apr_bindir = ModPerl::BuildMM::build_config()->apr_bindir()) {
+my $build = ModPerl::BuildMM::build_config();
+
+if (my $apr_bindir = $build->apr_bindir()) {

      # XXX: this works only with libapr 0.9.2+
      my $ext = WIN32 ? '.bat' : '';
@@ -24,8 +32,19 @@
      $libs =~ s{(\w+)\.lib}{-l$1}g;
  }

-ModPerl::BuildMM::WriteMakefile(
-    'NAME'        => 'APR',
-    'VERSION_FROM' => 'APR.pm',
-    'LIBS'         => [$libs],
-);
+if (SOLARIS && $libs) {
+    # make sure that all -L, -R from libs are moved
+    # to the beginning of lddflags.
+    my $tflags = join " ", $libs =~ /(-[LR]\S+)/g;
+
+    # -R makes sure that these paths will be used
+    $tflags =~ s{-L(\S+)}{-L$1 -R$1}g;
+    $args{LDDLFLAGS} = $tflags . " " . $build->perl_config('lddlflags');
+
+    # leave -L in libs -- MakeMaker needs it.
+    $libs =~ s{-R\S+}{}g;
+}
+
+$args{LIBS} = [$libs] if $libs;
+
+ModPerl::BuildMM::WriteMakefile(%args);

__________________________________________________________________
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Brad Lanam <bl...@gentoo.com>.
On Fri, Jan 02, 2004 at 02:21:13PM -0800, Stas Bekman wrote:
> How about the following trickery. It arranges that LDDFLAGS will come after
> LIBS, making sure that apache's -Rpath will come in first. This is untested.

    No.  I don't think that's a good idea.
    LDDLFLAGS has a bunch of -L args, and those have to appear
    before the libraries.

    This patch works:

    -- Brad

--- x/xs/APR/APR/Makefile.PL	Wed Nov  5 00:29:17 2003
+++ mod_perl-1.99_12/xs/APR/APR/Makefile.PL	Fri Jan  2 14:33:31 2004
@@ -7,9 +7,16 @@
 use Config;

 use constant WIN32 => Apache::Build::WIN32;
+use constant SOLARIS => $^O eq 'solaris';

+my %args = (
+    'NAME'        => 'APR',
+    'VERSION_FROM' => 'APR.pm',
+);
+
 my $libs = '';
-if (my $apr_bindir = ModPerl::BuildMM::build_config()->apr_bindir()) {
+my $build = ModPerl::BuildMM::build_config();
+if (my $apr_bindir = $build->apr_bindir()) {

     # XXX: this works only with libapr 0.9.2+
     my $ext = WIN32 ? '.bat' : '';
@@ -23,9 +30,20 @@
     $libs =~ s{/libpath:}{-L}g;
     $libs =~ s{(\w+)\.lib}{-l$1}g;
 }
+if (SOLARIS) {
+    # make sure that all -L, -R from libs are moved
+    # to lddflags.
+    my $tflags = $libs;
+    $tflags =~ s{-[^LR]\S+}{}g;
+    # -R makes sure that these paths will be used
+    $tflags =~ s{-L(\S+)}{-L$1 -R$1}g;
+    $args{LDDLFLAGS} = $tflags . $build->perl_config('lddlflags');
+    # leave -L in libs -- MakeMaker needs it.
+    $libs =~ s{-R\S+}{}g;
+}

-ModPerl::BuildMM::WriteMakefile(
-    'NAME'	   => 'APR',
-    'VERSION_FROM' => 'APR.pm',
-    'LIBS'         => [$libs],
-);
+$args{LIBS} = [$libs] if $libs;
+
+ModPerl::BuildMM::WriteMakefile(%args);

--
   -- Brad Lanam      bll@gentoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Stas Bekman <st...@stason.org>.
Brad Lanam wrote:
> On Fri, Jan 02, 2004 at 12:53:18PM -0800, Stas Bekman wrote:
> 
>>Before we try to fix EU::MakeMaker, how about this workaround patch?
> 
> 
>     Your patch works.
> 
> www:sadm$ ldd `find . -name 'APR.so'`
>     libapr-0.so.0 =>         /export/apache2_dev/lib/libapr-0.so.0
>     [...]
>     libaprutil-0.so.0 =>     /export/apache2_dev/lib/libaprutil-0.so.0
>     libexpat.so.0 =>         /usr/local/lib/libexpat.so.0
>     [...]
> 
>     I'm picking up my expat library rather than Apache's.
>     This could be a potential problem for some people.
> 
>     This happens because LDDLFLAGS is in the command line
>     before LIBS, and -R/usr/local/lib is first in the run
>     time search path.
> 
>     Now that I know what the problems are and what's causing
>     them, I can work around the various issues.
> 
>     I think in the long term, to handle multiple Apache installations
>     on the same machine, you will need to address the issue
>     of which set of Apache libraries mod_perl uses.  Ideally, it
>     should use the same libraries the apache daemon is using, so
>     you'll either have to set the LD_LIBRARY_PATH/LD_RUN_PATH
>     environment variable at startup, or dynamically load them
>     like perl does.

How about the following trickery. It arranges that LDDFLAGS will come after 
LIBS, making sure that apache's -Rpath will come in first. This is untested.

Index: xs/APR/APR/Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v
retrieving revision 1.18
diff -u -r1.18 Makefile.PL
--- xs/APR/APR/Makefile.PL      5 Nov 2003 08:29:17 -0000       1.18
+++ xs/APR/APR/Makefile.PL      2 Jan 2004 22:08:07 -0000
@@ -6,10 +6,18 @@
  use Apache::Build ();
  use Config;

-use constant WIN32 => Apache::Build::WIN32;
+use constant WIN32   => Apache::Build::WIN32;
+use constant SOLARIS => $^O eq 'solaris';
+
+my %args = (
+    'NAME'        => 'APR',
+    'VERSION_FROM' => 'APR.pm',
+);

  my $libs = '';
-if (my $apr_bindir = ModPerl::BuildMM::build_config()->apr_bindir()) {
+my $build = ModPerl::BuildMM::build_config();
+
+if (my $apr_bindir = $build->apr_bindir()) {

      # XXX: this works only with libapr 0.9.2+
      my $ext = WIN32 ? '.bat' : '';
@@ -24,8 +32,16 @@
      $libs =~ s{(\w+)\.lib}{-l$1}g;
  }

-ModPerl::BuildMM::WriteMakefile(
-    'NAME'        => 'APR',
-    'VERSION_FROM' => 'APR.pm',
-    'LIBS'         => [$libs],
-);
+if (SOLARIS && $libs) {
+    # -R makes sure that these paths will be used
+    $libs =~ s{-L(\S+)}{-L$1 -R$1}g;
+    # make sure that perl lddflags will come after libs from apache,
+    # so that -R paths from apache will come in first
+    my $lddflags = $build->perl_config('lddlflags');
+    $libs .= " $lddflags";
+    $args{LDDLFLAGS} = ''; # so that MM won't re-add LDDFLAGS
+}
+
+$args{LIBS} = [$libs] if $libs;
+
+ModPerl::BuildMM::WriteMakefile(%args);


__________________________________________________________________
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Brad Lanam <bl...@gentoo.com>.
On Fri, Jan 02, 2004 at 12:53:18PM -0800, Stas Bekman wrote:
> Before we try to fix EU::MakeMaker, how about this workaround patch?

    Your patch works.

www:sadm$ ldd `find . -name 'APR.so'`
    libapr-0.so.0 =>         /export/apache2_dev/lib/libapr-0.so.0
    [...]
    libaprutil-0.so.0 =>     /export/apache2_dev/lib/libaprutil-0.so.0
    libexpat.so.0 =>         /usr/local/lib/libexpat.so.0
    [...]

    I'm picking up my expat library rather than Apache's.
    This could be a potential problem for some people.

    This happens because LDDLFLAGS is in the command line
    before LIBS, and -R/usr/local/lib is first in the run
    time search path.

    Now that I know what the problems are and what's causing
    them, I can work around the various issues.

    I think in the long term, to handle multiple Apache installations
    on the same machine, you will need to address the issue
    of which set of Apache libraries mod_perl uses.  Ideally, it
    should use the same libraries the apache daemon is using, so
    you'll either have to set the LD_LIBRARY_PATH/LD_RUN_PATH
    environment variable at startup, or dynamically load them
    like perl does.

    -- Brad

--
   -- Brad Lanam      bll@gentoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Stas Bekman <st...@stason.org>.
Brad Lanam wrote:
> On Thu, Jan 01, 2004 at 06:34:49PM -0800, Stas Bekman wrote:
> 
>>So why doesn't it do the same for perl's ldflags? Your have:
>>
>>ldflags ='-xO3 -L/usr/local/lib -R/usr/local/lib  -L/usr/lib -L/usr/ccs/lib
>>-L/opt/SUNWspro/prod/lib '
>>
>>why doesn't it push -L/usr/local/lib into LD_RUN_PATH? Is it because we
>>don't supply them in LIBS? It adds them via (on my machine):
>>
>># dynamic_lib => { OTHERLDFLAGS=>q[ -L/usr/local/lib] }
>>
>>I'd guess that your xs/APR/APR/Makefile has:
>>
>># dynamic_lib => { OTHERLDFLAGS=>q[-xO3 -L/usr/local/lib -R/usr/local/lib
>>-L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib ] }
>>or is it in LDDLFLAGS?
>>
>>Can I see the top of xs/APR/APR/Makefile? The section:
>>#   MakeMaker Parameters:
> 
> 
> 
> #   MakeMaker Parameters:
> 
> #     CCFLAGS => q[ -D_REENTRANT -xO3 -I/usr/local/include -I/usr/local/include -DMOD_PERL -DMP_IOBUFSIZE=32768]
> #     INC => q[-I/export/home/sadm/Work/mod_perl-1.99_12/src/modules/perl -I/export/home/sadm/Work/mod_perl-1.99_12/xs -I/export/apache2_dev/include -I/export/apache2_dev/include]
> #     LDDLFLAGS => q[-G -L/usr/local/lib -R/usr/local/lib -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib]
> #     LIBS => [q[-L/export/apache2_dev/lib -lapr-0 -lsendfile -lrt -lm -lsocket -lnsl -lresolv  -lpthread -ldl  -L/export/apache2_dev/lib -laprutil-0 -lexpat]]
> #     NAME => q[APR]
> #     OPTIMIZE => q[-O]
> #     TYPEMAPS => [q[/export/home/sadm/Work/mod_perl-1.99_12/xs/typemap]]
> #     VERSION_FROM => q[APR.pm]
> #     clean => { FILES=>q[ glue_pods] }
> #     dynamic_lib => { OTHERLDFLAGS=>q[-xO3 -L/usr/local/lib -R/usr/local/lib  -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib ] }

Thanks Brad,

So if I understand it correctly we care about these two entries:

#     LDDLFLAGS => q[-G -L/usr/local/lib -R/usr/local/lib -L/usr/lib 
-L/usr/ccs/lib -L/opt/SUNWspro/prod/lib]
#     LIBS => [q[-L/export/apache2_dev/lib -lapr-0 -lsendfile -lrt -lm 
-lsocket -lnsl -lresolv  -lpthread -ldl  -L/export/apache2_dev/lib -laprutil-0 
-lexpat]]

and the runtime:

LD_RUN_PATH="/export/apache2_dev/lib:/usr/lib" cc  -G -L/usr/local/lib 
-R/usr/local/lib -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib APR.o -xO3 
-L/usr/local/lib -R/usr/local/lib  -L/usr/lib -L/usr/ccs/lib 
-L/opt/SUNWspro/prod/lib -o ../../../blib/arch/Apache2/auto/APR/APR.so 
-L/export/apache2_dev/lib -lapr-0 -lsendfile -lrt -lm -lsocket -lnsl -lresolv 
-lpthread -ldl -L/export/apache2_dev/lib -laprutil-0 -lexpat

ExtUtils::MakeMaker needs to either look in LDDFLAGS and move -R/usr/local/lib 
into LD_RUN_PATH (making sure that no -R is left), or not use
LD_RUN_PATH at all and get those paths into -R flags:

LD_RUN_PATH="/export/apache2_dev/lib:/usr/lib"
=> -R/export/apache2_dev/lib -R/usr/lib?

Before we try to fix EU::MakeMaker, how about this workaround patch?

Index: xs/APR/APR/Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v
retrieving revision 1.18
diff -u -r1.18 Makefile.PL
--- xs/APR/APR/Makefile.PL      5 Nov 2003 08:29:17 -0000       1.18
+++ xs/APR/APR/Makefile.PL      2 Jan 2004 20:41:20 -0000
@@ -6,7 +6,8 @@
  use Apache::Build ();
  use Config;

-use constant WIN32 => Apache::Build::WIN32;
+use constant WIN32   => Apache::Build::WIN32;
+use constant SOLARIS => $^O eq 'solaris';

  my $libs = '';
  if (my $apr_bindir = ModPerl::BuildMM::build_config()->apr_bindir()) {
@@ -22,6 +23,10 @@
  if (WIN32) {
      $libs =~ s{/libpath:}{-L}g;
      $libs =~ s{(\w+)\.lib}{-l$1}g;
+}
+
+if (SOLARIS) {
+    $libs =~ s{-L(\S+)}{-L$1 -R$1}g;
  }

  ModPerl::BuildMM::WriteMakefile(

__________________________________________________________________
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Brad Lanam <bl...@gentoo.com>.
On Thu, Jan 01, 2004 at 06:34:49PM -0800, Stas Bekman wrote:
> So why doesn't it do the same for perl's ldflags? Your have:
>
> ldflags ='-xO3 -L/usr/local/lib -R/usr/local/lib  -L/usr/lib -L/usr/ccs/lib
> -L/opt/SUNWspro/prod/lib '
>
> why doesn't it push -L/usr/local/lib into LD_RUN_PATH? Is it because we
> don't supply them in LIBS? It adds them via (on my machine):
>
> # dynamic_lib => { OTHERLDFLAGS=>q[ -L/usr/local/lib] }
>
> I'd guess that your xs/APR/APR/Makefile has:
>
> # dynamic_lib => { OTHERLDFLAGS=>q[-xO3 -L/usr/local/lib -R/usr/local/lib
> -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib ] }
> or is it in LDDLFLAGS?
>
> Can I see the top of xs/APR/APR/Makefile? The section:
> #   MakeMaker Parameters:


#   MakeMaker Parameters:

#     CCFLAGS => q[ -D_REENTRANT -xO3 -I/usr/local/include -I/usr/local/include -DMOD_PERL -DMP_IOBUFSIZE=32768]
#     INC => q[-I/export/home/sadm/Work/mod_perl-1.99_12/src/modules/perl -I/export/home/sadm/Work/mod_perl-1.99_12/xs -I/export/apache2_dev/include -I/export/apache2_dev/include]
#     LDDLFLAGS => q[-G -L/usr/local/lib -R/usr/local/lib -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib]
#     LIBS => [q[-L/export/apache2_dev/lib -lapr-0 -lsendfile -lrt -lm -lsocket -lnsl -lresolv  -lpthread -ldl  -L/export/apache2_dev/lib -laprutil-0 -lexpat]]
#     NAME => q[APR]
#     OPTIMIZE => q[-O]
#     TYPEMAPS => [q[/export/home/sadm/Work/mod_perl-1.99_12/xs/typemap]]
#     VERSION_FROM => q[APR.pm]
#     clean => { FILES=>q[ glue_pods] }
#     dynamic_lib => { OTHERLDFLAGS=>q[-xO3 -L/usr/local/lib -R/usr/local/lib  -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib ] }

    -- Brad

--
   -- Brad Lanam      bll@gentoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Stas Bekman <st...@stason.org>.
Brad Lanam wrote:
> On Wed, Dec 31, 2003 at 03:05:17PM -0800, Stas Bekman wrote:
> 
>>No, no, this is not a good solution, since others have the same problem.
>>You should leave perl as is. Who sets
>>LD_RUN_PATH="/export/apache2_dev/lib:/usr/lib"? I can't see us setting this
>>value. Where does it come from? It must be ExtUtils::MakeMaker who does
>>that, but where does it take these values from? especially
>>"/export/apache2_dev/lib". Is it in your environment?
> 
> 
>     Nothing in my environment.
>     Yes, it must be ExtUtils::MakeMaker.
>     The only place LD_RUN_PATH is set is in xs/APR/APR.
> 
>     It must be finding the -L/export/apache2_dev/lib in $libs
>     (which it gets from apr-config) and setting LD_RUN_PATH
>     appropriately (or so it thinks).

So why doesn't it do the same for perl's ldflags? Your have:

ldflags ='-xO3 -L/usr/local/lib -R/usr/local/lib  -L/usr/lib -L/usr/ccs/lib 
-L/opt/SUNWspro/prod/lib '

why doesn't it push -L/usr/local/lib into LD_RUN_PATH? Is it because we don't 
supply them in LIBS? It adds them via (on my machine):

# dynamic_lib => { OTHERLDFLAGS=>q[ -L/usr/local/lib] }

I'd guess that your xs/APR/APR/Makefile has:

# dynamic_lib => { OTHERLDFLAGS=>q[-xO3 -L/usr/local/lib -R/usr/local/lib 
-L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib ] }
or is it in LDDLFLAGS?

Can I see the top of xs/APR/APR/Makefile? The section:
#   MakeMaker Parameters:


__________________________________________________________________
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Brad Lanam <bl...@gentoo.com>.
On Wed, Dec 31, 2003 at 03:05:17PM -0800, Stas Bekman wrote:
> No, no, this is not a good solution, since others have the same problem.
> You should leave perl as is. Who sets
> LD_RUN_PATH="/export/apache2_dev/lib:/usr/lib"? I can't see us setting this
> value. Where does it come from? It must be ExtUtils::MakeMaker who does
> that, but where does it take these values from? especially
> "/export/apache2_dev/lib". Is it in your environment?

    Nothing in my environment.
    Yes, it must be ExtUtils::MakeMaker.
    The only place LD_RUN_PATH is set is in xs/APR/APR.

    It must be finding the -L/export/apache2_dev/lib in $libs
    (which it gets from apr-config) and setting LD_RUN_PATH
    appropriately (or so it thinks).

    -- Brad

--
   -- Brad Lanam      bll@gentoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Stas Bekman <st...@stason.org>.
Brad Lanam wrote:
> On Wed, Dec 31, 2003 at 01:45:42PM -0800, Stas Bekman wrote:
> 
>>i.e. -R hardcodes the path to the libs. And -L is getting completely
>>ignored?
> 
> 
>     -L is the link-time search path.  It's used.
>     -R is the run-time search path.  This is stored in the executable
>        or shared library.
> 
> 
>>Can you please post me the complete build log? I want to see how APR.so was
>>linked. Thanks
> 
> 
> LD_RUN_PATH="/export/apache2_dev/lib:/usr/lib" cc  -G -L/usr/local/lib -R/usr/lo
> cal/lib -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib APR.o -xO3 -L/usr/loc
> al/lib -R/usr/local/lib  -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib -o .
> ./../../blib/arch/Apache2/auto/APR/APR.so   -L/export/apache2_dev/lib -lapr-0 -l
> sendfile -lrt -lm -lsocket -lnsl -lresolv -lpthread -ldl -L/export/apache2_dev/l
> ib -laprutil-0 -lexpat
> 
>     Here's the problem:
> 
>     LD_RUN_PATH is getting overridden by the specified -R path.
>     The -R specified is from the perl config.
> 
>     So either LD_RUN_PATH has to be set up to include all -R values,
>     and the -R(s) removed from the link command line.
> 
>     Or -R has to be added with the appropriate path rather than
>     using LD_RUN_PATH.
> 
>     Or I have to change my perl build to remove any specified -R
>     values, check *all* my perl module builds to make sure they work
>     afterwards.

No, no, this is not a good solution, since others have the same problem. You 
should leave perl as is. Who sets 
LD_RUN_PATH="/export/apache2_dev/lib:/usr/lib"? I can't see us setting this 
value. Where does it come from? It must be ExtUtils::MakeMaker who does that, 
but where does it take these values from? especially 
"/export/apache2_dev/lib". Is it in your environment?


__________________________________________________________________
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Brad Lanam <bl...@gentoo.com>.
On Wed, Dec 31, 2003 at 01:45:42PM -0800, Stas Bekman wrote:
> i.e. -R hardcodes the path to the libs. And -L is getting completely
> ignored?

    -L is the link-time search path.  It's used.
    -R is the run-time search path.  This is stored in the executable
       or shared library.

> Can you please post me the complete build log? I want to see how APR.so was
> linked. Thanks

LD_RUN_PATH="/export/apache2_dev/lib:/usr/lib" cc  -G -L/usr/local/lib -R/usr/lo
cal/lib -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib APR.o -xO3 -L/usr/loc
al/lib -R/usr/local/lib  -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib -o .
./../../blib/arch/Apache2/auto/APR/APR.so   -L/export/apache2_dev/lib -lapr-0 -l
sendfile -lrt -lm -lsocket -lnsl -lresolv -lpthread -ldl -L/export/apache2_dev/l
ib -laprutil-0 -lexpat

    Here's the problem:

    LD_RUN_PATH is getting overridden by the specified -R path.
    The -R specified is from the perl config.

    So either LD_RUN_PATH has to be set up to include all -R values,
    and the -R(s) removed from the link command line.

    Or -R has to be added with the appropriate path rather than
    using LD_RUN_PATH.

    Or I have to change my perl build to remove any specified -R
    values, check *all* my perl module builds to make sure they work
    afterwards.

    -- Brad

--
   -- Brad Lanam      bll@gentoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Stas Bekman <st...@stason.org>.
Brad Lanam wrote:
[...]
> www:sadm$ /export/apache2_dev/bin/apr-config --link-ld
>  -L/export/apache2_dev/lib -lapr-0
> www:sadm$
> 
>     I don't know the Apache developer's intention.
> 
>     If you assume a single Apache installation, it
>     is incorrect for Solaris. It should have
>     '-R/export/apache2_dev/lib' also.
> 
>     If you assume multiple Apache installations, it is
>     correct, as you want to use the appropriate shared
>     library for the Apache install you're working with.
> 
>     If libapr.so and libaprutil.so are identical for any
>     Apache 2 installation on the same machine, then
>     I would not especially care which set of shared
>     libraries mod_perl used, and apr-config would be
>     incorrect, and should include '-R/export/apache2_dev/lib'.

i.e. -R hardcodes the path to the libs. And -L is getting completely ignored?

Let's take this to the apr-dev list.


__________________________________________________________________
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Brad Lanam <bl...@gentoo.com>.
On Wed, Dec 31, 2003 at 01:00:57PM -0800, Stas Bekman wrote:
> Brad Lanam wrote:
> [...]
> >=== apr_libs: -L/export/apache2_dev/lib -lapr-0
> >  -L/export/apache2_dev/lib -laprutil-0
>
> So, that's where they reside? /export/apache2_dev/lib?

    Yes.

> >    I would normally say it needs the -R.../lib for Solaris,
>
> So, isn't it a bug in apr-config then?
>
> % apr-config --link-ld
>
> should give the correct information.

www:sadm$ /export/apache2_dev/bin/apr-config --link-ld
 -L/export/apache2_dev/lib -lapr-0
www:sadm$

    I don't know the Apache developer's intention.

    If you assume a single Apache installation, it
    is incorrect for Solaris. It should have
    '-R/export/apache2_dev/lib' also.

    If you assume multiple Apache installations, it is
    correct, as you want to use the appropriate shared
    library for the Apache install you're working with.

    If libapr.so and libaprutil.so are identical for any
    Apache 2 installation on the same machine, then
    I would not especially care which set of shared
    libraries mod_perl used, and apr-config would be
    incorrect, and should include '-R/export/apache2_dev/lib'.

    -- Brad

--
   -- Brad Lanam      bll@gentoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Stas Bekman <st...@stason.org>.
Brad Lanam wrote:
[...]
> === apr_libs: -L/export/apache2_dev/lib -lapr-0
>   -L/export/apache2_dev/lib -laprutil-0

So, that's where they reside? /export/apache2_dev/lib?

>     I would normally say it needs the -R.../lib for Solaris,

So, isn't it a bug in apr-config then?

% apr-config --link-ld

should give the correct information.

>     but an installation may have multiple apache servers installed,
>     so some magic w/LD_LIBRARY_PATH or LD_RUN_PATH needs to be done.

The linking of APR.so happens in xs/APR/APR/. xs/APR/APR/Makefile.PL repeats 
the same thing get_DEFINE() did, and you can see the resulting linking flags 
in xs/APR/APR/Makefile.

__________________________________________________________________
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Brad Lanam <bl...@gentoo.com>.
On Wed, Dec 31, 2003 at 12:42:56PM -0800, Stas Bekman wrote:
> Brad Lanam wrote:
> >1. Problem Description:
> >
> >    apr-ext/uuid.t fails to run on Solaris x86.
> >
> >    apr-ext/uuid....Can't load
> >    '/export/home/sadm/Work/mod_perl-1.99_12/t/../blib/arch/Apache2/auto/APR/APR.so'
> >    for module APR: ld.so.1: /usr/local/bin/perl: fatal: libapr-0.so.0:
> >    open
> >    failed: No such file or directory at
> >    /usr/local/lib/perl5/5.8.2/i86pc-solaris-thread-multi/DynaLoader.pm
> >    line
> >    229. at apr-ext/uuid.t line 25
> Can you please run:
>
> % grep DMP_HAVE_APR_LIBS Makefile
>
> You probably have 'DEFINE = -DMP_HAVE_APR_LIBS'

    Yes.

> Next, can you please add debug statements to get_DEFINE() in the top level
> Makefile.PL, dumping the value of @apr_libs

=== apr_libs: -L/export/apache2_dev/lib -lapr-0
  -L/export/apache2_dev/lib -laprutil-0

    I would normally say it needs the -R.../lib for Solaris,
    but an installation may have multiple apache servers installed,
    so some magic w/LD_LIBRARY_PATH or LD_RUN_PATH needs to be done.

    -- Brad

--
   -- Brad Lanam      bll@gentoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] apr-ext/uuid.t fails on solaris

Posted by Stas Bekman <st...@stason.org>.
[joining two identical reports in one]

Brad Lanam wrote:
> 1. Problem Description:
> 
>     apr-ext/uuid.t fails to run on Solaris x86.
> 
>     apr-ext/uuid....Can't load
>     '/export/home/sadm/Work/mod_perl-1.99_12/t/../blib/arch/Apache2/auto/APR/APR.so'
>     for module APR: ld.so.1: /usr/local/bin/perl: fatal: libapr-0.so.0: open
>     failed: No such file or directory at
>     /usr/local/lib/perl5/5.8.2/i86pc-solaris-thread-multi/DynaLoader.pm line
>     229. at apr-ext/uuid.t line 25
>     Compilation failed in require at apr-ext/uuid.t line 25.
>     1..3
>     # Running under perl version 5.008002 for solaris
>     # Current time local: Wed Dec 24 12:15:07 2003
>     # Current time GMT:   Wed Dec 24 20:15:07 2003
>     # Using Test.pm version 1.24
>     dubious
>     	Test returned status 255 (wstat 65280, 0xff00)
>     DIED. FAILED tests 1-3
>     	Failed 3/3 tests, 0.00% okay
>     Failed Test    Stat Wstat Total Fail  Failed  List of Failed
>     -------------------------------------------------------------------------------
>     apr-ext/uuid.t  255 65280     3    6 200.00%  1-3
>     *** server localhost:8529 shutdown
>     !!! error running tests (please examine t/logs/error_log)
>     +--------------------------------------------------------+
>     | Please file a bug report: http://perl.apache.org/bugs/ |
>     +--------------------------------------------------------+
>     *** Error code 1
>     make: Fatal error: Command failed for target `run_tests'
> 
> ldd `find . -name 'APR.so' -print`
>         libapr-0.so.0 =>         (file not found)
>         libsendfile.so.1 =>      /usr/lib/libsendfile.so.1
>         librt.so.1 =>    /usr/lib/librt.so.1
>         libm.so.1 =>     /usr/lib/libm.so.1
>         libsocket.so.1 =>        /usr/lib/libsocket.so.1
>         libnsl.so.1 =>   /usr/lib/libnsl.so.1
>         libresolv.so.2 =>        /usr/lib/libresolv.so.2
>         libpthread.so.1 =>       /usr/lib/libpthread.so.1
>         libdl.so.1 =>    /usr/lib/libdl.so.1
>         libaprutil-0.so.0 =>     (file not found)
>         libexpat.so.0 =>         /usr/local/lib/libexpat.so.0
>         libc.so.1 =>     /usr/lib/libc.so.1
>         libaio.so.1 =>   /usr/lib/libaio.so.1
>         libmd5.so.1 =>   /usr/lib/libmd5.so.1
>         libmp.so.2 =>    /usr/lib/libmp.so.2
>         libthread.so.1 =>        /usr/lib/libthread.so.1

Can you please run:

% grep DMP_HAVE_APR_LIBS Makefile

You probably have 'DEFINE = -DMP_HAVE_APR_LIBS'

Next, can you please add debug statements to get_DEFINE() in the top level 
Makefile.PL, dumping the value of @apr_libs

__________________________________________________________________
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org