Skip to main content

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

Hi Olaf,

Thank you for the quick response.

> uh, that one. IIRC, AC_FUNC_MALLOC in tinydtls's configure.in needs to be removed. Noted.

Yeah, you're right. I did that and I don't have to use the "export ac_cv_func_malloc_0_nonnull=yes" command anymore.

> Okay, I have to talk to the libcoap author and see if he can fix that :-)

Nice one :-) In the meantime, I did some changes to both repositories to enable cross-compiling. I haven't tested the binaries yet 'cause I'm waiting on my RaspberryPi board to arrive. Once I test that everything's OK, I can push the changes to both repositories sometime next week.
It think it would also be beneficial to update the tinydtls submodule in the libcoap repo to the latest commit. Right now libcoap's dtls submodule is referencing commit 5d80ef9, which is a bit behind.

Regards,
Alin



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

On Sat, Oct 22, 2016 at 2:42 PM, Olaf Bergmann <bergmann@xxxxxxx> wrote:
Hi Alin,

Alin Micu <micu.alin.ctin@xxxxxxxxx> writes:

> 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".

uh, that one. IIRC, AC_FUNC_MALLOC in tinydtls's configure.in needs to
be removed. Noted.

[...]
> 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.

Okay, I have to talk to the libcoap author and see if he can fix that :-)
The tinydtls integration with libcoap is still very alpha, Suggestions
are very welcome.

Grüße
Olaf


Back to the top