Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

openSSL build error

Hello,

I am following tschmelcher written guide "sshd-guide".

http://forum.niosforum.com/forum/index.php?showtopic=3252 (http://forum.niosforum.com/forum/index.php?showtopic=3252)

In the first step:

1. I downloaded the openssl-0.9.7e.tar.gz file to ~/download

2. build with "make" command.

it gave following error:

**********************************************************************

make[1]: Entering directory `/home/goutam/buildroot/build_nios2/openssl-0.9.7e'

libs='-L. '; for i in crypto ssl; do

if [ "crypto ssl" = "ssl" -a -n "" ]; then

libs=" $libs";

fi;

( set -x; /home/goutam/buildroot/build_nios2/staging_dir/bin/nios2-linux-uclibc-gcc

-shared -o lib$i.so.0.9.7

-Wl,-soname=lib$i.so.0.9.7

-Wl,-Bsymbolic

-Wl,--whole-archive lib$i.a

-Wl,--no-whole-archive $libs -L/home/goutam/buildroot/build_nios2/staging_dir/lib -lc ) || exit 1;

libs="-l$i $libs";

done

+ /home/goutam/buildroot/build_nios2/staging_dir/bin/nios2-linux-uclibc-gcc -shared -o libcrypto.so.0.9.7 -Wl,-soname=libcrypto.so.0.9.7 -Wl,-Bsymbolic -Wl,--whole-archive libcrypto.a -Wl,--no-whole-archive -L. -L/home/goutam/buildroot/build_nios2/staging_dir/lib -lc

nios2-linux-uclibc-gcc: unrecognized option `-shared'

/home/goutam/buildroot/build_nios2/staging_dir/lib/gcc/nios2-linux-uclibc/3.4.6/../../../../nios2-linux-uclibc/lib/crt1.o(.text+0x10): In function `_start':

: undefined reference to `main'

/home/goutam/buildroot/build_nios2/staging_dir/lib/gcc/nios2-linux-uclibc/3.4.6/../../../../nios2-linux-uclibc/lib/crt1.o(.text+0x14): In function `_start':

: undefined reference to `main'

collect2: ld returned 1 exit status

make[1]: *** [do_gnu-shared] Error 1

make[1]: Leaving directory `/home/goutam/buildroot/build_nios2/openssl-0.9.7e'

make: *** [/home/goutam/buildroot/build_nios2/openssl-0.9.7e/apps/openssl] Error 2

**********************************************************************

Kindly, acknowledge the error and recovery of that error.

thanks & regard,

Goutam

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The error does not matter because it is post building the libcrypto.a and the libssl.a. The error appears when applications for SSL are build which we do not need. The error happens because the Nios does not support shared libs.

    If you want to compile without error make following lines a comment in openssl.mk file:

    $(OPENSSL_DIR)/apps/openssl: $(OPENSSL_DIR)/Makefile

    $(MAKE1) CC=$(TARGET_CC) -C $(OPENSSL_DIR) all

    # Work around openssl build bug to link libssl.a with libcrypto.a.

    # -rm $(OPENSSL_DIR)/libssl.a.*.*.*

    # $(MAKE1) CC=$(TARGET_CC) -C $(OPENSSL_DIR) do_linux-shared
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello nacide,

    thanks for support and it works well.

    thanks & regard,

    Goutam