0.9.9 SNAP OSX .dylib link problem

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

0.9.9 SNAP OSX .dylib link problem

Larry Bugbee-2
Hi,

I'm building 0.9.9 from the latest SNAP and have been successful with  
openssl (the app) but no joy with building .dylib files on MacOSX.  
The linker fails with:
     ld: absolute addressing (perhaps -mdynamic-no-pic) used in
     _OPENSSL_rdtsc from libcrypto.a(x86cpuid.o) not allowed in
     slidable image

Playing with it I find the perl asm functions with "EXTRN
\t_OPENSSL_ia32cap_P:DWORD" are problematic.  Unfortunately I don't  
have the skills to dive deeper and fix it.  Perhaps this message can  
be forwarded to the right person?

For the record, I'm running OSX 10.5.2, gcc 4.0.1, on an Intel  
miniMac.  My build commands are:
     ./config --prefix=/usr/local --openssldir=/usr/local/openssl
     make
     make test
     make libcrypto.0.9.9.dylib

Also, I can't find a *global* switch to disable the assembly modules.  
Suggestions?

My thanks,

Larry

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: 0.9.9 SNAP OSX .dylib link problem

Martin Simmons
>>>>> On Wed, 19 Mar 2008 00:12:56 -0700, Larry Bugbee said:
>
> Hi,
>
> I'm building 0.9.9 from the latest SNAP and have been successful with  
> openssl (the app) but no joy with building .dylib files on MacOSX.  
> The linker fails with:
>      ld: absolute addressing (perhaps -mdynamic-no-pic) used in
>      _OPENSSL_rdtsc from libcrypto.a(x86cpuid.o) not allowed in
>      slidable image
>
> Playing with it I find the perl asm functions with "EXTRN
> \t_OPENSSL_ia32cap_P:DWORD" are problematic.  Unfortunately I don't  
> have the skills to dive deeper and fix it.  Perhaps this message can  
> be forwarded to the right person?
>
> For the record, I'm running OSX 10.5.2, gcc 4.0.1, on an Intel  
> miniMac.  My build commands are:
>      ./config --prefix=/usr/local --openssldir=/usr/local/openssl
>      make
>      make test
>      make libcrypto.0.9.9.dylib
>
> Also, I can't find a *global* switch to disable the assembly modules.  
> Suggestions?

Maybe using Apple's approach?  In 0.9.7l, they appear to build the .dylib
files from the .a files (the shlibs target below).

http://www.opensource.apple.com/darwinsource/10.5.2/OpenSSL-46/Makefile
http://www.opensource.apple.com/darwinsource/tarballs/other/OpenSSL-46.tar.gz

__Martin
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: 0.9.9 SNAP OSX .dylib link problem

Larry Bugbee-2
>> I'm building 0.9.9 from the latest SNAP and have been successful with
>> openssl (the app) but no joy with building .dylib files on MacOSX.
>> The linker fails with:
>>     ld: absolute addressing (perhaps -mdynamic-no-pic) used in
>>     _OPENSSL_rdtsc from libcrypto.a(x86cpuid.o) not allowed in
>>     slidable image
>>
>> Playing with it I find the perl asm functions with "EXTRN
>> \t_OPENSSL_ia32cap_P:DWORD" are problematic.  Unfortunately I don't
>> have the skills to dive deeper and fix it.  Perhaps this message can
>> be forwarded to the right person?
>>
>> For the record, I'm running OSX 10.5.2, gcc 4.0.1, on an Intel
>> miniMac.  My build commands are:
>>     ./config --prefix=/usr/local --openssldir=/usr/local/openssl
>>     make
>>     make test
>>     make libcrypto.0.9.9.dylib
>>
>> Also, I can't find a *global* switch to disable the assembly modules.
>> Suggestions?
>
> Maybe using Apple's approach?  In 0.9.7l, they appear to build  
> the .dylib
> files from the .a files (the shlibs target below).
>
> http://www.opensource.apple.com/darwinsource/10.5.2/OpenSSL-46/ 
> Makefile
> http://www.opensource.apple.com/darwinsource/tarballs/other/OpenSSL-46.tar.gz

