Building iptables for Cortex-M based Targets Print

 

Step through the following procedure in order to build iptables for Cortex-M based targets:

  1. Go to the top of your Linux Cortex-M installation and activate a Linux Cortex-M development session:
  2. . ./ACTIVATE.sh

  3. For Cortex-M3 tartgets, specify the additional compiler options as follows:
  4. export LDFLAGS="-mcpu=cortex-m3 -mthumb"
    export CFLAGS="-mcpu=cortex-m3 -mthumb"

    If your target is Cortex-M4 or Cortex-M7, do the following instead:

    export LDFLAGS="-mcpu=cortex-m4 -mthumb"
    export CFLAGS="-mcpu=cortex-m4 -mthumb"

  5. Go to the root of the iptables source tree and run the configure script:
  6. ./configure --build=i386-linux --host=arm-uclinuxeabi --disable-shared

  7. Search all subdirectories recursively for Makefile files and update them by adding the -DNO_SHARED_LIBS flag to the list of other flags automatically generated by configure. For example, the updated string will look as follows in iptables/Makefile:
  8. regular_CPPFLAGS = -D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DXTABLES_LIBDIR=\"${xtlibdir}\" -DXTABLES_INTERNAL -DNO_SHARED_LIBS

  9. Now you are ready to build the package:
  10. make