[PD] imagemagick --enable shared

sara kolster sara at x-i.net
Thu Dec 18 12:04:27 CET 2003


Hi,

I already contacted rob about this, but he didn't have this problem..

>> Dynamic linker is unable to find GCC libraries
>>
>> This problem manifests itself by programs not finding shared 
>> libraries they depend on when the programs are started. Note this 
>> problem often manifests itself with failures in the libio/libstdc++ 
>> tests after configuring with |--enable-shared| and building GCC
>
>
> so, they basically, "hum, this problem happens, that's interesting",
> but don't they give a way to fix it ??


Now they kind of do give some solution, but with the feeling: 'you could 
do it, but you'd better don't, plus the fact that i've no idea which 
'option' and how execute.  The explanation below sound rather vague to me.

This is the full faq-problem:

*Dynamic linker is unable to find GCC libraries*

This problem manifests itself by programs not finding shared libraries 
they depend on when the programs are started. Note this problem often 
manifests itself with failures in the libio/libstdc++ tests after 
configuring with --enable-shared and building GCC.

GCC does not specify a runpath so that the dynamic linker can find 
dynamic libraries at runtime.

The short explanation is that if you always pass a -R option to the 
linker, then your programs become dependent on directories which may be 
NFS mounted, and programs may hang unnecessarily when an NFS server goes 
down.

The problem is not programs that do require the directories; those 
programs are going to hang no matter what you do. The problem is 
programs that do not require the directories.

SunOS effectively always passed a -R option for every -L option; this 
was a bad idea, and so it was removed for Solaris. We should not 
recreate it.

However, if you feel you really need such an option to be passed 
automatically to the linker, you may add it to the gcc specs file. This 
file can be found in the same directory that contains cc1 (run |gcc 
-print-prog-name=cc1| to find it). You may add linker flags such as |-R| 
or |-rpath|, depending on platform and linker, to the |*link| or |*lib| 
specs.

Another alternative is to install a wrapper script around gcc, g++ or ld 
that adds the appropriate directory to the environment variable 
|LD_RUN_PATH| or equivalent (again, it's platform-dependent).

Yet another option, that works on a few platforms, is to hard-code the 
full pathname of the library into its soname. This can only be 
accomplished by modifying the appropriate .ml file within 
libstdc++/config (and also libg++/config, if you are building libg++), 
so that |$(libdir)/| appears just before the library name in |-soname| 
or |-h| options.

And; the libary,'Imagemagick',   i try to install via Fink.

1. add links to gcc specs file.  I find a section called: *link and 
*lib. Does anyone know i should add the linker flag -R or -rpath?

2. Install a wrapper around gcc?

3. To hard-code full pathname of library into its soname. If i'm 
installing Imagemagick via Fink, is this still possible for me to do?

And if all of this isn't an option for some reason, is it easier to 
install Imagemagick by source and add linkerflags when i configure the 
library? And, do i have to copy the libary to the /sw directory of Fink 
or is there another way to do this?

Thanks in advance for answering..

Sara





More information about the Pd-list mailing list