Overview

A relocatable toolchain/SDK is a self-contained set of cross-compilation tools that can be moved to different locations without breaking dependencies. Buildroot provides an option to generate such a toolchain, allowing developers to use it for cross-compiling applications without depending on a fixed absolute path.

Prepare Relocatable SDK

Configure Buildroot for SDK Generation

Disable BusyBox and set /bin/sh to None under System configuration. This prevents unnecessary shell dependencies within the SDK, ensuring better relocatability.

make sdk

# OR

make prepare-sdk
# tar host directory yourself
tar cJf "$(PLATFROM_BUILD_OUTPUT_PATH)/$(SDK_PREFIX).tar.xz" \
		--owner=0 --group=0 --numeric-owner \
		--transform='s#^$(patsubst /%,%,$(HOST_DIR))#$(SDK_PREFIX)#' \
		-C / $(patsubst /%,%,$(HOST_DIR))

Using external toolchain (SDK)

tar -xf build/NVRX_RK3588/output/aarch64-buildroot-linux-gnu.tar.xz -C /opt/
cd /opt/aarch64-buildroot-linux-gnu && ./relocate-sdk.sh

Reference