---
url: /kb/embedded/yocto/sdk/index.md
---
# SDK and eSDK

## Standard SDK vs Extensible SDK

Yocto provides two SDK flavors for application developers who need to build software targeting the embedded image without running a full Yocto build.

| Aspect | Standard SDK | Extensible SDK (eSDK) |
|--------|-------------|----------------------|
| Size | ~100–400 MB | Larger (includes BitBake + layers) |
| Contents | Cross-compiler, headers, libs, pkg-config | Everything in standard + `devtool` + layer metadata |
| Use case | Building apps against a fixed sysroot | Iterative recipe development, adding new packages |
| Generated by | `bitbake -c populate_sdk <image>` | `bitbake -c populate_sdk_ext <image>` |
| Key tool included | Cross-compiler + cmake/pkg-config | `devtool add/modify/upgrade/build-image` |

## Generating the Standard SDK

```bash
# After building your image, generate its corresponding SDK
bitbake -c populate_sdk core-image-minimal

# Output: tmp/deploy/sdk/
# poky-glibc-x86_64-core-image-minimal-aarch64-toolchain-5.0.sh
```

### What's Inside the SDK Installer

* `aarch64-poky-linux-gcc` — cross-compiler
* `aarch64-poky-linux-g++`
* `aarch64-poky-linux-ld`, `aarch64-poky-linux-objcopy`, etc.
* `gdb` (cross-debugger, or native for on-target)
* All headers and libraries from the image's sysroot
* `pkg-config` pre-configured for the target sysroot
* `cmake` toolchain file
* An `environment-setup-*` script that sets all required env vars

### Installing and Using the SDK

```bash
# 1. Run the installer
./poky-glibc-x86_64-core-image-minimal-aarch64-toolchain-5.0.sh
# (prompts for install directory, default: /opt/poky/5.0/)

# 2. Source the environment script (run this in every new shell)
source /opt/poky/5.0/environment-setup-cortexa72-poky-linux

# 3. Verify the cross-compiler is active
echo $CC
# aarch64-poky-linux-gcc -mcpu=cortex-a72 -march=armv8-a+crc+crypto ...

# 4. Build your application
gcc myapp.c -o myapp          # host gcc
$CC myapp.c -o myapp           # cross-compiler (from SDK)

# 5. For CMake projects:
cmake -B build -DCMAKE_TOOLCHAIN_FILE=$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake ..
cmake --build build

# 6. Verify the output is for the target
file build/myapp
# ELF 64-bit LSB executable, ARM aarch64
```

## Controlling SDK Contents

```bash
# Add extra packages to the SDK's target sysroot (available for linking against)
TOOLCHAIN_TARGET_TASK:append = " libssl-dev libcurl-dev libmosquitto-dev"

# Add extra tools to the SDK's host component
TOOLCHAIN_HOST_TASK:append = " nativesdk-cmake nativesdk-ninja"

# Or inherit the sdk-provides-dummy class to bulk-add dev packages
SDKIMAGE_FEATURES += "dev-pkgs dbg-pkgs"
```

## The Extensible SDK (eSDK)

The eSDK embeds a copy of BitBake and the layer metadata, enabling `devtool` workflows:

```bash
# Generate
bitbake -c populate_sdk_ext core-image-minimal

# Install
./poky-glibc-x86_64-core-image-minimal-aarch64-toolchain-ext-5.0.sh
source /opt/poky-ext/5.0/environment-setup-cortexa72-poky-linux
```

### devtool Workflow (the primary eSDK workflow)

```bash
# Add a new recipe for an existing source tree
devtool add myapp /path/to/myapp/source
# BitBake analyses the source and generates a recipe skeleton

# Modify an existing recipe (checks out source for editing)
devtool modify busybox
cd $BUILDDIR/workspace/sources/busybox
# ... make changes ...

# Build using the modified recipe
devtool build myapp

# Deploy directly to a running target for rapid testing
devtool deploy-target myapp root@192.168.1.100

# When done: extract the changes back as patches for your layer
devtool finish myapp meta-myproduct

# Build a full image incorporating your changes
devtool build-image core-image-minimal
```

## SDK for CI/CD Integration

```bash
# In a CI pipeline: generate the SDK artifact once, cache it
# Then all app build jobs just source it

# Dockerfile-style SDK usage:
RUN ./poky-sdk-*.sh -y -d /opt/poky-sdk
ENV SDK_ENV /opt/poky-sdk/environment-setup-cortexa72-poky-linux

# Build step:
RUN bash -c "source $SDK_ENV && cmake ... && cmake --build build"
```
