DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-03-03 05:26:53

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

OpenSSL dynamic library

Has anyone been successful in compiling OpenSSL for the NAS as a dynamic library?
The source code uses a weird configuration script, which makes it a bit difficult to set up.

Here's what I tried with openssl-0.9.8g:

Code:

./Configure linux-generic32 -DL_ENDIAN shared
make CC=arm-linux-gcc RANLIB=arm-linux-ranlib AR="arm-linux-ar r"

This compiles just fine, and .so files are produced as expected. But on the NAS, an executable using the libssl.so and libcrypto.so files complains that I shall compile them with -fPIC, which as far as I can tell they are!

Offline

 

#2 2008-03-03 09:47:39

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: OpenSSL dynamic library

Here's what I use:

Code:

    ./Configure linux-elf \
        --prefix=$CPREFIX \
        --openssldir=$CPREFIX/etc/ssl \
        zlib shared no-asm

    make CC=$CC RANLIB=$RANLIB
    make CC=$CC RANLIB=$RANLIB INSTALL_PREFIX=$D install

Offline

 

#3 2008-03-03 12:30:20

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: OpenSSL dynamic library

Alternatively you can set CFLAGS to -fPIC before running configure to make sure you compile with that flag. "CFLAGS=-fPIC; export CFLAGS"

Offline

 

#4 2008-03-03 12:45:30

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: OpenSSL dynamic library

KyleK wrote:

with -fPIC, which as far as I can tell they are!

PS: Here's a way to test which lib really is the culprit.
http://dns323.kood.org/forum/p9654-2008 … html#p9654

Offline

 

#5 2008-03-03 16:30:48

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: OpenSSL dynamic library

fonz wrote:

KyleK wrote:

with -fPIC, which as far as I can tell they are!

PS: Here's a way to test which lib really is the culprit.
http://dns323.kood.org/forum/p9654-2008 … html#p9654

Thanks for the link.
Running the shell script revealed that 2 of my compiled libraries have the mentioned problem, libxml2.so.2.6.31 and libcrypto.so.0.9.8.
Interestingly, libssl.so.0.9.8 does not have the problem.

I tried several things with the compilation, but am so far unable to find a solution.
Here are my build scripts for both libraries:

openssl:

Code:

#!/bin/bash
source ../setpath
CC=arm-linux-gcc
RANLIB=arm-linux-ranlib
CPREFIX=/home/kylek/crosscompile/ch3snas

./Configure linux-generic32 --prefix=$CPREFIX --openssldir=$CPREFIX/etc/ssl zlib shared no-asm \
                             -I${CPREFIX}/include -L${CPREFIX}/lib
export CFLAGS=-fPIC
make CC=$CC RANLIB=$RANLIB install

libxml2:

Code:

#!/bin/bash
source ../setpath
CPREFIX=/home/kylek/crosscompile/ch3snas

./configure --prefix=$CPREFIX --build=i686 --host=arm-linux --with-pic \
                --with-zlib=$CPREFIX/lib

Compiling statically works just fine, any reason why I should prefer dynmically linked binaries?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB