Unofficial
On this page
  1. 01What the Toolchains page offers
  2. 02A runtime in your shell
  3. 03Build environments
  4. 04Compile a program in an environment
  5. 05Check it with the ELF inspector

Compilers, runtimes and build environments on your NAS

QTS has no compiler. Bucket & Code Server IDE downloads language runtimes, cross compilers and whole Linux systems to build in, checks each download against its sha256, and keeps them in its data folder. This guide installs nothing new: it uses what a builder environment and the Go runtime give, compiles a small program and checks that it runs on the NAS.

  1. Catalogruntimes, compilers, systems
  2. Runtimeeval "$(bvs use …)"
  3. Environmenta Linux system to build in
  4. Buildbvs env run
  5. Checkthe ELF inspector

The pictures come from the panel of Bucket & Code Server IDE on a test NAS whose data folder is /share/CACHEDEV1_DATA/BucketVS.

01What the Toolchains page offers

The Toolchains page lists a catalog in tabs:

TypeWhat it isExamples
Root filesystema Linux system to unpack into an environmentDebian 12 and 13, Ubuntu 22.04 and 24.04, Alpine 3.22
Cross toolchaina compiler that builds for another processorBootlin toolchains for aarch64, x86-64 and armv7, with glibc or musl
Runtimea language or a build toolPython, Go, Node.js, Zig, Rust, CMake, Ninja, Java
QNAPQNAP's own build kitQDK 2.5.0, for bvs qbuild and Export as QPKG
The Runtimes tab: Go 1.27 installed, with bvs use and Remove; Zig 0.15 with its Install button
  • Install is an admin's. The job downloads the archive into toolchains/cache/ of the data folder, checks its sha256 against the catalog (a mismatch deletes the file) and unpacks a runtime or a cross toolchain into toolchains/<kind>/<id>. Its progress is on the Jobs page, and an interrupted download resumes when the install starts again.
  • Entries for another processor are hidden. The Bootlin cross toolchains run on x86_64, so an ARM NAS has none.
  • The catalog comes with the package. A signed catalog from pub.qnaputilities.com can add entries without a new package; Refresh the catalog fetches it at once, and a built-in cron job every day.
The QNAP tab: QNAP QDK 2.5.0 (qbuild) installed

02A runtime in your shell

bvs use on an installed entry shows the lines that put it to use in a shell, such as the editor's terminal or a cron job.

The installed Go 1.27 entry on the Toolchains page: what it builds, where it is on disk, and what bvs use go-1.27-x86_64 prints: export PATH with the runtime's bin folder, export CGO_ENABLED=0
# in the editor's terminal (Open the editor on the Editor settings page)
eval "$(bvs use go-1.27-x86_64)"
go version
go build -o hello-go hello.go
./hello-go

The Go runtime sets CGO_ENABLED=0, so its programs are static and run on any NAS of the same processor. A cross toolchain works the same way: eval "$(bvs use bootlin-aarch64-glibc-stable)" gives a compiler for ARM 64-bit units.

03Build environments

An environment is a Linux system unpacked into envs/<name> of the data folder. You can install packages in it (apt install build-essential on Debian or Ubuntu), and what you install stays there. The projects folder of the data folder is /projects inside it.

  • The quickest one with everything for building is a preset of the Apps page's Examples (an admin's): the Ubuntu 24.04 builder installs the build tools with apt-get before it appears. Its glibc is 2.39, the lowest of every NAS the package runs on, so what it builds runs on all of them. The Examples card Ubuntu 24.04 builder (full): the packages its create job installs, the root filesystem it needs, and Use this example
  • New environment (an admin's) unpacks a plain root filesystem under a name you choose, and downloads it first when it is not installed. The New environment dialog: Name deb12, Root filesystem Debian 12 bookworm, glibc 2.36, and the Create button
  • Each environment has Open a shell, which opens the editor with a terminal already inside it, Clone, Export and Delete. The environments debian12-builder (glibc 2.36) and ubuntu2404-builder (glibc 2.39), each with Open a shell, Clone, Export and Delete, and its bvs env shell command

04Compile a program in an environment

From any terminal on the NAS, bvs env shell <name> enters an environment and bvs env run <name> -- <command> runs one command in it. Both start in the folder you run them from: a folder under the projects folder is the same folder under /projects inside.

# hello.cpp in a folder of projects/, in the editor's terminal
bvs env run ubuntu2404-builder -- g++ -O2 -o hello hello.cpp
./hello

The compiler and its libraries come from the environment; the program runs on the NAS itself. Whether it finds what it needs there is the next step.

05Check it with the ELF inspector

The Toolchains page's ELF inspector tab (developer role) reads a program or library and the target's own loader data, without running anything, and says whether this NAS or an environment gives it what it needs. Choose where the file is (an app's build, the projects folder, an environment, or for an admin any file on the NAS), the target, and press Inspect.

The ELF inspector: The projects folder chosen, Path hello/hello, Target This NAS (x86_64), LD_LIBRARY_PATH empty Findings: seen on the NAS, x86_64, glibc 2.43, 6 ELF files read, 0 errors, 0 warnings; No finding: every need of the 6 files is found, in a version it defines

What it needs draws the program, the libraries it loads and where each one is found, with the versions it asks for. Here the C++ program needs libstdc++.so.6 and libc.so.6, and this NAS has both in versions they define.

What it needs: hello linked to ld-linux-x86-64.so.2, libc.so.6, libgcc_s.so.1, libm.so.6 and libstdc++.so.6 from the NAS, and the versions it needs: GLIBC_2.34, GLIBCXX_3.4.32 and others
  • A missing library, a version a library lacks, or a glibc newer than the target's is a finding with its reason. Choose an environment as the target to see the same program as it would run there.
  • On the NAS, bvs ldd <file> prints the same, and bvs ldd --env <name> <file> for an environment.
  • For programs you ship, the App Builder does this for every file of every build, and its Dependencies tab offers the fixes.