You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ben Reser <be...@reser.org> on 2003/11/29 19:27:19 UTC

[PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

* subversion/bindings/swig/perl/Makefile.PL
    Use apr-config to detect the proper name for LD_LIBRARY_PATH,
    which may vary on some platforms.

Index: subversion/bindings/swig/perl/Makefile.PL
===================================================================
--- subversion/bindings/swig/perl/Makefile.PL   (revision 7871)
+++ subversion/bindings/swig/perl/Makefile.PL   (working copy)
@@ -11,6 +11,7 @@
 
 my $apr_cflags = `$apr_config --includes`;
 my $apr_ldflags = `$apr_config --cflags --libs`;
+my $shlibpath = `$apr_config --shlib-path-var`;
 
 chomp $apr_cflags;
 chomp $apr_ldflags;
@@ -69,7 +70,7 @@
               (map {"\nsvn_$_.c : ../svn_$_.i ra_plugin.hi
ra_reporter.hi delta_editor.hi\n".
                        "\tswig -c -nopm -perl -I.. -I../../../include
$apr_cflags -module SVN::_".main::perlish($_)." -o svn_$_.c
../svn_$_.i\n"}
               @modules),
-               "\nFULLPERLRUN=LD_LIBRARY_PATH=",join(':',@ldpaths),
+               "\nFULLPERLRUN=$shlibpath=",join(':',@ldpaths),
                " \$(FULLPERL)\n",
              );
 }



-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Chia-liang Kao <cl...@clkao.org>.
I think i'll take the --link-ld out, it's preventing the linked perl
shared module to find apr, for some unknown reasons.

Are you absolutely sure you can't link even for installed libraries
without --link-ld on mac os x? The perl bindings was developed on mac os
X and that Makefile.PL builds things nicely, at least until I sold my
powerbook. :-)

Cheers,
CLK

On Tue, 2003-12-02 at 01:42, Garrett Rooney wrote:
> > I found that with your patch I'm also unable t o run make test :(
> > 
> > turned out the extra --link-ld in apr-config breaks things for some
> > reasons... perhaps libtool already taught libsvn_* about where to load
> > apr.
> 
> Well, that's inconvenient...  I can say for certain that without
> --link-ld it does not even link on Mac OS X.  Anyone have any ideas?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Chia-liang Kao <cl...@clkao.org>.
In summary: arch/auto/SVN/_Core/_Core.so (or .bundle on OS X) is linked
with libsvn_*, which are linked with apr. while garrett is seeing the
message "illegal reference to symbol: _apr_file_open_stderr defined in
indirectly referenced dynamic library /path/to/libapr" when linking
_Core.so without -lapr; however doing so makes freebsd unable to locate
libapr at all, which is bizarre.

As he can't even compile, if it's related to DynaLoader the problem is
on freebsd rather than OS X.

On Fri, 2003-12-05 at 22:02, Rafael Garcia-Suarez wrote:
> (Missed the beginning of the thread)
> What's --link-ld all about on OS X ? In a few words, what's the library
> layout ? (It might be a problem due to swig, in which case I declare
> myself incompetent, but DynaLoader is known to have a few issues on
> OS X with library prelinking and all that stuff)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Rafael Garcia-Suarez <ra...@hexaflux.com>.
Chia-liang Kao wrote:
> > I've only been using them within the source tree, I haven't actually 
> > installed them.  Perhaps that makes a difference.  Anyway, I don't have 
> > time to investigate at the moment, as I'm already late for work...
> 
> so I'll probaby add a quick hack to have --link-ld only for OSX until we
> sort this out.

(Missed the beginning of the thread)
What's --link-ld all about on OS X ? In a few words, what's the library
layout ? (It might be a problem due to swig, in which case I declare
myself incompetent, but DynaLoader is known to have a few issues on
OS X with library prelinking and all that stuff)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Chia-liang Kao <cl...@clkao.org>.
On Fri, 2003-12-05 at 21:37, Garrett Rooney wrote:
> Interesting.  Does that only happen when the libraries are installed, 
> or does it happen when you try to use them from within the source tree 
> (i.e. from 'make test')?

yes, make test or perl -Mblib -MSVN::Core fails too (with or without
those LD_LIBRARY_PATH)

> I've only been using them within the source tree, I haven't actually 
> installed them.  Perhaps that makes a difference.  Anyway, I don't have 
> time to investigate at the moment, as I'm already late for work...

