access-softek / msp430-clang

0 stars 2 forks source link

Enable Contiki building #50

Open asl opened 5 years ago

asl commented 5 years ago

http://www.contiki-os.org/

chbessonova commented 5 years ago

Build Contiki with clang under sky target:

  1. Clone repo $ git clone https://github.com/contiki-os/contiki --recursive
  2. Apply the patch https://gist.github.com/chbessonova/e8111b64ece46821fe19b9dcfe77e4c7#file-build-contiki-diff on top of master
  3. clang, msp430-elf-ar and msp430-elf-gcc should be in PATH
  4. For these experiments libgcc, libc and runtime were taken from msp430-gcc toolchain.
  5. Choose one of sky-compatible example, e.g. $ cd examples/sky
  6. Build the example
    PATH=/path/to/llvm/bin:/path/to/msp430-gcc/bin:$PATH \
    make TARGET=sky CLANG=1 \
    SUPPORT_FILES=/path/to/support/files \
    LIBC_INCLUDE_PATH=/path/to/libc/includes/include

    Build should finish successfully with no warnings.

hello_world, collect, netperf, servreg, sky-shell, sky-shell-webserver are compiled successfully, but failed to be linked (not fit into memory).

Note: #2, #5, #15, #47 and 'argument' approach from #59 were applied.

chbessonova commented 5 years ago

Run Contiki examples on Cooja simulator:

  1. Ensure that the repo was cloned with --recursive option.

  2. Install Oracle JDK and ant

    java version "1.8.0_191"
    Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
    Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

    Some help, how to install JDK

  3. Workaround the following issue

  4. Run ant run and read the nice doc how to create a simulation.

The following list of examples should start and work fine:

Other examples do not fit into memory.

printf (i.e. output) doesn't work as expected if an example linked against libc from msp430-gcc toolchain.