Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

openSSL build error

Altera_Forum
Honored Contributor II
1,782 Views

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
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
919 Views

I have prepared the compiled openssl lib and zlib, those are necessary for building ssh. 

http://hungryhippo.jot.com/wikihome (http://hungryhippo.jot.com/wikihome

 

The key point is that there is no shared object, (ie DLL) in Nios2. 

So you have to disable or ignore anythings about shared. 

You have to modify buildroot/package/openssl/openssl.mk

To build static .a instead of shared .so.... . 

Look into tschmelcher's patches.
0 Kudos
Altera_Forum
Honored Contributor II
919 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
919 Views

Hello nacide, 

 

thanks for support and it works well. 

 

 

thanks & regard, 

Goutam
0 Kudos
Reply