Thanks.  Unfortunately the darwin version is 0.9.7, and it doesn't  
seem to hold any special secrets.  The use of the .a files is how  
0.9.9 and 0.9.8 do it as well.  And... I have been successful building  
all versions of 0.9.8 including the dylibs using the vanilla Makefile  
provided with OpenSSL.  It is only 0.9.9 that is problematic.

Not mentioned previously and for the record, I also tried:
    make build_libs
    make build-shared
    make link-shared
    make build_crypto
    make libcrypto.0.9.9.dylib
    make libssl.0.9.9.dylib

The problem has to do with the linker not finding position independent  
code and while -fPIC is the default, explicitly expressing -fPIC  
didn't change anything.

I traced it down to the assembly code in the x86-specific asm  
acceleration modules.  ...those functions containing  
"OPENSSL_ia32cap_P".  I'm unable to get to the root cause, but when I  
disable each offending function in turn, the link progresses further  
before it burps.  To help "prove" my point a global switch to disable  
all the asm accelerations would be nice but I don't see one.

I'm still open to suggestions.

Larry

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: 0.9.9 SNAP OSX .dylib link problem

Dr. Stephen Henson
On Wed, Mar 19, 2008, Larry Bugbee wrote:

>
> I traced it down to the assembly code in the x86-specific asm acceleration
> modules.  ...those functions containing "OPENSSL_ia32cap_P".  I'm unable to
> get to the root cause, but when I disable each offending function in turn,
> the link progresses further before it burps.  To help "prove" my point a
> global switch to disable all the asm accelerations would be nice but I
> don't see one.
>

Passing no-asm to config or Configure should do that.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: 0.9.9 SNAP OSX .dylib link problem [workaround]

Larry Bugbee-2

On Mar 20, 2008, at 4:18 AM, Dr. Stephen Henson wrote:

> On Wed, Mar 19, 2008, Larry Bugbee wrote:
>> I traced it down to the assembly code in the x86-specific asm  
>> acceleration
>> modules.  ...those functions containing "OPENSSL_ia32cap_P".  I'm  
>> unable to
>> get to the root cause, but when I disable each offending function  
>> in turn,
>> the link progresses further before it burps.  To help "prove" my  
>> point a
>> global switch to disable all the asm accelerations would be nice  
>> but I
>> don't see one.
>
> Passing no-asm to config or Configure should do that.

Adding the -no-asm switch allowed the creation of the .dylib files.  
The problem is somewhere with in the x86 asm acceleration modules.  
Thanks, Steve.

Larry


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: 0.9.9 SNAP OSX .dylib link problem

Andy Polyakov
In reply to this post by Larry Bugbee-2
> I'm building 0.9.9 from the latest SNAP and have been successful with
> openssl (the app) but no joy with building .dylib files on MacOSX.  The
> linker fails with:
>     ld: absolute addressing (perhaps -mdynamic-no-pic) used in
>     _OPENSSL_rdtsc from libcrypto.a(x86cpuid.o) not allowed in
>     slidable image
>
> For the record, I'm running OSX 10.5.2, gcc 4.0.1, on an Intel miniMac.
> My build commands are:
>     ./config --prefix=/usr/local --openssldir=/usr/local/openssl
>     make
>     make test
>     make libcrypto.0.9.9.dylib

This is not supported way of creating shared libraries, './config shared
...' is! If configured with shared option assembler modules come out
position-independent and .dylib is linked successfully. One can argue
that MacOS X assembler modules should be generated position-independent
unconditionally (in line with vendor compiler default), but assembler is
not the only reason to configure with shared option.

> Also, I can't find a *global* switch to disable the assembly modules.
> Suggestions?

Examine accompanying ./INSTALL file perhaps. A.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: 0.9.9 SNAP OSX .dylib link [solved]

Larry Bugbee-2
On Mar 21, 2008, at 12:52 PM, Andy Polyakov wrote:
> This is not supported way of creating shared libraries, './config  
> shared
> ...' is! If configured with shared option assembler modules come out
> position-independent and .dylib is linked successfully.

...and right you are.  It works perfectly!  Thanks, I'm good to go.

Larry
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]