setup-environment

Configures the webOS NDK cross-compile toolchain and Rust nightly build environment on macOS.

39|7|Updated Jul 3, 2026
One-click install
npx skills add https://github.com/GLinnik21/plx-native --skill setup-environment-glinnik21
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-environment
Source: https://github.com/GLinnik21/plx-native/tree/main/.agents/skills/setup-environment
Command: npx skills add https://github.com/GLinnik21/plx-native --skill setup-environment-glinnik21

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Cross-compiling a native Rust/C app for LG webOS televisions from macOS fails in confusing ways — missing compilers, wrong sysroots, SIGILL crashes on the TV — when the toolchain, Rust nightly with rust-src, or host CLI tools are absent or misconfigured. This Skill diagnoses and repairs that environment so make produces a working binary. ## Core Features & Use Cases - Toolchain provisioning: Downloads, extracts, and relocates the webosbrew native-toolchain NDK (GCC 12, glibc 2.12, armv7-a) via make setup-env, including the mandatory relocate-sdk.sh step. - Rust build-std setup: Installs nightly plus rust-src and clippy so -Z build-std rebuilds std with cortex-a9 flags, avoiding the ARMv6 CP15 barrier that SIGILLs on the TV's Cortex-A53. - Diagnosis and repair: Maps concrete errors — arm-webos-linux-gnueabi-gcc: command not found, cannot find -lSDL2 / -lplayerAPIs, -Z build-std failures, cmake is required — to specific fixes, and explains the real-libs-vs-stubs linking model (FFmpeg and libcurl stubs). - Use Case: A teammate clones the repo on a new MacBook and make fails with linker errors; use this Skill to install the NDK, set up nightly Rust, verify the binary with readelf, and get a clean build. ## Quick Start Set up the webOS build environment on this machine and verify that make produces a working pkg/plxnative binary.

Frequently Asked Questions about setup-environment

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a webOS cross-compile toolchain on macOS?

Run `make setup-env` from the repo root to download and extract the webosbrew native-toolchain NDK into ~/webos-ndk, then run its relocate-sdk.sh script. Add Rust nightly with rust-src, plus cmake and sshpass via Homebrew, and `make` will produce pkg/plxnative.

How to fix arm-webos-linux-gnueabi-gcc command not found?

This error means the webOS NDK is not installed or was moved after installation. Run `make setup-env` to install it, and if you relocated the SDK directory, re-run relocate-sdk.sh from the SDK root to rewrite its baked-in absolute paths.

Why does my Rust webOS binary SIGILL on the TV?

The default arm-unknown-linux-gnueabi std emits an ARMv6 CP15 memory barrier that is undefined on the TV's Cortex-A53. The build uses `-Z build-std` with `-C target-cpu=cortex-a9` to rebuild std; ensure nightly, rust-src, and RUSTFLAGS_TV are intact and rebuild the static lib.

Does the webOS NDK include LG proprietary libraries like libplayerAPIs?

Yes, the webosbrew NDK bundles libAcbAPI, libplayerAPIs, and libpf-1.0, so the build links the real libraries with link-time symbol checking. Only FFmpeg and libcurl use link-time stubs because the sysroot lacks them or ships a different SONAME.

Why does the build fail with cannot find -lSDL2 or -lplayerAPIs?

These linker errors indicate a wrong or incomplete sysroot, usually from a partial download or a stale WEBOS_SDK path. Re-extract the NDK and verify the libraries exist with `find $SYSROOT -name 'libplayerAPIs.so*'`.

When should I add a link-time stub instead of linking a real library?

Prefer linking real sysroot libraries via LIBS_REAL whenever the sysroot ships them. Only write a stub when the sysroot lacks the library entirely, like FFmpeg, or ships a different SONAME than the TV expects, like libcurl.so.5.