2

I want to add a third party library to the Contiki OS. Exactly, I was trying to add the nettle 3.0 cryptography library.

Am I suppose to build the concerned library using special flags for contiki platform , not sure what exactly ? gcc msp430

If yes , how can I do it and what is the procedure of doing that ?

If I can build it directly on linux , then how to link it ?

I've tried LDFLAGS, but I keep getting the cannot open linker script file memory.x error.

LDFLAGS+=-L/usr/local/lib -lnettle

Thanks.

yushaa yave
  • 145
  • 1
  • 9

1 Answers1

0

You first need to compile the library specifically for the target architecture. To do that, pass the -mmcu parameter to the compiler (and hope the library is small enough to at least compile for msp430).

For example, this compiles SOURCES using CFLAGS for MSP430F1611 MCU:

 msp430-gcc -mmcu=msp430f1611 $(CFLAGS) $(SOURCES)

Then make sure the .a file for the correct architecture is in the library path. For Contiki, set the TARGETLIBS Makefile variable:

TARGET_LIBFILES+=-L/path/to/libnettle
TARGET_LIBFILES+=-lnettle
kfx
  • 8,136
  • 3
  • 28
  • 52