wiki:Yocto/SDK

Version 1 (modified by trac, 7 years ago) ( diff )

--

Yocto Software Development Kit (SDK)

Gateworks provides a Software Development Kit (SDK) compatible with the Yocto Board Support Package (BSP). This SDK provides a cross-toolchain and libraries compatible with the gateworks-gui-image that we provide as a pre-built downloadable disk image so that you can build applications that will run on top of Yocto installed on a Ventana board without having to have build the entire BSP yourself.

Cross Compile SDK Downloads:

  • Yocto 1.8.2 SDK - (sha256sum: de6b93f543fedba0ad4283fcbe28c7ce1dd0a8c6140f42896ba8fa4364e26cd2)

You can build your own SDK compatible with a filesystem image of your choice using information here.

Using the SDK

To use the SDK you need to source the setup-environment* script in the installation directory. This script will augment your path and set several env variables useful for cross-compiling:

  • PKG_CONFIG_SYSROOT_DIR PKG_CONFIG_PATH (for pkg-config)
  • CC CXX CPP AS LD GDB STRIP RANLIB OBJCOPY OBJDUMP AR NM CFLAGS CXXFLAGS LDFLAGS CPPFLAGS ARCH CROSS_COMPILE (for make and cmdline use)
  • M4 CONFIGURE_FLAGS (for aclocal/autoconf/autoheader/automake/autoreconf/autoupdate use)
  1. Run the downloaded/built .sh file and specify an install path:
    /bin/sh ventana-yocto-1.8-sdk-*.sh -d ~/sdk
    
    • Note that you need write access to the directory you wish to install to. By default this is /opt/poky/ but you can change it when prompted or via the -d <dir> parameter
    • do not run the install script as root - if you do, you will need to adjust some directory permissions
  1. cd into extracted toolchain:
    cd ~/sdk
    
  1. Activate the environment:
    source environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
    
    • You will need to do this per new shell
    • The toolchain executables and various support apps will be in your path, but you need to make sure you are using them by using the env vars above in your build instructions and Makefiles.
    • pkg-config is in the SDK path and will provide valid results based on PKG_CONFIG_SYSROOT_DIR PKG_CONFIG_PATH env vars
    • autoconf/automake etc are in the SDK path and will provide valid results based on M4 CONFIGURE_FLAGS env vars
  1. Build:
    • to build a standalone single source app (ie hellowworld.c) use variables defined by the environment such as CC, LD, AR, etc:
      cat << EOF >> /tmp/helloworld.c
      #include <stdio.h>
      
      int main (int argc, char** argv)
      {
         printf("Hello World\n");
         return 0;
      }
      EOF
      
      ${CC} /tmp/helloworld.c -o /tmp/helloworld
      
    • to build using a Makefile which properly uses CC/CFLAGS/LDFLAGS/LIBS etc:
      make
      
  2. </ol
Note: See TracWiki for help on using the wiki.