[build] F: Pin newlib to _do_start-weak commit, restore reproducible newlib checkout#14
Draft
esaurez wants to merge 1 commit into
Draft
Conversation
…newlib checkout Two related fixes, both touching the newlib clone step of the toolchain Dockerfile: 1. Bump NEWLIB_COMMIT to the merge commit of nanvix/newlib#17 ("[libc] F: Weaken _do_start so libnvx_crt0.a can override it cleanly"). After the new image is republished, consumers linking Nanvix's libnvx_crt0.a no longer need `-Wl,--allow-multiple-definition` on their guest test ELF link lines. The SHA above is a placeholder for #17's branch HEAD and must be re-pointed at the upstream merge commit before this PR merges. 2. Restore reproducibility of the newlib checkout. The prior `git clone --branch dev --single-branch --depth=1` step silently used the tip of `dev` regardless of the declared NEWLIB_COMMIT pin, so every toolchain image rebuild could pick up a different newlib commit even when NEWLIB_COMMIT was unchanged. Removing `--depth=1 --single-branch` and adding an explicit `git checkout ${NEWLIB_COMMIT}` after the clone restores the pin. This is the same shape already used by the binutils and gcc clone steps in this file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Jun 9, 2026
Open
esaurez
added a commit
to esaurez/libxml2
that referenced
this pull request
Jun 9, 2026
… working 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-cutover and post-cutover sysroots: - Pre-cutover (sysroot built before nanvix/nanvix#2453): libnvx_crt0.a does not exist; wildcard expands to empty; `_start` continues to come from libposix.a as before. - Post-cutover (sysroot built after nanvix/nanvix#2453): 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 today both contain duplicate strong definitions of the sys-crate `__kcall_*` FFI symbols, `_do_exit_thread`, and `_do_start_thread`. All 36 of those duplicates are addressed by nanvix/nanvix#2487 (sys-ffi crate split), which moves the `#[no_mangle]` exports out of `sys` into a dedicated crate that only `libposix.a` links. The remaining 37th duplicate (`_do_start` colliding between libnvx_crt0 and newlib's prebuilt `crt0.o`) is addressed by nanvix/newlib#17 (`.weak _do_start` so libnvx_crt0's strong SSE-aligned override wins cleanly). Once both have landed and the toolchain image republished from nanvix/toolchain-gcc#14, `--allow-multiple-definition` can be dropped in a follow-up commit. Validated by building the test ELF and booting it through `nanvixd` against a locally-built nanvix sysroot that contains the cutover. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
esaurez
added a commit
to esaurez/libxml2
that referenced
this pull request
Jun 9, 2026
… `-Wl,--allow-multiple-definition` flag was added in the previouscommit to silently coalesce 37 duplicate strong symbols that appearedin 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: nanvix/nanvix#2487. * The remaining `_do_start` by declaring newlib's stub `.weak` so libnvx_crt0's strong SSE-aligned override wins cleanly: nanvix/newlib#17, plus the toolchain image republish in nanvix/toolchain-gcc#14.Once all three of the above have merged and the toolchain image isrepublished with the new newlib commit, the link line no longerneeds `--allow-multiple-definition`.MERGE ORDER: do NOT merge this PR until ALL of the following havelanded: 1. nanvix/nanvix#2487 (sys-ffi crate split) -- already filed. 2. nanvix/newlib#17 (.weak _do_start) -- already filed. 3. nanvix/toolchain-gcc#14 (republish image with new newlib) -- already filed; draft until newlib#17 merges. 4. The toolchain image at ghcr.io/nanvix/toolchain-gcc has been republished from nanvix#14 with the new newlib commit. 5. The parent E: PR adding the libnvx_crt0.a wildcard link entry, which this PR is stacked on top of.If merged early, the .so / test ELF link step will fail with"multiple definition of __kcall_*" errors.Validated end-to-end against a locally-rebuilt toolchain imagecarrying the newlib nanvix#17 change: the resulting ELF's `_do_start`entry point is libnvx_crt0's SSE-aligned variant (`and $0xfffffff0,%esp ; sub $0x8, %esp ; push ; push ; call _start`) -- the latentSSE-alignment bug present in shipping binaries today is fixed.Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
esaurez
added a commit
to esaurez/libxslt
that referenced
this pull request
Jun 9, 2026
… working 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-cutover and post-cutover sysroots: - Pre-cutover (sysroot built before nanvix/nanvix#2453): libnvx_crt0.a does not exist; wildcard expands to empty; `_start` continues to come from libposix.a as before. - Post-cutover (sysroot built after nanvix/nanvix#2453): 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 today both contain duplicate strong definitions of the sys-crate `__kcall_*` FFI symbols, `_do_exit_thread`, and `_do_start_thread`. All 36 of those duplicates are addressed by nanvix/nanvix#2487 (sys-ffi crate split), which moves the `#[no_mangle]` exports out of `sys` into a dedicated crate that only `libposix.a` links. The remaining 37th duplicate (`_do_start` colliding between libnvx_crt0 and newlib's prebuilt `crt0.o`) is addressed by nanvix/newlib#17 (`.weak _do_start` so libnvx_crt0's strong SSE-aligned override wins cleanly). Once both have landed and the toolchain image republished from nanvix/toolchain-gcc#14, `--allow-multiple-definition` can be dropped in a follow-up commit. Validated by building the test ELF and booting it through `nanvixd` against a locally-built nanvix sysroot that contains the cutover. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
esaurez
added a commit
to esaurez/libxslt
that referenced
this pull request
Jun 9, 2026
… `-Wl,--allow-multiple-definition` flag was added in the previouscommit to silently coalesce 37 duplicate strong symbols that appearedin 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: nanvix/nanvix#2487. * The remaining `_do_start` by declaring newlib's stub `.weak` so libnvx_crt0's strong SSE-aligned override wins cleanly: nanvix/newlib#17, plus the toolchain image republish in nanvix/toolchain-gcc#14.Once all three of the above have merged and the toolchain image isrepublished with the new newlib commit, the link line no longerneeds `--allow-multiple-definition`.MERGE ORDER: do NOT merge this PR until ALL of the following havelanded: 1. nanvix/nanvix#2487 (sys-ffi crate split) -- already filed. 2. nanvix/newlib#17 (.weak _do_start) -- already filed. 3. nanvix/toolchain-gcc#14 (republish image with new newlib) -- already filed; draft until newlib#17 merges. 4. The toolchain image at ghcr.io/nanvix/toolchain-gcc has been republished from nanvix#14 with the new newlib commit. 5. The parent E: PR adding the libnvx_crt0.a wildcard link entry, which this PR is stacked on top of.If merged early, the .so / test ELF link step will fail with"multiple definition of __kcall_*" errors.Validated end-to-end against a locally-rebuilt toolchain imagecarrying the newlib nanvix#17 change: the resulting ELF's `_do_start`entry point is libnvx_crt0's SSE-aligned variant (`and $0xfffffff0,%esp ; sub $0x8, %esp ; push ; push ; call _start`) -- the latentSSE-alignment bug present in shipping binaries today is fixed.Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
esaurez
added a commit
to esaurez/lxml
that referenced
this pull request
Jun 9, 2026
… working 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-cutover and post-cutover sysroots: - Pre-cutover (sysroot built before nanvix/nanvix#2453): libnvx_crt0.a does not exist; wildcard expands to empty; `_start` continues to come from libposix.a as before. - Post-cutover (sysroot built after nanvix/nanvix#2453): 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 today both contain duplicate strong definitions of the sys-crate `__kcall_*` FFI symbols, `_do_exit_thread`, and `_do_start_thread`. All 36 of those duplicates are addressed by nanvix/nanvix#2487 (sys-ffi crate split), which moves the `#[no_mangle]` exports out of `sys` into a dedicated crate that only `libposix.a` links. The remaining 37th duplicate (`_do_start` colliding between libnvx_crt0 and newlib's prebuilt `crt0.o`) is addressed by nanvix/newlib#17 (`.weak _do_start` so libnvx_crt0's strong SSE-aligned override wins cleanly). Once both have landed and the toolchain image republished from nanvix/toolchain-gcc#14, `--allow-multiple-definition` can be dropped in a follow-up commit. Validated by building the test ELF and booting it through `nanvixd` against a locally-built nanvix sysroot that contains the cutover. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
esaurez
added a commit
to esaurez/lxml
that referenced
this pull request
Jun 9, 2026
… `-Wl,--allow-multiple-definition` flag was added in the previouscommit to silently coalesce 37 duplicate strong symbols that appearedin 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: nanvix/nanvix#2487. * The remaining `_do_start` by declaring newlib's stub `.weak` so libnvx_crt0's strong SSE-aligned override wins cleanly: nanvix/newlib#17, plus the toolchain image republish in nanvix/toolchain-gcc#14.Once all three of the above have merged and the toolchain image isrepublished with the new newlib commit, the link line no longerneeds `--allow-multiple-definition`.MERGE ORDER: do NOT merge this PR until ALL of the following havelanded: 1. nanvix/nanvix#2487 (sys-ffi crate split) -- already filed. 2. nanvix/newlib#17 (.weak _do_start) -- already filed. 3. nanvix/toolchain-gcc#14 (republish image with new newlib) -- already filed; draft until newlib#17 merges. 4. The toolchain image at ghcr.io/nanvix/toolchain-gcc has been republished from nanvix#14 with the new newlib commit. 5. The parent E: PR adding the libnvx_crt0.a wildcard link entry, which this PR is stacked on top of.If merged early, the .so / test ELF link step will fail with"multiple definition of __kcall_*" errors.Validated end-to-end against a locally-rebuilt toolchain imagecarrying the newlib nanvix#17 change: the resulting ELF's `_do_start`entry point is libnvx_crt0's SSE-aligned variant (`and $0xfffffff0,%esp ; sub $0x8, %esp ; push ; push ; call _start`) -- the latentSSE-alignment bug present in shipping binaries today is fixed.Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
esaurez
added a commit
to esaurez/libffi
that referenced
this pull request
Jun 9, 2026
… working 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-cutover and post-cutover sysroots: - Pre-cutover (sysroot built before nanvix/nanvix#2453): libnvx_crt0.a does not exist; wildcard expands to empty; `_start` continues to come from libposix.a as before. - Post-cutover (sysroot built after nanvix/nanvix#2453): 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 today both contain duplicate strong definitions of the sys-crate `__kcall_*` FFI symbols, `_do_exit_thread`, and `_do_start_thread`. All 36 of those duplicates are addressed by nanvix/nanvix#2487 (sys-ffi crate split), which moves the `#[no_mangle]` exports out of `sys` into a dedicated crate that only `libposix.a` links. The remaining 37th duplicate (`_do_start` colliding between libnvx_crt0 and newlib's prebuilt `crt0.o`) is addressed by nanvix/newlib#17 (`.weak _do_start` so libnvx_crt0's strong SSE-aligned override wins cleanly). Once both have landed and the toolchain image republished from nanvix/toolchain-gcc#14, `--allow-multiple-definition` can be dropped in a follow-up commit. Validated by building the test ELF and booting it through `nanvixd` against a locally-built nanvix sysroot that contains the cutover. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
esaurez
added a commit
to esaurez/libffi
that referenced
this pull request
Jun 9, 2026
… `-Wl,--allow-multiple-definition` flag was added in the previouscommit to silently coalesce 37 duplicate strong symbols that appearedin 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: nanvix/nanvix#2487. * The remaining `_do_start` by declaring newlib's stub `.weak` so libnvx_crt0's strong SSE-aligned override wins cleanly: nanvix/newlib#17, plus the toolchain image republish in nanvix/toolchain-gcc#14.Once all three of the above have merged and the toolchain image isrepublished with the new newlib commit, the link line no longerneeds `--allow-multiple-definition`.MERGE ORDER: do NOT merge this PR until ALL of the following havelanded: 1. nanvix/nanvix#2487 (sys-ffi crate split) -- already filed. 2. nanvix/newlib#17 (.weak _do_start) -- already filed. 3. nanvix/toolchain-gcc#14 (republish image with new newlib) -- already filed; draft until newlib#17 merges. 4. The toolchain image at ghcr.io/nanvix/toolchain-gcc has been republished from nanvix#14 with the new newlib commit. 5. The parent E: PR adding the libnvx_crt0.a wildcard link entry, which this PR is stacked on top of.If merged early, the .so / test ELF link step will fail with"multiple definition of __kcall_*" errors.Validated end-to-end against a locally-rebuilt toolchain imagecarrying the newlib nanvix#17 change: the resulting ELF's `_do_start`entry point is libnvx_crt0's SSE-aligned variant (`and $0xfffffff0,%esp ; sub $0x8, %esp ; push ; push ; call _start`) -- the latentSSE-alignment bug present in shipping binaries today is fixed.Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
esaurez
added a commit
to esaurez/openssl
that referenced
this pull request
Jun 9, 2026
… working 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-cutover and post-cutover sysroots: - Pre-cutover (sysroot built before nanvix/nanvix#2453): libnvx_crt0.a does not exist; wildcard expands to empty; `_start` continues to come from libposix.a as before. - Post-cutover (sysroot built after nanvix/nanvix#2453): 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 today both contain duplicate strong definitions of the sys-crate `__kcall_*` FFI symbols, `_do_exit_thread`, and `_do_start_thread`. All 36 of those duplicates are addressed by nanvix/nanvix#2487 (sys-ffi crate split), which moves the `#[no_mangle]` exports out of `sys` into a dedicated crate that only `libposix.a` links. The remaining 37th duplicate (`_do_start` colliding between libnvx_crt0 and newlib's prebuilt `crt0.o`) is addressed by nanvix/newlib#17 (`.weak _do_start` so libnvx_crt0's strong SSE-aligned override wins cleanly). Once both have landed and the toolchain image republished from nanvix/toolchain-gcc#14, `--allow-multiple-definition` can be dropped in a follow-up commit. Validated by building the test ELF and booting it through `nanvixd` against a locally-built nanvix sysroot that contains the cutover. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
esaurez
added a commit
to esaurez/openssl
that referenced
this pull request
Jun 9, 2026
… `-Wl,--allow-multiple-definition` flag was added in the previouscommit to silently coalesce 37 duplicate strong symbols that appearedin 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: nanvix/nanvix#2487. * The remaining `_do_start` by declaring newlib's stub `.weak` so libnvx_crt0's strong SSE-aligned override wins cleanly: nanvix/newlib#17, plus the toolchain image republish in nanvix/toolchain-gcc#14.Once all three of the above have merged and the toolchain image isrepublished with the new newlib commit, the link line no longerneeds `--allow-multiple-definition`.MERGE ORDER: do NOT merge this PR until ALL of the following havelanded: 1. nanvix/nanvix#2487 (sys-ffi crate split) -- already filed. 2. nanvix/newlib#17 (.weak _do_start) -- already filed. 3. nanvix/toolchain-gcc#14 (republish image with new newlib) -- already filed; draft until newlib#17 merges. 4. The toolchain image at ghcr.io/nanvix/toolchain-gcc has been republished from nanvix#14 with the new newlib commit. 5. The parent E: PR adding the libnvx_crt0.a wildcard link entry, which this PR is stacked on top of.If merged early, the .so / test ELF link step will fail with"multiple definition of __kcall_*" errors.Validated end-to-end against a locally-rebuilt toolchain imagecarrying the newlib nanvix#17 change: the resulting ELF's `_do_start`entry point is libnvx_crt0's SSE-aligned variant (`and $0xfffffff0,%esp ; sub $0x8, %esp ; push ; push ; call _start`) -- the latentSSE-alignment bug present in shipping binaries today is fixed.Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
esaurez
pushed a commit
to esaurez/libffi
that referenced
this pull request
Jun 9, 2026
…finition 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. Also drop `-Wl,--allow-multiple-definition` from the link line. The flag was previously needed to coalesce duplicate strong symbols (`__kcall_*`, `_do_exit_thread`, `_do_start_thread`, `_do_start`) that appeared in both `libnvx_crt0.a` and `libposix.a`. All of those duplicates are now resolved upstream: * nanvix/nanvix#2487 -- sys-ffi crate split that removes the `__kcall_*` / `_do_exit_thread` / `_do_start_thread` duplicates from `libnvx_crt0.a`. * nanvix/newlib#17 -- declares newlib's `_do_start` as `.weak` so libnvx_crt0's strong SSE-aligned override wins cleanly. * nanvix/toolchain-gcc#14 -- pins the new newlib commit and triggers a republish of the toolchain image. This PR depends on all three above having merged AND the toolchain image at `ghcr.io/nanvix/toolchain-gcc` having been republished with the new newlib bundled in. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Two related fixes, both touching the newlib clone step of the toolchain Dockerfile.
1. Bump
NEWLIB_COMMITto the_do_startweakeningUpdates
ARG NEWLIB_COMMITto point at the merge commit of nanvix/newlib#17 ("[libc] F: Weaken_do_startsolibnvx_crt0.acan override it cleanly"). Once the new toolchain image is republished, consumers linking Nanvix'slibnvx_crt0.awill no longer need-Wl,--allow-multiple-definitionon their guest test ELF link lines. The SHA in the diff is a placeholder pointing at #17's branch HEAD and must be re-pointed at the upstream merge commit before this PR merges.2. Restore reproducibility of the newlib checkout
The prior
git clone --branch dev --single-branch --depth=1step silently used the tip ofdevregardless of the declaredNEWLIB_COMMITpin, so every toolchain image rebuild could pick up a different newlib commit even whenNEWLIB_COMMITwas unchanged. Removing--depth=1 --single-branchand adding an explicitgit checkout ${NEWLIB_COMMIT}after the clone restores the pin. The new shape is identical to the binutils and gcc clone steps in the same file.This is independently useful even if the SHA bump is reverted: it makes the toolchain build reproducible against any pinned newlib commit, not just the one for #17.
Diff
Validation
Reviewers who want to confirm the effect of #17 on the produced toolchain sysroot without waiting for a full toolchain rebuild can use the small local-only Dockerfile below. It starts from the official toolchain image, surgically reassembles
crt0.Sfrom a patched newlib tree, overlays the resultingcrt0.oonto the sysroot, and asserts that_do_startbecomes a weak symbol.The same companion changes already in flight in the rest of the chain provide the consumer-side proof:
.weak _do_startchange.__kcall_*x 34,_do_exit_thread,_do_start_thread) out oflibnvx_crt0.ainto a dedicatedsys-fficrate. After both this PR (republished image) and #2487 land, every Nanvix link line can drop-Wl,--allow-multiple-definition.Local validation
Dockerfile(not committed; copy and run from a sibling toolchain-gcc + newlib checkout pair)End-to-end with this local patch in place, posix-tests integration suites and libxml2 functional tests link cleanly without
-Wl,--allow-multiple-definition, and the SSE-aligned_do_startfromlibnvx_crt0.ashows up at the entry point in the produced ELFs.Merge ordering
This PR depends on nanvix/newlib#17 merging first so the
NEWLIB_COMMITSHA above can be re-pointed at the upstream merge commit. Once both land and CI republishes the toolchain image, consumer-side follow-up PRs innanvix/nanvixand the port-library repositories will drop-Wl,--allow-multiple-definitionfrom every link line. Those follow-up PRs are in progress.