Bincompat helloworld g++ - #113
Open
Antonio-88 wants to merge 2 commits into
Open
Conversation
Antonio-88
marked this pull request as ready for review
July 8, 2026 12:56
Antonio-88
marked this pull request as draft
July 8, 2026 12:57
Antonio-88
force-pushed
the
bincompat-helloworld-g++
branch
from
July 11, 2026 10:44
fbac4b5 to
b5e4639
Compare
Antonio-88
marked this pull request as ready for review
July 11, 2026 10:45
There was a problem hiding this comment.
Pull request overview
Adds two new Unikraft binary-compatibility examples that run Linux-ELF C++ programs via the ELF loader: a minimal “hello” and a simple HTTP server, including rootfs build artifacts, platform run scripts, and scripted test harnesses.
Changes:
- Introduce
bincompat-c++-hello: C++ “Bye, World!” ELF + QEMU/Firecracker build/run/test scripts. - Introduce
bincompat-c++-http: statically-linked HTTP server ELF + QEMU/Firecracker build/run/test scripts. - Add documentation and helper scripts (
setup.sh,.scripts/*, Firecracker JSON configs) to automate setup/build/run/test flows.
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| bincompat-c++-http/setup.sh | Creates workdir/ and symlinks required repo(s) into it. |
| bincompat-c++-http/rootfs/Makefile | Builds the Linux-ELF HTTP server binary for inclusion in the initrd. |
| bincompat-c++-http/rootfs/http_server.cpp | Implements a simple socket-based HTTP server returning “Bye, World!”. |
| bincompat-c++-http/rootfs/.gitignore | Ignores the built http_server binary in rootfs. |
| bincompat-c++-http/README.md | Documents build/run workflow for the HTTP server on Unikraft ELF loader. |
| bincompat-c++-http/fc.x86_64.json | Firecracker config to boot the ELF loader with initrd and run /http_server. |
| bincompat-c++-http/.scripts/test/wrapper.sh | Test wrapper intended to validate the app behavior after starting a VM. |
| bincompat-c++-http/.scripts/test/README.md | Documents the scripted test flow for this app. |
| bincompat-c++-http/.scripts/test/common.sh | Common test helpers (cleanup, start instance, curl/ping checks). |
| bincompat-c++-http/.scripts/test/all.sh | Runs build+run smoke tests for qemu/fc variants and logs output. |
| bincompat-c++-http/.scripts/test/.gitignore | Ignores test logs directory. |
| bincompat-c++-http/.scripts/run/qemu.x86_64 | Starts QEMU with networking and runs /http_server under elfloader. |
| bincompat-c++-http/.scripts/run/fc.x86_64 | Starts Firecracker using fc.x86_64.json. |
| bincompat-c++-http/.scripts/README.md | Documents .scripts build/run usage. |
| bincompat-c++-http/.scripts/common.sh | Sets elfloader base app and provides helper to build it. |
| bincompat-c++-http/.scripts/build/rootfs.x86_64 | Builds rootfs ELF and packages initrd.cpio. |
| bincompat-c++-http/.scripts/build/qemu.x86_64 | Builds rootfs + qemu kernel for base elfloader app. |
| bincompat-c++-http/.scripts/build/kernel.qemu.x86_64 | Builds elfloader base kernel for QEMU. |
| bincompat-c++-http/.scripts/build/kernel.fc.x86_64 | Builds elfloader base kernel for Firecracker. |
| bincompat-c++-http/.scripts/build/fc.x86_64 | Builds rootfs + fc kernel for base elfloader app. |
| bincompat-c++-http/.gitignore | Ignores local build outputs (workdir/, initrd.cpio). |
| bincompat-c++-hello/setup.sh | Creates workdir/ and symlinks required repo(s) into it. |
| bincompat-c++-hello/rootfs/Makefile | Builds the Linux-ELF C++ hello binary for inclusion in the initrd. |
| bincompat-c++-hello/rootfs/helloworld.cpp | Implements the “Bye, World!” C++ hello program. |
| bincompat-c++-hello/rootfs/.gitignore | Ignores the built hello-c++ binary in rootfs. |
| bincompat-c++-hello/README.md | Documents build/run workflow for the C++ hello app on Unikraft ELF loader. |
| bincompat-c++-hello/fc.x86_64.json | Firecracker config to boot the ELF loader and run /hello-c++. |
| bincompat-c++-hello/.scripts/test/wrapper.sh | Test wrapper that checks for expected output. |
| bincompat-c++-hello/.scripts/test/README.md | Documents the scripted test flow for this app. |
| bincompat-c++-hello/.scripts/test/common.sh | Common test helpers (cleanup, start instance, curl/ping checks). |
| bincompat-c++-hello/.scripts/test/all.sh | Runs build+run smoke tests for qemu/fc variants and logs output. |
| bincompat-c++-hello/.scripts/test/.gitignore | Ignores test logs directory. |
| bincompat-c++-hello/.scripts/run/qemu.x86_64 | Starts QEMU and runs /hello-c++ under elfloader. |
| bincompat-c++-hello/.scripts/run/fc.x86_64 | Starts Firecracker using fc.x86_64.json. |
| bincompat-c++-hello/.scripts/common.sh | Sets elfloader base app and provides helper to build it. |
| bincompat-c++-hello/.scripts/build/rootfs.x86_64 | Builds rootfs ELF and packages initrd.cpio. |
| bincompat-c++-hello/.scripts/build/qemu.x86_64 | Builds rootfs + qemu kernel for base elfloader app. |
| bincompat-c++-hello/.scripts/build/kernel.qemu.x86_64 | Builds elfloader base kernel for QEMU. |
| bincompat-c++-hello/.scripts/build/kernel.fc.x86_64 | Builds elfloader base kernel for Firecracker. |
| bincompat-c++-hello/.scripts/build/fc.x86_64 | Builds rootfs + fc kernel for base elfloader app. |
| bincompat-c++-hello/.gitignore | Ignores local build outputs (workdir). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Antonio Mincu <mincu_antonio@icloud.com>
Signed-off-by: Antonio Mincu <mincu_antonio@icloud.com>
Antonio-88
force-pushed
the
bincompat-helloworld-g++
branch
from
July 11, 2026 12:02
58f6a28 to
ffc0ee6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 41 out of 41 changed files in this pull request and generated no new comments.
Suppressed comments (7)
bincompat-c++-http/README.md:4
- The README claims this app is based on
elfloader-net, but the linked README points to../elfloader-basic/README.md, which is inconsistent and likely confusing for users following setup instructions.
bincompat-c++-http/README.md:37 - The Quick Setup section links to a non-existent "Close QEMU" section (
#close-qemu). This link is broken and duplicates the guidance already covered by the "Forcefully Terminating a Machine" section.
bincompat-c++-http/fc.x86_64.json:6 - This Firecracker config points to
../elfloader-basic/..., but this app (and its scripts) are based onelfloader-net. As written, the run script’s base-kernel check can pass while Firecracker boots a different (or missing) kernel.
bincompat-c++-http/.scripts/test/wrapper.sh:18 - The test starts ping/curl immediately after spawning the VM, which is likely to be flaky because the guest network stack and HTTP server may not be ready yet. Other HTTP app wrappers wait briefly before probing (e.g.
cpp-http/.scripts/test/wrapper.sh:28-31).
bincompat-c++-http/rootfs/Makefile:1 - Hardcoding
CXX = g++prevents users from overriding the compiler via environment/CLI (and differs from other rootfs Makefiles in this repo which rely on$(CXX)without setting it, e.g.elfloader-basic/rootfs/Makefile). Consider using?=soCXX=/path/to/compiler make ...works.
bincompat-c++-hello/rootfs/Makefile:1 - Hardcoding
CXX = g++prevents overriding the compiler via environment/CLI. For consistency with other rootfs Makefiles (which rely on$(CXX)without setting it), prefer?=here.
CXX = g++
bincompat-c++-http/rootfs/http_server.cpp:7
std::stringis used below, but<string>isn’t included. Relying on transitive includes from<iostream>is non-portable and can break with different standard library implementations/toolchains.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added bincompat-c++-hello
Added bincompat-c++-http