so I'll probaby add a quick hack to have --link-ld only for OSX until we
sort this out.

Cheers,
CLK


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Dec 5, 2003, at 8:31 AM, Chia-liang Kao wrote:

> on both freebsd-current and -stable, I got things compiled with
> --link-ld, but perl -MSVN::Core tells me:
>
> portege# perl -MSVN::Core
> Can't load 
> '/usr/local/lib/perl5/site_perl/5.8.2/mach/auto/SVN/_Core/_Core.so' 
> for module SVN::_Core: Shared object "libapr-0.so.9" not found at 
> /usr/local/lib/perl5/5.8.2/mach/DynaLoader.pm line 229.
>  at /usr/local/lib/perl5/site_perl/5.8.2/mach/SVN/Base.pm line 54
> BEGIN failed--compilation aborted at 
> /usr/local/lib/perl5/site_perl/5.8.2/mach/SVN/Core.pm line 2.
> Compilation failed in require.
> BEGIN failed--compilation aborted.

Interesting.  Does that only happen when the libraries are installed, 
or does it happen when you try to use them from within the source tree 
(i.e. from 'make test')?

I've only been using them within the source tree, I haven't actually 
installed them.  Perhaps that makes a difference.  Anyway, I don't have 
time to investigate at the moment, as I'm already late for work...

-garrett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Chia-liang Kao <cl...@clkao.org>.
on both freebsd-current and -stable, I got things compiled with
--link-ld, but perl -MSVN::Core tells me:

portege# perl -MSVN::Core
Can't load '/usr/local/lib/perl5/site_perl/5.8.2/mach/auto/SVN/_Core/_Core.so' for module SVN::_Core: Shared object "libapr-0.so.9" not found at /usr/local/lib/perl5/5.8.2/mach/DynaLoader.pm line 229.
 at /usr/local/lib/perl5/site_perl/5.8.2/mach/SVN/Base.pm line 54
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.8.2/mach/SVN/Core.pm line 2.
Compilation failed in require.
BEGIN failed--compilation aborted.

On Fri, 2003-12-05 at 21:05, Garrett Rooney wrote:
> So we need to --link-ld to tell it where to pick up libapr-1.dylib.  
> What are the results when you try this on the system you're using?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Dec 5, 2003, at 4:49 AM, Chia-liang Kao wrote:

> what would this message mean? I'm trying to get access to my old
> powerbook remotely to test these...

I have no idea if I'm right, but I suspect it means that for bundles on 
OS X (i.e. dynamically loadable modules like a perl module) you can't 
reference one library that dynamically references another and expect it 
to work.  We reference libsvn_whatever, which references 
libapr-whatever, and as soon as it hits a symbol in libapr-whatever it 
blows up.  Adding --link-ld means that we get the following output from 
apr-config:

$ apr-config --cflags --link-ld --libs
  -g -O2 -L/Users/rooneg/Hacking/prefix/lib -lapr-1 -lpthread

Without --link-ld we get this:

$ apr-config --cflags --libs
  -g -O2 -lpthread

So we need to --link-ld to tell it where to pick up libapr-1.dylib.  
What are the results when you try this on the system you're using?

-garrett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Chia-liang Kao <cl...@clkao.org>.
what would this message mean? I'm trying to get access to my old
powerbook remotely to test these...

On Fri, 2003-12-05 at 09:56, Garrett Rooney wrote:
> ld: core.o illegal reference to symbol: _apr_file_open_stderr defined 
> in indirectly referenced dynamic library 
> /Users/rooneg/Hacking/prefix/lib/libapr-1.0.dylib
> make: *** [blib/arch/auto/SVN/_Core/_Core.bundle] Error 1
> [rooneg@CommandLine:~/Hacking/svn/subversion/bindings/swig/perl ] exit


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Dec 4, 2003, at 8:22 PM, Ben Reser wrote:

> On Mon, Dec 01, 2003 at 12:42:47PM -0500, Garrett Rooney wrote:
>> Well, that's inconvenient...  I can say for certain that without
>> --link-ld it does not even link on Mac OS X.  Anyone have any ideas?
>
> Can you send me the full output of the build on OS X that doesn't work.
> Also are you using the included neon and apr source or are you using
> system installed ones?  I'm wondering if this is the difference between
> what clkao is seeing and what you are seeing.

I'm using installed versions of APR and Neon.

Here's the output of the build without the --link-ld.

