[build] E: Link libnvx_crt0.a into test ELF#74
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Nanvix build/test integration for this libxml2 repo. It adds libnvx_crt0.a to the test ELF link to ensure the correct _start is pulled on post-PR-11b sysroots, and it also expands the build to produce a shared libxml2.so plus packaging targets.
Changes:
- Add
libnvx_crt0.a(via$(wildcard ...)) to the test ELF link group and add--allow-multiple-definitionto work around current duplicate symbols. - Extend the Nanvix build to produce
.libs/libxml2.sofrom the PIC objects in.libs/libxml2.a, and add validation checks for the shared library intest-functional. - Add
package/verify-packagetargets and adjust clean behavior (but removes prior install/staging behavior).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
.nanvix/z.py |
Updates tracked Docker copy-back outputs and staged artifacts list to include libxml2.so. |
.nanvix/Makefile.nanvix |
Updates build/test rules: links libnvx_crt0.a into test ELF, adds .so build/validation, introduces packaging targets, and changes staging/clean behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a2ad98f to
6117813
Compare
nanvix/nanvix#2453 moved the `_start` entry point out of `libposix.a` into a new `libnvx_crt0.a`. Add `libnvx_crt0.a` to the test ELF link line so `_start` is found at link time; otherwise the linker silently picks newlib's weak fallback and the test hangs at startup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6117813 to
b290960
Compare
|
All prior review comments on this PR are stale and have been superseded by a rework. The PR was originally filed as a much larger change that included Wave 3 The PR has now been re-scoped to a single straightforward change: add Marking the prior comments as obsolete. If anything in the current 1-line diff still warrants discussion, please file a fresh comment. |
Summary
nanvix/nanvix#2453 (already upstream) moved the
_startentry point out oflibposix.ainto a newlibnvx_crt0.a. Addlibnvx_crt0.ato the test ELF link line so the linker resolves_startfrom it; without this the linker silently picks newlib's weak default_startand the test hangs at startup with no diagnostic output.Dependencies
This PR assumes the following have already merged and the toolchain image has been republished:
sys-fficrate split that removes the duplicate__kcall_*/_do_exit_thread/_do_start_threadstrong symbols fromlibnvx_crt0.a._do_startas.weaksolibnvx_crt0's strong SSE-aligned override wins cleanly without-Wl,--allow-multiple-definition.ghcr.io/nanvix/toolchain-gcc.If those have not landed, the link line will fail with
multiple definition of __kcall_*errors against the unpatched toolchain image.What changes
One line added to the test ELF link line:
$(SYSROOT_PATH)/lib/libnvx_crt0.aplaced inside the existing--start-groupahead oflibposix.a, so the linker resolves_startfrom libnvx_crt0's strong symbol.