From 158fbbce2836543e9536d2cd2d14070e765aba57 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 6 Jun 2026 10:54:06 +0000 Subject: [PATCH 1/4] [ci] E: Pin nanvix to v0.16.16 --- .nanvix/nanvix.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nanvix/nanvix.toml b/.nanvix/nanvix.toml index 428c28e8e124f..0bd2eada18a82 100644 --- a/.nanvix/nanvix.toml +++ b/.nanvix/nanvix.toml @@ -1,7 +1,7 @@ [package] name = "openssl" version = "3.5.0" -nanvix-version = "0.16.12" +nanvix-version = "0.16.16" [builds] [builds.matrix] From 4d0e3301430aeaba215e421fa909745fd9e9f540 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 7 Jun 2026 11:09:32 +0000 Subject: [PATCH 2/4] [ci] E: Pin nanvix to v0.16.17 --- .nanvix/nanvix.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nanvix/nanvix.toml b/.nanvix/nanvix.toml index 0bd2eada18a82..0b216e97c94cd 100644 --- a/.nanvix/nanvix.toml +++ b/.nanvix/nanvix.toml @@ -1,7 +1,7 @@ [package] name = "openssl" version = "3.5.0" -nanvix-version = "0.16.16" +nanvix-version = "0.16.17" [builds] [builds.matrix] From 3ddacc4c96d2b6ed2689c8cfa7e0c51f41d89bf0 Mon Sep 17 00:00:00 2001 From: esaurez Date: Mon, 8 Jun 2026 11:23:31 -0700 Subject: [PATCH 3/4] [build] E: Link libnvx_crt0.a into test ELF for PR-11b compatibility PR-11b (nanvix/nanvix#2453) moves the `_start` entry point out of `libposix.a` into a new `libnvx_crt0.a`. Consumers that link only libposix + libc fall back to newlib's weak default `_start` and hang at startup with no diagnostic output. Add `libnvx_crt0.a` to the test ELF link line, placed inside the existing `--start-group` ahead of `libposix.a` so the linker resolves the entry point from libnvx_crt0's strong `_start` (T symbol) over newlib's weak fallback. The path is wrapped in `$(wildcard ...)` so the same Makefile works on both pre-PR-11b and post-PR-11b sysroots: - Pre-PR-11b: libnvx_crt0.a does not exist; wildcard expands to empty; `_start` continues to come from libposix.a as before. - Post-PR-11b: libnvx_crt0.a is present; wildcard expands; the linker pulls `_start` and the rest of the crt0 trampoline. `-Wl,--allow-multiple-definition` is required because libnvx_crt0 and libposix both bundle the `sys` Rust crate, and Rust monomorphizes its `#[no_mangle] extern "C" __kcall_*` FFI symbols into BOTH static archives as strong `T` definitions. The two copies are byte-identical (same Rust source, same `--release` profile, same compiler), so it is safe to let the linker silently take whichever it sees first. The duplicate-symbol issue is a libnvx_crt0 crate bug; once that is fixed (`libnvx_crt0` should not re-export sys-crate FFI symbols), the `--allow-multiple-definition` flag can be removed. Validated by building the test ELF and booting it through `nanvixd` against a locally-built nanvix-dev sysroot that contains PR-11b. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Makefile.nanvix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.nanvix b/Makefile.nanvix index 7abd1b6cfc56b..bfcd7fbc3435b 100644 --- a/Makefile.nanvix +++ b/Makefile.nanvix @@ -151,7 +151,10 @@ $(TEST_ELF): $(TEST_SRC) libcrypto.a libssl.a include/openssl/opensslv.h -I$(CURDIR)/include \ $(TEST_SRC) \ -L$(CURDIR) -lssl -lcrypto \ - $(NANVIX_LDFLAGS) $(NANVIX_LIBS) \ + $(NANVIX_LDFLAGS) \ + -Wl,--allow-multiple-definition \ + $(wildcard $(SYSROOT_PATH)/lib/libnvx_crt0.a) \ + $(NANVIX_LIBS) \ -o $@ # =========================================================================== From 394c322e82c0ab09ec2ee97c43bdad7caffa6941 Mon Sep 17 00:00:00 2001 From: esaurez Date: Mon, 8 Jun 2026 13:38:33 -0700 Subject: [PATCH 4/4] [build] F: Drop -Wl,--allow-multiple-definition (no longer needed) The `-Wl,--allow-multiple-definition` flag was added in the previous commit to silently coalesce 37 duplicate strong symbols that appeared in BOTH `libnvx_crt0.a` and `libposix.a`: * 34 `__kcall_*` FFI wrappers (`__kcall_lock_mutex`, `__kcall_signal_cond`, `__kcall_send`, ...) * `_do_exit_thread` (thread-exit handler) * `_do_start_thread` (asm thread-bootstrap stub) * `_do_start` (process-entry stub) These have now been resolved structurally upstream: * 36 of 37 by the `sys-ffi` crate split that moves the `#[no_mangle]` FFI exports out of `sys` into a dedicated crate that only `libposix.a` links. See nanvix/nanvix#TBD (esaurez/nanvix#30). * The remaining `_do_start` by declaring newlib's stub `.weak` so libnvx_crt0's strong SSE-aligned override wins cleanly. See nanvix/newlib#TBD (esaurez/newlib#5). With those upstream and a toolchain image republished from nanvix/toolchain-gcc#TBD (esaurez/toolchain-gcc#1) that bundles the new newlib commit, the link line no longer needs the flag. Validated end-to-end with the patched toolchain (`local-nanvix/toolchain-gcc:do_start-weak`): * posix-tests: 18 binaries built, 12 integration suites pass * libxml2 functional test: PASS * `_do_start` at the entry point is libnvx_crt0's SSE-aligned variant (`and $0xfffffff0, %esp ; sub $0x8, %esp ; push ; push ; call _start`), not newlib's 9-byte unaligned stub. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Makefile.nanvix | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile.nanvix b/Makefile.nanvix index bfcd7fbc3435b..8271f94344346 100644 --- a/Makefile.nanvix +++ b/Makefile.nanvix @@ -152,7 +152,6 @@ $(TEST_ELF): $(TEST_SRC) libcrypto.a libssl.a include/openssl/opensslv.h $(TEST_SRC) \ -L$(CURDIR) -lssl -lcrypto \ $(NANVIX_LDFLAGS) \ - -Wl,--allow-multiple-definition \ $(wildcard $(SYSROOT_PATH)/lib/libnvx_crt0.a) \ $(NANVIX_LIBS) \ -o $@