Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tinydtls-dev] Cross-compiling tinyDTLS for an ARM/Linux platform (RaspberryPi)

Hi all,

I am trying to cross-compile the tinyDTLS library for the ARM/Linux platform (specifically the RaspberryPi, not that it matters).
I ran this commands:

> export ac_cv_func_malloc_0_nonnull=yes
> ./configure --host=arm-linux-gnueabi
> make

The first command mitigates the following error that I get: 
> tinydtls/dtls.c:243: undefined reference to `rpl_malloc'
> [...]
> tinydtls/crypto.c:80: more undefined references to `rpl_malloc' follow collect2: error: ld returned 1 exit status".

The configure script recognizes that I want to cross-compile and identifies the tools OK:

> checking for arm-linux-gnueabi-gcc... arm-linux-gnueabi-gcc
> checking whether the C compiler works... yes
> [...]
> checking whether we are cross compiling... yes
> checking whether we are using the GNU C compiler... yes
> checking whether arm-linux-gnueabi-gcc accepts -g... yes
> checking for arm-linux-gnueabi-gcc option to accept ISO C89... none needed
> checking for arm-linux-gnueabi-ranlib... arm-linux-gnueabi-ranlib
> checking how to run the C preprocessor... arm-linux-gnueabi-gcc -E
> [...]

But when a run "make", it still uses the native cc/gcc compiler:

> cc -Wall -pedantic -std=c99 -g -O2 -DDTLSv12 -DWITH_SHA256 -DDTLS_CHECK_CONTENTTYPE  -c -o dtls.o dtls.c
> cc -Wall -pedantic -std=c99 -g -O2 -DDTLSv12 -DWITH_SHA256 -DDTLS_CHECK_CONTENTTYPE  -c -o crypto.o crypto.c
> cc -Wall -pedantic -std=c99 -g -O2 -DDTLSv12 -DWITH_SHA256 -DDTLS_CHECK_CONTENTTYPE  -c -o ccm.o ccm.c
> [...]

Note that just hard-coding the cross-compiler in the makefiles won't help me, because I'm actually trying to cross-compile the "dtls" branch of the "libcoap" project. So I have to pass the "--host=arm-linux-gnueabi" to the libcoap's configure script which forwards the flag to tinyDTLS' configure script, but the makefiles ignore this flag. It seems that the configure script doesn't do much in term of setting up the build parameters.

How could I get tinyDTLS to use the right cross-compiler? Has anyone tried this before?

Thank you!

-------------------------------------
Alin Micu

Back to the top