Topic: [SOLVED] Problems cross-compiling cyaSSL embedded SSL for Kinetis

Hello,

I’m trying to cross-compile cyaSSL embedded SSL for kinetis under cygwin with no success. I’m using the arm GNU toolchain provided by code warrior 10.3.

I run the following commands prior configure:

export CC=arm-none-eabi-gcc.exe
export AR=arm-none-eabi-ar.exe
export RANLIB=arm-none-eabi-ranlib.exe
export LD=arm-none-eabi-ld.exe
export CFLAGS="-mthumb -march=armv7e-m -mfloat-abi=softfp -mfpu=fpv4-sp-d16"

Then I run configure with the next command:

./configure --target=arm-none-eabi

Then the output is:

$ ./configure --target=arm-none-eabi
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... arm-none-eabi
checking for gcc... arm-none-eabi-gcc.exe
checking whether the C compiler works... no
configure: error: in `/home/ogarcia/programas/cyassl-2.7.0':
configure: error: C compiler cannot create executables
See `config.log' for more details


I attach the config.log file.

I can see the problem in config.log. Wich I think  is the next one:

c:/cygwin/home/bin/arm-none-eabi-gcc-4_6_2/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7e-m/softfp\libc.a(lib_a-exit.o): In function `exit':^M
exit.c:(.text.exit+0x16): undefined reference to `_exit'

In fact, I’m not able to compile the following test code:

void main() {
       
    int a;
    return;
}

The output is the same. I have done some search in google, and found that newlib has no definition for _exit.

How I can solve this?

Thanks in advance.

Óscar.

Post's attachments

config.log 11.2 kb, 1 downloads since 2013-07-26 

You don't have the permssions to download the attachments of this post.

Share

2 (edited by vkazakov1981 2014-11-17 09:24:31)

Re: [SOLVED] Problems cross-compiling cyaSSL embedded SSL for Kinetis

I got the same problem. I using "Cross Compile" way to build CyaSSL for raspberry-PI board.
I have got log:
======================================================
vsevolod@vsevolod-VirtualBox:~/yassl_rpi$ ./compile.sh
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '1000' is supported by ustar format... yes
checking whether GID '1000' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... /opt/pi-tools/arm-linux-gnueabihf/bin/gcc
checking whether the C compiler works... no
configure: error: in `/home/vsevolod/yassl_rpi':
configure: error: C compiler cannot create executables
See `config.log' for more details
=======================================

Any idea how to solve it? 

Share

Re: [SOLVED] Problems cross-compiling cyaSSL embedded SSL for Kinetis

Hi,

This looks like a problem with the compiler setup, as the configure system thinks that the compiler doesn't work.  Have you checked with someone from Freescale about this, or asked on their forums?

I would recommend starting with a simple "Hello World" application, and see if you can compile that using the cross compiler in question.  After that works, you could move to trying to cross compile CyaSSL.

Best Regards,
Chris

Re: [SOLVED] Problems cross-compiling cyaSSL embedded SSL for Kinetis

Hi,

Can you also verify that you are cross compiling correctly, and that you are using "--host=" instead of "--target="?  You can reference section 2.6 of the CyaSSL Manual for a simple description of how to cross compile.

http://www.yassl.com/yaSSL/Docs-cyassl- … yassl.html

Thanks,
Chris

5 (edited by vkazakov1981 2014-12-08 02:11:16)

Re: [SOLVED] Problems cross-compiling cyaSSL embedded SSL for Kinetis

chrisc wrote:

Hi,

Can you also verify that you are cross compiling correctly, and that you are using "--host=" instead of "--target="?  You can reference section 2.6 of the CyaSSL Manual for a simple description of how to cross compile.

http://www.yassl.com/yaSSL/Docs-cyassl- … yassl.html

Thanks,
Chris

chrisc wrote:

Hi,

This looks like a problem with the compiler setup, as the configure system thinks that the compiler doesn't work.  Have you checked with someone from Freescale about this, or asked on their forums?

I would recommend starting with a simple "Hello World" application, and see if you can compile that using the cross compiler in question.  After that works, you could move to trying to cross compile CyaSSL.

Best Regards,
Chris

Hello chrisc, thank you for replay.
I can build application "hello world" on the compiler.  I had build Yassl.so lib successful from Makefile or from NetBeanse with the gcc compiler, but I need build Cyassl through the ./configure tool.

May give  me advice? How to run ./configure --host= ..... CC=...
My "gcc" placed in "/opt/pi-tools/arm-linux-gnueabihf/bin/gcc".

I have used ./configure line from terminal:
sudo ./configure CC=/opt/pi-tools/arm-linux-gnueabihf/bin/gcc

The compiler which I used just coping from .zip file without any installation.

Thank you.

Share

Re: [SOLVED] Problems cross-compiling cyaSSL embedded SSL for Kinetis

I found other way but also with error....

After starts ./configure without CC="" param from terminal.
the ./configure creates many conftest.c files with different content, but when I starts:
./configure CC=/usr/rpi/bin/arm-linux-gnueabihf-gcc

config.log:
configure:4408: error: in `/home/vsevolod/yassl/cyassl-3.2.0':
configure:4410: error: cannot run C compiled programs.

Share

Re: [SOLVED] Problems cross-compiling cyaSSL embedded SSL for Kinetis

Hi I ran into exactly the same issue. Luckily a post on the launchpad site for the arm-none-eabi-gcc toolchain put me onto the answer.
You need to pass into configure the linker options you would normally use in your makefile, eg.

./configure --host=arm-none-eabi CFLAGS="-O3 -mthumb -mcpu=cortex-m4 -lc -lrdimon -specs=rdimon.specs"

and of course change the above to whichever Arm MCU core you are compiling for.

Depending on what you are doing you might also want: --enable-static --enable-debug

However now that I have the configure script working, the actual build fails not finding standard headers:

  CC       src/src_libcyassl_la-internal.lo
  CC       src/src_libcyassl_la-io.lo
src/io.c:84:36: fatal error: sys/socket.h: No such file or directory
compilation terminated.

So if anyone has a clue about that I'd be happy to hear.

Share

Re: [SOLVED] Problems cross-compiling cyaSSL embedded SSL for Kinetis

Issue solved:
in my configuration ./configure working fine with params:
./configure CC=/opt/pi-tools/bin/arm-linux-gnueabihf-gcc --host=arm-linux

Share