-garrett

[rooneg@CommandLine:~/Hacking/svn/subversion/bindings/swig/perl ] perl 
Makefile.PL
Writing Makefile for SVN::_Core
Writing Makefile.client for SVN::_Client
Writing Makefile.delta for SVN::_Delta
Writing Makefile.fs for SVN::_Fs
Writing Makefile.ra for SVN::_Ra
Writing Makefile.repos for SVN::_Repos
Writing Makefile.wc for SVN::_Wc
[rooneg@CommandLine:~/Hacking/svn/subversion/bindings/swig/perl ] make
cp Core.pm blib/lib/SVN/Core.pm
cp Base.pm blib/lib/SVN/Base.pm
cp Wc.pm blib/lib/SVN/Wc.pm
cp Delta.pm blib/lib/SVN/Delta.pm
cp Repos.pm blib/lib/SVN/Repos.pm
cp Ra.pm blib/lib/SVN/Ra.pm
cp Client.pm blib/lib/SVN/Client.pm
cp Fs.pm blib/lib/SVN/Fs.pm
swig -c -nopm -perl -I.. -I../../../include  
-I/Users/rooneg/Hacking/prefix/include/apr-1  -module SVN::_Core -o 
core.c ../core.i
../../../include/svn_props.h:282: Warning(305): Bad constant value 
(ignored).
cc -c   -I/Users/rooneg/Hacking/prefix/include/apr-1   -g -pipe -pipe 
-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing 
-I/usr/local/include  
-I/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE   -I.. 
-I../../../include -g -Os   -DVERSION=\"\" -DXS_VERSION=\"\"  
"-I/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE"   core.c
core.c: In function `_wrap_svn_config_get_bool':
core.c:6212: warning: assignment from incompatible pointer type
core.c: In function `_wrap_svn_io_dir_empty':
core.c:6836: warning: assignment from incompatible pointer type
core.c: In function `_wrap_svn_io_is_file_executable':
core.c:6897: warning: assignment from incompatible pointer type
core.c: In function `_wrap_svn_io_file_checksum':
core.c:7043: warning: passing arg 3 of `Perl_sv_setpv' makes pointer 
from integer without a cast
core.c: In function `_wrap_svn_io_files_contents_same_p':
core.c:7070: warning: assignment from incompatible pointer type
core.c: In function `_wrap_svn_stream_readline':
core.c:7856: warning: assignment from incompatible pointer type
Running Mkbootstrap for SVN::_Core ()
chmod 644 _Core.bs
rm -f blib/arch/auto/SVN/_Core/_Core.bundle
LD_RUN_PATH="" env MACOSX_DEPLOYMENT_TARGET=10.3 cc  -bundle -undefined 
dynamic_lookup -L/usr/local/lib core.o -g -O2 -lpthread -L../.libs 
-L../../../libsvn_client/.libs -L../../../libsvn_delta/.libs 
-L../../../libsvn_fs/.libs -L../../../libsvn_ra/.libs 
-L../../../libsvn_repos/.libs -L../../../libsvn_wc/.libs 
-L../../../libsvn_diff/.libs -L../../../libsvn_subr/.libs 
-lsvn_client-1 -lsvn_delta-1 -lsvn_fs-1 -lsvn_ra-1 -lsvn_repos-1 
-lsvn_wc-1 -lsvn_diff-1 -lsvn_subr-1 -lsvn_swig_perl-1 
-L/Users/rooneg/Hacking/prefix/lib -lswigpl -o 
blib/arch/auto/SVN/_Core/_Core.bundle
ld: warning -L: directory name (/usr/local/lib) does not exist
ld: core.o illegal reference to symbol: _apr_file_open_stderr defined 
in indirectly referenced dynamic library 
/Users/rooneg/Hacking/prefix/lib/libapr-1.0.dylib
make: *** [blib/arch/auto/SVN/_Core/_Core.bundle] Error 1
[rooneg@CommandLine:~/Hacking/svn/subversion/bindings/swig/perl ] exit

Script done on Thu Dec  4 20:54:35 2003


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Ben Reser <be...@reser.org>.
On Mon, Dec 01, 2003 at 12:42:47PM -0500, Garrett Rooney wrote:
> Well, that's inconvenient...  I can say for certain that without
> --link-ld it does not even link on Mac OS X.  Anyone have any ideas?

Can you send me the full output of the build on OS X that doesn't work.
Also are you using the included neon and apr source or are you using
system installed ones?  I'm wondering if this is the difference between
what clkao is seeing and what you are seeing.

-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
Chia-Liang Kao wrote:

> I found that with your patch I'm also unable t o run make test :(
> 
> turned out the extra --link-ld in apr-config breaks things for some
> reasons... perhaps libtool already taught libsvn_* about where to load
> apr.

Well, that's inconvenient...  I can say for certain that without
--link-ld it does not even link on Mac OS X.  Anyone have any ideas?

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Dec 1, 2003, at 12:49 AM, Chia-liang Kao wrote:

> Garrett,
>
> Sorry that I was away for a few days. Actually the original
> modification to Makefile.PL is trying to avoid -L/usr/local/lib from
> the beginning of ldflags so the shared library will link in-tree
> libraries rather than the installed ones. I'll take a look later.

Well, my local tree isn't installing into /usr/local/lib, it installs 
into a private directory tree in my home directory, and the issue is 
still occuring.  I suspect libtool weirdness or something.

Thanks for looking into it though.

-garrett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Chia-liang Kao <cl...@clkao.org>.
Garrett,

Sorry that I was away for a few days. Actually the original
modification to Makefile.PL is trying to avoid -L/usr/local/lib from
the beginning of ldflags so the shared library will link in-tree
libraries rather than the installed ones. I'll take a look later.

Cheers,
CLK

On Sun, 2003-11-30 at 08:19, Garrett Rooney wrote:
> > Errr use this patch instead.  Forgot to chomp the variable so it didn't
> > work.
> 
> I just committed something similar in revision 7878.  Unfortunately, 
> while it seems like it should work (and certainly doesn't hurt 
> anything), it doesn't let us use the perl bindings on OS X without 
> having Subversion installed already.  For some reason it still looks 
> for some libs in their installed locations no matter what.  If anyone 
> understands why this might be happening, I'd love to know.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Nov 29, 2003, at 2:30 PM, Ben Reser wrote:

> On Sat, Nov 29, 2003 at 11:27:19AM -0800, Ben Reser wrote:
>> * subversion/bindings/swig/perl/Makefile.PL
>>     Use apr-config to detect the proper name for LD_LIBRARY_PATH,
>>     which may vary on some platforms.
>>
>
> Errr use this patch instead.  Forgot to chomp the variable so it didn't
> work.

I just committed something similar in revision 7878.  Unfortunately, 
while it seems like it should work (and certainly doesn't hurt 
anything), it doesn't let us use the perl bindings on OS X without 
having Subversion installed already.  For some reason it still looks 
for some libs in their installed locations no matter what.  If anyone 
understands why this might be happening, I'd love to know.

-garrett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect the proper shell variable to set to give path to shared libraries in Makefile.PL

Posted by Ben Reser <be...@reser.org>.
On Sat, Nov 29, 2003 at 11:27:19AM -0800, Ben Reser wrote:
> * subversion/bindings/swig/perl/Makefile.PL
>     Use apr-config to detect the proper name for LD_LIBRARY_PATH,
>     which may vary on some platforms.
> 

Errr use this patch instead.  Forgot to chomp the variable so it didn't
work.

Index: subversion/bindings/swig/perl/Makefile.PL
===================================================================
--- subversion/bindings/swig/perl/Makefile.PL   (revision 7871)
+++ subversion/bindings/swig/perl/Makefile.PL   (working copy)
@@ -11,6 +11,8 @@
 
 my $apr_cflags = `$apr_config --includes`;
 my $apr_ldflags = `$apr_config --cflags --libs`;
+my $shlibpath = `$apr_config --shlib-path-var`;
+chomp $shlibpath;
 
 chomp $apr_cflags;
 chomp $apr_ldflags;
@@ -69,7 +71,7 @@
               (map {"\nsvn_$_.c : ../svn_$_.i ra_plugin.hi
ra_reporter.hi delta_editor.hi\n".
                        "\tswig -c -nopm -perl -I.. -I../../../include
$apr_cflags -module SVN::_".main::perlish($_)." -o svn_$_.c
../svn_$_.i\n"}
               @modules),
-               "\nFULLPERLRUN=LD_LIBRARY_PATH=",join(':',@ldpaths),
+               "\nFULLPERLRUN=$shlibpath=",join(':',@ldpaths),
                " \$(FULLPERL)\n",
              );
 }


-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org