Is it possible to compile crypto app with _static_ libcrypto

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

Is it possible to compile crypto app with _static_ libcrypto

Max Lapshin-2
I've downloaded debian source package and decided to rebuild it with
--disable-dynamic-ssl-lib

As a result, I've finished with:

x86_64-linux-gnu-gcc -c -o ../priv/obj/x86_64-pc-linux-gnu/crypto.o
-Wall -Wstrict-prototypes -Wmissing-prototypes
-Wdeclaration-after-statement  -DUSE_THREADS -D_THREAD_SAFE
-D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -g -O2
-fno-strict-aliasing
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/x86_64-pc-linux-gnu
-fno-tree-copyrename  -D_GNU_SOURCE -fPIC -I/usr/include
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/emulator/beam
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/include
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/include/x86_64-pc-linux-gnu
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/include/internal
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/include/internal/x86_64-pc-linux-gnu
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/emulator/sys/unix crypto.c
/usr/bin/install -c -d ../priv/lib/x86_64-pc-linux-gnu
x86_64-linux-gnu-gcc  -shared -Wl,-Bsymbolic -o
../priv/lib/x86_64-pc-linux-gnu/crypto.so
../priv/obj/x86_64-pc-linux-gnu/crypto.o  /usr/lib64/libcrypto.a
/usr/bin/ld: /usr/lib64/libcrypto.a(cryptlib.o): relocation
R_X86_64_32 against `OPENSSL_ia32cap_P' can not be used when making a
shared object; recompile with -fPIC
/usr/lib64/libcrypto.a: could not read symbols: Bad value



I want to do it because I want to make release that has no
dependencies on system packages and libcrypto seems to be the only
one.
Or it would be better to copy libcrypto.so to release folder?
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to compile crypto app with _static_ libcrypto

Max Treskin
Seems option --disable-dynamic-ssl-lib has no effect for crypto application in OTP. Bug?

On 22 April 2011 14:45, Max Lapshin <[hidden email]> wrote:
I've downloaded debian source package and decided to rebuild it with
--disable-dynamic-ssl-lib

As a result, I've finished with:

x86_64-linux-gnu-gcc -c -o ../priv/obj/x86_64-pc-linux-gnu/crypto.o
-Wall -Wstrict-prototypes -Wmissing-prototypes
-Wdeclaration-after-statement  -DUSE_THREADS -D_THREAD_SAFE
-D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -g -O2
-fno-strict-aliasing
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/x86_64-pc-linux-gnu
-fno-tree-copyrename  -D_GNU_SOURCE -fPIC -I/usr/include
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/emulator/beam
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/include
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/include/x86_64-pc-linux-gnu
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/include/internal
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/include/internal/x86_64-pc-linux-gnu
-I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/emulator/sys/unix crypto.c
/usr/bin/install -c -d ../priv/lib/x86_64-pc-linux-gnu
x86_64-linux-gnu-gcc  -shared -Wl,-Bsymbolic -o
../priv/lib/x86_64-pc-linux-gnu/crypto.so
../priv/obj/x86_64-pc-linux-gnu/crypto.o  /usr/lib64/libcrypto.a
/usr/bin/ld: /usr/lib64/libcrypto.a(cryptlib.o): relocation
R_X86_64_32 against `OPENSSL_ia32cap_P' can not be used when making a
shared object; recompile with -fPIC
/usr/lib64/libcrypto.a: could not read symbols: Bad value



I want to do it because I want to make release that has no
dependencies on system packages and libcrypto seems to be the only
one.
Or it would be better to copy libcrypto.so to release folder?
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



--
Maxim Treskin

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to compile crypto app with _static_ libcrypto

Sverker Eriksson
Option --disable-dynamic-ssl-lib will link crypto with a static
libcrypto.a instead of a dynamic libcrypto.so. But crypto itself
(crypto.so) is still a dynamic library loaded by the emulator.

I think the problem is with libcrypto.a. It was not built to be part of
a dynamic library. I would recommend downloading openssl and rebuild it
yourself.

/Sverker, Erlang/OTP Ericsson


Maxim Treskin wrote:

> Seems option --disable-dynamic-ssl-lib has no effect for crypto application
> in OTP. Bug?
>
> On 22 April 2011 14:45, Max Lapshin <[hidden email]> wrote:
>
>  
>> I've downloaded debian source package and decided to rebuild it with
>> --disable-dynamic-ssl-lib
>>
>> As a result, I've finished with:
>>
>> x86_64-linux-gnu-gcc -c -o ../priv/obj/x86_64-pc-linux-gnu/crypto.o
>> -Wall -Wstrict-prototypes -Wmissing-prototypes
>> -Wdeclaration-after-statement  -DUSE_THREADS -D_THREAD_SAFE
>> -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -g -O2
>> -fno-strict-aliasing
>> -I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/x86_64-pc-linux-gnu
>> -fno-tree-copyrename  -D_GNU_SOURCE -fPIC -I/usr/include
>> -I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/emulator/beam
>> -I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/include
>> -I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/include/x86_64-pc-linux-gnu
>> -I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/include/internal
>>
>> -I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/include/internal/x86_64-pc-linux-gnu
>> -I/var/tmp/erlang/erlang-14.b.2-dfsg/erts/emulator/sys/unix crypto.c
>> /usr/bin/install -c -d ../priv/lib/x86_64-pc-linux-gnu
>> x86_64-linux-gnu-gcc  -shared -Wl,-Bsymbolic -o
>> ../priv/lib/x86_64-pc-linux-gnu/crypto.so
>> ../priv/obj/x86_64-pc-linux-gnu/crypto.o  /usr/lib64/libcrypto.a
>> /usr/bin/ld: /usr/lib64/libcrypto.a(cryptlib.o): relocation
>> R_X86_64_32 against `OPENSSL_ia32cap_P' can not be used when making a
>> shared object; recompile with -fPIC
>> /usr/lib64/libcrypto.a: could not read symbols: Bad value
>>
>>
>>
>> I want to do it because I want to make release that has no
>> dependencies on system packages and libcrypto seems to be the only
>> one.
>> Or it would be better to copy libcrypto.so to release folder?
>> _______________________________________________
>> erlang-questions mailing list
>> [hidden email]
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>    
>
>
>
>  
> ------------------------------------------------------------------------
>
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
>  

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to compile crypto app with _static_ libcrypto

Max Lapshin-2
On Tue, Apr 26, 2011 at 5:02 PM, Sverker Eriksson
<[hidden email]> wrote:
> Option --disable-dynamic-ssl-lib will link crypto with a static libcrypto.a
> instead of a dynamic libcrypto.so. But crypto itself (crypto.so) is still a
> dynamic library loaded by the emulator.
>
> I think the problem is with libcrypto.a. It was not built to be part of a
> dynamic library. I would recommend downloading openssl and rebuild it
> yourself.

At least we've done it so. Debian has broken build of openssl:
libssl.a and libcrypto.a aren't suitable for linking into other
libraries,
so I've took library from other repository and now it works excelent.
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions