Marc Mettes <[EMAIL PROTECTED]> writes:
>Nick Ing-Simmons wrote:
>> 
>> >The compile and link lines look like this:
>> >
>> >gcc -c -fPIC -DPRO_MACHINE=19 -DPRO_OS=3 -DSOLARIS -I. -Iincludes
>> >    -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
>> >    -I/usr/perl/lib/5.6.1/sun4-solaris/CORE properl.c
>> >
>> >ld -G -Bsymbolic -o properl.dll properl.o ./protk_dll.a
>> >   /usr/perl/lib/5.6.1/sun4-solaris/auto/DynaLoader/DynaLoader.a
>> >   -L/usr/perl/lib/5.6.1/sun4-solaris/CORE -lperl
>> >   -L/opt/gcc-2.95.3/lib/gcc-lib/sparc-sun-solaris2.6/2.95.3 -lgcc
>> >   -lsocket -lnsl -lw -lm -ldl -lc
>> >
>> 
>> Can you try without the -Bsymbolic ?
>
>Without -Bsymbolic, the app cannot be loaded at runtime.  It is an 
>option used by example makefiles with this CAD api, and it seems 
>that I cannot remove it.


But you can turn it off for some libraries. Without a Solaris machine
to test it on I cannot be sure but I am reasonably certain that 
-Bsymbolic binding of -ldl renders it useless (the same may be 
true of -lnsl IIRC).

Try re-enabling dynamic binding for -ldl and -lc 

ld -G -Bsymbolic -o properl.dll properl.o ./protk_dll.a
   /usr/perl/lib/5.6.1/sun4-solaris/auto/DynaLoader/DynaLoader.a
   -L/usr/perl/lib/5.6.1/sun4-solaris/CORE -lperl
   -L/opt/gcc-2.95.3/lib/gcc-lib/sparc-sun-solaris2.6/2.95.3 -lgcc
   -lsocket -lnsl -lw -lm -Bdynamic -ldl -lc

Or perhaps just the problem library:

ld -G -Bsymbolic -o properl.dll properl.o ./protk_dll.a -Bdynamic
   /usr/perl/lib/5.6.1/sun4-solaris/auto/DynaLoader/DynaLoader.a
   -L/usr/perl/lib/5.6.1/sun4-solaris/CORE -lperl
   -L/opt/gcc-2.95.3/lib/gcc-lib/sparc-sun-solaris2.6/2.95.3 -lgcc
   -lsocket -lnsl -lw -lm  -ldl -lc

>
>     -B symbolic
>           In dynamic mode only. When building a  shared  object,
>           binds  references  to  global symbols to their defini-
>           tions, if  available,  within  the  object.  Normally,
>           references to global symbols within shared objects are
>           not bound  until  runtime,  even  if  definitions  are
>           available,  so  that definitions of the same symbol in
>           an executable or other shared object can override  the
>           object's  own  definition.  ld will issue warnings for
>           undefined symbols unless -z defs overrides.

That would also imply that code is going to define symbols which 
conflict with root executable. This is going to be a problem 
because the way perl dynamic loading works relies on symbols 
from -lperl being available to loaded perl extensions. We have 
not got that far yet, but when you do you are going to have to 
use one of the dlopen() tricks discussed on this list recently,
to make perl's symbols available and that will make these must-be-symbolic
symbols visible too.


>
>I am using gcc built on Solaris 2.6, but linking and running the 
>app on Solaris 8.  Could that be causing some issues?

I think gcc-2.8+ is much better at this that earlier ones 
but it could be causing problems. 


>
>
>Marc
-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/

Reply via email to