Nelua

Core

nelibc

A C library, rebuilt piece by piece in Nelua.

Replace selected libc functions with Nelua implementations, using glibc, musl or Cosmopolitan for the rest; or use the standalone runtime with no external libc. Spaceghost/nelibc is experimental, Linux x86-64, with hybrid builds working and the standalone profile in progress. The implementations are Nelua, with x86-64 assembly for memory primitives and C adapters at the runtime boundaries.

819 / 1,471 exports · glibc793 / 1,471 exports · musl / Zig399 / 1,471 exports · Cosmopolitancomparison 2026-11-21 UTC

Five runtime arrangements

The C interface stays familiar while ownership changes. Compiler choice (GCC, Zig or TinyCC) is a separate axis from the runtime supplying the missing functions.

Who owns the parts Nelibc has not replaced?
ProfileNelibc ownsUnderlying runtime
glibc hybridThe selected Nelua implementations and adaptersGNU libc supplies uncovered APIs and runtime support
musl hybridThe selected Nelua implementations, with musl-specific adaptersmusl supplies uncovered APIs and runtime support
Cosmopolitan hybridMemory, strings, narrow character classification, floating conversion, IP conversion, real and complex mathCosmopolitan owns startup, allocation, FILE streams, threads, filesystem calls, resolver and integer conversion
StandaloneIts own startup, allocator, stdio, threading subset, locale and other implemented APIsLinux x86-64 kernel services; uncovered functionality remains implementation work
HostThe standalone implementations over a callback dispatcherA kernel or embedding host supplies console, memory, clocks, TLS and exit; current pthreads are cooperative lanes on one hardware thread

The Cosmopolitan profile is deliberately narrower than the older hybrids. A FILE stream, allocation or thread must stay with the runtime that owns its state. Removing glibc does not mean removing the fallback libc. Linux x86-64 is the tested platform; cross-platform runtime conformance is not established.

Median microseconds for a 64 KiB miss on 21 November 2026. GCC 12.2, glibc 2.36 and Nelibc’s GCC hybrid ran in nine rotating rounds on an i5-10400.

Miss70bcd89 (µs)84267ab (µs)glibc (µs)
strstr · ab / aa39.363.762.52
strstr · 63 / 64 a bytes1.651.715.88
strstr · One interior b118.771.32269.79
memmem · ab / aa217.872.8844.05
memmem · 63 / 64 a bytes1.061.068.15
memmem · One interior b126.890.67268.17

First-match timings

Each cell shows the previous revision, updated revision and glibc medians in microseconds. Early matches begin near the start of the buffer. Late matches end at the last haystack byte.

Function and inputEarly match (µs)Late match (µs)
strstr · alternating0.669 / 0.010 / 0.01039.667 / 3.603 / 2.508
strstr · interior0.988 / 1.008 / 0.348118.281 / 1.662 / 268.864
strstr · runs630.908 / 0.036 / 0.0391.676 / 1.760 / 5.910
memmem · alternating0.030 / 0.004 / 0.009220.952 / 3.098 / 43.818
memmem · interior0.370 / 0.443 / 0.137116.757 / 1.064 / 270.268
memmem · runs630.227 / 0.269 / 0.0531.075 / 1.069 / 8.110

The same harness covers early and late hits, binary data, text, and seeded random bytes. For the 128-byte needle with an interior b, early memmem hits rose from 370 to 443 ns. The 64-byte uniform needle’s early memmem hit rose from 227 to 269 ns. Each timed call checked the first offset against a bytewise oracle. Guard-page checks ran before timing.

Completion: whose implementation is it?

Fresh archive-symbol census, 2026-11-21 UTC. The denominator is the same pinned musl 1.2.5 inventory for every profile. Runtime-alone and combined columns count defined names in the libc and its math/runtime companion archives: glibc libc/libm, musl plus Zig libzigc/compiler_rt, and Cosmopolitan libcosmo. Owned counts name the implementations Nelibc exports. This is symbol presence, not a test of every individual link or standards conformance. A name absent from Nelibc may still be supplied by the fallback libc.

Symbol census against the same 1,471-name inventory
ProfileRuntime aloneRuntime + NelibcOwned by Nelibc
glibc1,439 / 1,4711,444 / 1,471819 (55.7%)
musl / Zig1,471 / 1,4711,471 / 1,471793 (53.9%)
Cosmopolitan1,239 / 1,4711,257 / 1,471399 (27.1%)

Cosmopolitan is the default hybrid build at the measured revision. Its archive supplies many APIs directly. The table shows which symbols Nelibc supplies when added to each runtime. The combined count is a union, so replacing an existing function does not add another API name. The coverage explorer lists individual symbols for each profile and lets you switch inventories.

Conformance: the same tests, with and without Nelibc

musl libc-test 63e36e934e8f, functional, regression and math corpus, run 2026-11-21 UTC. Both halves of each pair use the same libc-owned headers. Every result is shown; no expected-failure list turns a failing test into a pass.

Independent libc-test outcomes; counts are tests, not assertions
BuildPlannedPassBuild failLink failRuntime failTimeoutNot run
glibc alone343301403710
glibc + Nelibc343325401310
musl / Zig alone343327011500
musl / Zig + Nelibc34333301900
Cosmopolitan alone34327911104300
Cosmopolitan + Nelibc3433011142700

Changes relative to each baseline: glibc: 24 newly passing, 0 new non-passes; musl / Zig: 7 newly passing, 1 new non-passes; Cosmopolitan: 23 newly passing, 1 new non-passes. Build and link failures count as non-passes in these deltas.

In the first conformance run on this revision, Cosmopolitan alone passed 279 tests and Cosmopolitan with Nelibc passed 301. Their timeout counts were 0 and 0, respectively. Both sets of compiled tests were then repeated in the same guest. Each executable was read into the page cache before the original supervisor started its five-second timer. The table uses the repeated pair. Initial per-test results · Repeat conditions · Corpus build identities.

The Cosmopolitan functional/popen test also ran 2,000 times each on native Cosmopolitan, previous Nelibc and current Nelibc. The child exited on SIGPIPE in 2, 1 and 4 trials respectively. The table retains the full-corpus outcomes. Test executable identities and individual failed trials.

All 9 benchmark consumers also passed 1995 targeted assertions each before timing. Those assertions cover the benchmarked operations and are separate from libc-test. The independent corpus uses libc-test's native supervisor, a 100 KiB stack limit and five-second per-test timeout. Cosmopolitan executables use its native APE loader in both halves of the pair. The corpus includes musl-specific, platform and extension expectations; a non-pass is not by itself proof of a standards violation. This is measured test coverage, not certification of all C or POSIX behavior. Historical Nelibc-header and standalone gates are listed separately below.

Tests newly failing or newly passing in each pair

glibc

New non-passes: none

New passes: functional/clocale_mbfuncs, functional/fnmatch, functional/strftime, functional/strtol, functional/wcstol, math/exp2l, math/fma, math/fmaf, math/fmax, math/fmaxf, math/fmaxl, math/fmin, math/fminf, math/fminl, math/j1, math/j1f, math/jn, math/jnf, math/powf, math/tgammaf, math/y0, math/yn, math/ynf, regression/fpclassify-invalid-ld80

musl / Zig

New non-passes: regression/sigprocmask-internal

New passes: functional/strptime, math/expl, math/fma, math/fmaf, math/fmal, math/powf, math/powl

Cosmopolitan

New non-passes: functional/popen

New passes: functional/inet_pton, functional/strtold, math/coshl, math/dremf, math/erfcf, math/exp10l, math/fma, math/fmaf, math/fmal, math/j1f, math/llrintl, math/llround, math/llroundf, math/llroundl, math/log1p, math/log1pf, math/lrintl, math/pow10l, math/powf, math/powl, math/sinhf, math/sinhl, regression/inet_ntop-v4mapped

Build and integration checks

On 2026-11-21 the measured revision passed 14 of 14 Makefile targets as an unprivileged user in the x86-64 Linux build guest. Four libc-test targets compare failures with the project’s existing expected-failure lists. The independent corpus above counts each test result directly. Download the per-target results.

Build and integration checks
TargetExitSeconds
sys-ops-check00
purity-check00
smoke-cosmo011
host-matrix059
host-bend-hello-zig011
host-bend-parallel-zig05
host-snapshot-matrix014
dogfood-matrix0108
smoke-matrix0171
libc-test-gcc024
libc-test-zig0102
libc-test-standalone-gcc022
libc-test-standalone-zig022
shootout-matrix0614

On 2026-11-21, CI on Fedora Linux (x86-64) passed the host, Bend, standalone, freestanding and generated-C checks at eef2cefc. The library source matches the benchmark revision. Fedora check results.

Performance

2026-11-21 UTC · Linux x86-64

For an 8-byte buffer with no matching byte, the Cosmopolitan consumer measured 3.98 ns with previous Nelibc, 2.77 ns with current Nelibc, and 2.24 ns with Cosmopolitan alone. Paired median ratios were 1.45× previous/current (1.41–1.48× observed) and 0.82× native/current (0.80–0.83× observed).

The table tracks the three operations that prompted this work. Its last column gives the median of seven paired native-to-current ratios. The separate controls below vary the inputs and alignments.

Original priority cases · median nanoseconds per call
RuntimeOperationNativePrevious NelibcCurrent NelibcNative ÷ current
glibcstrlen · 128 B2.722.772.721.00×
Cosmopolitanmemchr-absent · 8 B2.243.982.770.82×
glibcstrtod-decimal101.72109.69109.490.93×

Length, alignment and match-position controls for strlen and memchr · Decimal length, alignment and rounding controls for strtod.

Match position matters. In the aligned eight-byte control, finding the first byte took 1.73 ns with previous Nelibc, 2.00 ns with current Nelibc and 2.26 ns with native Cosmopolitan.

The musl executables placed their buffers at different offsets within a page. At identical offsets, 128-byte copies took 3.26 and 3.22 ns with previous and current Nelibc. Near the page end, the same pair took 6.09 and 6.09 ns. Compare both placements for copy, move, search and length.

Each profile compares the same consumer with and without Nelibc. Speedups above 1× favor Nelibc. Browse 171 results across 3 profiles.

All 171 benchmark results

Of 163 cases that called a Nelibc export, 101 ran faster than their native libc in all 7 rounds, 28 ran slower in every round, and 34 had an observed range that included 1×. Each case has equal weight here.

Times are median nanoseconds per call. Speedup is the median of the paired native time divided by the Nelibc time. The range shows the smallest and largest paired ratios. Download the results (CSV) · Raw matched samples

glibc · 57 results
glibc with and without Nelibc
CaseInput bytesNative ns/op+ Nelibc ns/opSpeedupObserved rangeImplementation
memcpy82.472.600.959×0.585–1.05×Nelibc export
memcpy322.002.280.869×0.814–0.916×Nelibc export
memcpy1282.552.760.924×0.865–0.973×Nelibc export
memcpy1,0249.429.181.02×0.98–1.03×Nelibc export
memcpy4,09632.8832.311.02×0.994–1.29×Nelibc export
memcpy65,5361,222.841,223.510.958×0.686–1.06×Nelibc export
memmove-overlap84.023.751.07×0.958–1.09×Nelibc export
memmove-overlap324.273.791.14×1.1–1.17×Nelibc export
memmove-overlap1284.505.040.892×0.842–0.932×Nelibc export
memmove-overlap1,02412.9320.200.642×0.629–0.66×Nelibc export
memmove-overlap4,09636.5940.340.907×0.749–0.972×Nelibc export
memmove-overlap65,536866.65853.561.01×0.657–1.06×Nelibc export
memset82.772.741×0.966–1.1×Nelibc export
memset322.262.280.986×0.96–1.17×Nelibc export
memset1282.732.731.01×0.957–1.02×Nelibc export
memset1,0248.308.310.999×0.957–1.03×Nelibc export
memset4,09638.7137.441.04×0.984–1.06×Nelibc export
memset65,5361,091.631,109.461×0.855–1.06×Nelibc export
memcmp-equal82.722.221.23×1.18–1.24×Nelibc export
memcmp-equal322.982.481.2×1.16–1.23×Nelibc export
memcmp-equal1283.222.951.09×1.05–1.12×Nelibc export
memcmp-equal1,0249.719.630.998×0.959–1.02×Nelibc export
memcmp-equal4,09637.6134.181.11×1.02–1.15×Nelibc export
memcmp-equal65,5361,291.781,253.131.02×0.971–1.05×Nelibc export
memchr-absent82.703.410.804×0.577–0.84×Nelibc export
memchr-absent322.742.761×0.981–1.02×Nelibc export
memchr-absent1283.224.270.755×0.742–0.783×Nelibc export
memchr-absent1,0248.5611.100.785×0.751–0.807×Nelibc export
memchr-absent4,09626.3232.970.809×0.723–0.892×Nelibc export
memchr-absent65,536609.83626.430.985×0.899–1.04×Nelibc export
strlen82.002.230.894×0.886–0.916×Nelibc export
strlen322.512.241.11×1.06–1.14×Nelibc export
strlen1282.722.721×0.983–1.03×Nelibc export
strlen1,0247.658.460.904×0.878–1.15×Nelibc export
strlen4,09621.8120.951.05×0.989–1.15×Nelibc export
strlen65,536554.76607.920.913×0.869–1.1×Nelibc export
strcmp-equal82.482.211.11×0.995–1.13×Nelibc export
strcmp-equal322.733.230.834×0.814–0.879×Nelibc export
strcmp-equal1285.656.930.821×0.768–0.838×Nelibc export
strcmp-equal1,02414.6217.600.842×0.813–0.864×Nelibc export
strcmp-equal4,09648.1159.020.799×0.738–0.89×Nelibc export
strcmp-equal65,5361,353.701,388.200.999×0.932–1.01×Nelibc export
strstr-tail811.4615.060.757×0.74–0.851×Nelibc export
strstr-tail3269.8362.971.09×1.07–1.19×Nelibc export
strstr-tail128359.5977.794.68×4.49–4.85×Nelibc export
strstr-tail1,0243,381.7292.3436.8×35.6–39.9×Nelibc export
strstr-tail4,09615,081.97129.26119×111–120×Nelibc export
strstr-tail65,536243,161.441,326.20184×151–190×Nelibc export
strtol-decimal—15.6513.511.16×0.887–1.18×Nelibc export
strtod-decimal—101.72109.490.933×0.901–0.955×Nelibc export
sin—8.255.851.42×1.39–1.68×Nelibc export
sqrt—2.762.221.22×1.18–1.28×Nelibc export
malloc-free649.0312.970.694×0.673–0.724×Nelibc export
malloc-free4,09617.9814.451.25×1.22–1.31×Nelibc export
snprintf-mixed—179.86241.060.762×0.66–0.785×Nelibc export
qsort-128-integers—2,184.771,962.291.11×1.09–1.2×Nelibc export
parse-record—188.42164.251.16×1.12–1.2×mixed workload
musl / Zig · 57 results
musl / Zig with and without Nelibc
CaseInput bytesNative ns/op+ Nelibc ns/opSpeedupObserved rangeImplementation
memcpy82.242.280.967×0.559–1.03×Nelibc export
memcpy323.402.031.68×1.51–2.18×Nelibc export
memcpy1284.756.050.788×0.67–0.845×Nelibc export
memcpy1,02421.6516.101.35×1.3–1.45×Nelibc export
memcpy4,09685.4052.721.62×1.57–1.67×Nelibc export
memcpy65,5361,779.291,243.501.42×1.31–1.52×Nelibc export
memmove-overlap84.453.931.12×1.08–1.18×Nelibc export
memmove-overlap326.148.370.723×0.699–0.828×Nelibc export
memmove-overlap1287.4710.660.697×0.66–0.729×Nelibc export
memmove-overlap1,02421.3028.630.75×0.707–0.819×Nelibc export
memmove-overlap4,09668.7939.751.75×1.67–1.78×Nelibc export
memmove-overlap65,5361,421.03846.961.66×1.6–1.71×Nelibc export
memset82.012.500.809×0.75–0.832×Nelibc export
memset322.031.980.994×0.986–1.05×Nelibc export
memset1284.222.451.68×1.62–1.75×Nelibc export
memset1,02416.608.741.9×1.83–1.99×Nelibc export
memset4,09664.8537.761.74×1.69–1.8×Nelibc export
memset65,5361,352.801,096.231.22×1.08–1.42×Nelibc export
memcmp-equal83.982.471.61×1.55–1.64×Nelibc export
memcmp-equal3221.942.458.95×8.55–9.65×Nelibc export
memcmp-equal12846.933.2614.5×5.7–14.8×Nelibc export
memcmp-equal1,024328.7411.4228.2×20.9–29.4×Nelibc export
memcmp-equal4,0961,293.9645.5427.9×27–29.2×Nelibc export
memcmp-equal65,53620,209.601,709.1911.8×11.5–13×Nelibc export
memchr-absent83.712.781.33×1.31–1.39×Nelibc export
memchr-absent3219.152.477.79×7.63–8.38×Nelibc export
memchr-absent12840.714.179.77×9.24–10.1×Nelibc export
memchr-absent1,024261.9210.9624.1×16.2–25×Nelibc export
memchr-absent4,0961,043.7333.1830.8×28–31.6×Nelibc export
memchr-absent65,53616,677.50667.8025.1×24.5–29.3×Nelibc export
strlen84.553.511.29×1.27–1.32×Nelibc export
strlen3219.924.224.72×4.3–4.76×Nelibc export
strlen12846.104.4410.4×9.94–10.6×Nelibc export
strlen1,024320.049.5532.7×31.4–35.5×Nelibc export
strlen4,0961,243.0222.4855.1×45.6–75×Nelibc export
strlen65,53619,672.22588.2133.5×31–35.3×Nelibc export
strcmp-equal85.472.732.02×1.52–2.14×Nelibc export
strcmp-equal3217.605.293.36×3.04–3.5×Nelibc export
strcmp-equal12872.047.549.35×8.13–9.76×Nelibc export
strcmp-equal1,024521.4719.5427×24.9–34.5×Nelibc export
strcmp-equal4,0962,072.5760.3234.6×32.1–36.2×Nelibc export
strcmp-equal65,53632,960.391,728.7819.1×17.9–19.5×Nelibc export
strstr-tail818.3010.101.81×1.05–1.93×Nelibc export
strstr-tail3289.3148.641.87×1.7–2.02×Nelibc export
strstr-tail128563.0759.649.59×9.17–9.99×Nelibc export
strstr-tail1,0244,012.6770.3258×56.1–61.3×Nelibc export
strstr-tail4,09615,871.66107.49150×139–152×Nelibc export
strstr-tail65,536256,641.781,308.31193×189–199×Nelibc export
strtol-decimal—11.6814.090.831×0.811–1.12×Nelibc export
strtod-decimal—474.99122.333.85×3.71–3.97×Nelibc export
sin—5.846.720.871×0.747–0.887×Nelibc export
sqrt—10.882.743.94×3.59–4.16×Nelibc export
malloc-free6418.0915.901.16×1.09–1.22×Nelibc export
malloc-free4,09618.2016.781.1×0.864–1.12×Nelibc export
snprintf-mixed—255.82262.410.975×0.924–1.02×Nelibc export
qsort-128-integers—4,904.621,799.422.69×2.4–3×Nelibc export
parse-record—608.04181.623.38×3.31–3.44×mixed workload
Cosmopolitan · 57 results
Cosmopolitan with and without Nelibc
CaseInput bytesNative ns/op+ Nelibc ns/opSpeedupObserved rangeImplementation
memcpy84.152.211.86×1.79–1.89×Nelibc export
memcpy324.041.962.06×1.99–2.15×Nelibc export
memcpy1286.932.472.8×2.67–2.88×Nelibc export
memcpy1,02418.199.082×1.88–2.03×Nelibc export
memcpy4,09643.6132.031.37×1.3–1.39×Nelibc export
memcpy65,5361,211.381,198.490.999×0.967–1.02×Nelibc export
memmove-overlap83.903.741.06×1.02–1.22×Nelibc export
memmove-overlap323.924.020.992×0.933–1.04×Nelibc export
memmove-overlap1285.855.681.02×0.994–1.09×Nelibc export
memmove-overlap1,024298.9126.7711.1×11–12.3×Nelibc export
memmove-overlap4,0961,050.9839.0727×26.3–28×Nelibc export
memmove-overlap65,53616,537.25843.7019.6×19.3–19.8×Nelibc export
memset82.232.950.752×0.743–0.766×Nelibc export
memset322.972.451.21×1.17–1.28×Nelibc export
memset1284.832.721.76×1.7–1.91×Nelibc export
memset1,02415.108.201.8×1.61–1.95×Nelibc export
memset4,09638.5537.661.03×0.991–1.08×Nelibc export
memset65,5361,070.801,113.770.944×0.701–1.15×Nelibc export
memcmp-equal81.992.710.735×0.706–1.16×Nelibc export
memcmp-equal323.962.721.46×1.36–1.5×Nelibc export
memcmp-equal1285.442.961.84×1.76–1.91×Nelibc export
memcmp-equal1,02426.019.762.67×2.63–3.98×Nelibc export
memcmp-equal4,09698.3033.752.95×2.83–3.14×Nelibc export
memcmp-equal65,5362,357.211,290.571.83×1.74–1.92×Nelibc export
memchr-absent82.242.770.818×0.799–0.83×Nelibc export
memchr-absent323.472.461.4×1.33–1.62×Nelibc export
memchr-absent1286.924.271.63×1.6–1.69×Nelibc export
memchr-absent1,02435.1310.993.2×3.11–3.28×Nelibc export
memchr-absent4,096134.7932.764.16×4.06–4.23×Nelibc export
memchr-absent65,5362,030.87627.343.26×3.08–3.35×Nelibc export
strlen83.452.471.39×1.34–1.52×Nelibc export
strlen323.512.481.41×1.33–1.48×Nelibc export
strlen1285.022.981.69×1.54–1.81×Nelibc export
strlen1,02419.708.642.27×2.12–2.35×Nelibc export
strlen4,09680.2421.243.84×3.47–6.73×Nelibc export
strlen65,5361,423.33592.342.4×2.32–2.49×Nelibc export
strcmp-equal83.751.991.87×1.75–1.92×Nelibc export
strcmp-equal325.993.291.86×1.79–1.88×Nelibc export
strcmp-equal12815.057.801.97×1.88–2.69×Nelibc export
strcmp-equal1,024106.9523.344.61×4.5–4.95×Nelibc export
strcmp-equal4,096386.3862.886.23×6.09–6.46×Nelibc export
strcmp-equal65,5366,137.131,395.624.42×4.05–4.57×Nelibc export
strstr-tail823.0814.311.62×1.43–1.7×Nelibc export
strstr-tail32170.9557.652.99×2.85–3.02×Nelibc export
strstr-tail128733.5674.109.87×9.54–10.2×Nelibc export
strstr-tail1,0245,923.8088.8266.9×64.8–68.8×Nelibc export
strstr-tail4,09623,689.20124.05186×185–200×Nelibc export
strstr-tail65,536375,004.191,338.91282×271–293×Nelibc export
strtol-decimal—12.2312.500.995×0.941–1.02×delegated
strtod-decimal—512.9086.695.93×5.69–6.02×Nelibc export
sin—5.316.080.859×0.767–0.886×Nelibc export
sqrt—2.052.260.912×0.845–0.944×Nelibc export
malloc-free6410.8910.990.99×0.948–1.04×delegated
malloc-free4,09611.6611.710.998×0.917–1.19×delegated
snprintf-mixed—197.51195.341.01×0.985–1.04×delegated
qsort-128-integers—2,458.612,460.480.995×0.977–1.04×delegated
parse-record—580.82129.994.43×4.35–4.69×mixed workload

Optimization follow-up: the previous revision and the measured revision

The previous production archives were saved before changing the implementations. Each profile now rotates three builds of the same consumer: libc alone, the previous Nelibc candidate, and the new candidate. This table uses Cosmopolitan only. The three builds run in rotating order on the same CPU.

Cosmopolitan, rotating process triplets; nanoseconds per operation
CasePrevious NelibcNew NelibcCosmopolitan aloneGain vs previous
memchr-absent · 8 B3.982.772.241.45×
memchr-absent · 32 B2.712.463.471.10×
memchr-absent · 128 B4.264.276.921.00×
memchr-absent · 65536 B619.14627.342030.870.99×

On x86-64, the Cosmopolitan build scans a single eight-byte group before its tail. Clang checks that a word fits within the current page before loading it, then locates the first matching byte. Near a page edge it scans in order. Both paths are written in Nelua. The timed wrappers keep calls observable, so these gains measure the implementations. Slower cases and all raw samples remain below.

Independent numerical and guard-page checks · Optimization notes and verification · Reproduce this comparison · Memchr length, alignment and hit-position controls · Raw memchr control samples · Memchr control run manifests · Decimal controls by input and byte offset · Raw decimal control samples · Decimal control run manifest · Decimal control inputs and checks · Decimal control driver · Musl page-placement controls · Raw placement samples · Observed page offsets and archive hashes · Musl placement driver

Measured revisions: 84267ab9185f before the change and eef2cefc548e after it. The manifest identifies each linked archive by SHA-256.

Source revisions: previous 84267ab9185f25c88eca4cd10366207a5028ecc7, measured eef2cefc548e6e25760c653ef31154f460bf7690. Run manifest and archive identities · Matched benchmark samples · Memchr length, alignment and hit-position controls · Paired raw control samples · Reproduce this comparison · Reproduce the previous immutable comparison.

Representative cases, median of seven paired speedups
Caseglibc → +Nelibcmusl/Zig → +NelibcCosmopolitan → +Nelibc
memcpy · 4,096 B1.02×1.62×1.37×
memmove-overlap · 128 B0.89×0.70×1.02×
memset · 4,096 B1.04×1.74×1.03×
memcmp-equal · 128 B1.09×14.48×1.84×
memchr-absent · 128 B0.76×9.77×1.63×
strlen · 128 B1.00×10.39×1.69×
strcmp-equal · 128 B0.82×9.35×1.97×
strstr-tail · 128 B4.68×9.59×9.87×
strtol-decimal1.16×0.83×0.99× delegated
strtod-decimal0.93×3.85×5.93×
sin1.42×0.87×0.86×
sqrt1.22×3.94×0.91×
malloc-free · 64 B0.69×1.16×0.99× delegated
snprintf-mixed0.76×0.97×1.01× delegated
qsort-128-integers1.11×2.69×0.99× delegated
parse-record1.16× mixed workload3.38× mixed workload4.43× mixed workload

7 comparison rounds (rotating triplets with the previous candidate), rotating profile order. Each timed loop runs for at least 5 ms after calibration. Consumer flags include -O2 -fno-builtin; volatile pointers to noinline direct-call wrappers stop pure-function calls being hoisted out of the loop. The same wrappers are used in every profile. Taking the address of Cosmopolitan 4.0.2’s strstr IFUNC failed in this toolchain; direct calls passed, so this measures the direct-call path and does not establish function-pointer ABI conformance. Loop, pointer-call and checksum overhead is included equally, not subtracted. Buffers are hot and aligned; this is not a DRAM bandwidth, cold-cache, multicore or application throughput result. The record parser is a synthetic combined workload; qsort includes initializing its input, and malloc/free includes writing the first and last byte.

What to optimize next

Start with measured losses in frequently used operations, retain the winning cases, and require correctness before promoting a faster path. This ordering reflects this corpus; it is not a claim about every application's CPU profile.

  1. memmove-overlap: glibc + Nelibc measured 0.64× baseline speed at 1,024 bytes. Keep this case in the comparison while testing short, long, aligned and unaligned inputs.
  2. memset: Cosmopolitan + Nelibc measured 0.75× baseline speed at 8 bytes. Keep this case in the comparison while testing short, long, aligned and unaligned inputs.
  3. memchr-absent: glibc + Nelibc measured 0.76× baseline speed at 128 bytes. Keep this case in the comparison while testing short, long, aligned and unaligned inputs.

Decimal range handling. In the separate aligned controls, current Nelibc parsed 1e9999 in 143.13 µs and 1e-9999 in 147.90 µs. Native glibc took 15.28 and 14.92 ns respectively. Both produced the expected binary64 result, end pointer and ERANGE. Compare decimal inputs at all five offsets.

Correctness first: investigate or document the newly failing corpus cases before promoting optimizations: musl / Zig: regression/sigprocmask-internal; Cosmopolitan: functional/popen.

Next evidence: application profiles to weight the cases; more CPUs and working-set sizes; allocator contention and I/O workloads. A single-host microbenchmark cannot establish a globally fastest libc.

Download and reproduce

Run recorded 2026-11-21 UTC. Compiler versions: glibc: gcc (Debian 12.2.0-14+deb12u1) 12.2.0; musl / Zig: clang version 22.1.8; Cosmopolitan: x86_64-unknown-cosmo-cc (GCC) 14.1.0. The musl pair uses Zig's bundled musl; the Cosmopolitan toolchain is 4.0.2. glibc version: glibc 2.36.

Tested Nelibc commit eef2cefc548e6e25760c653ef31154f460bf7690 on Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz with CPU 3 affinity. The public data include raw samples, linked archive hashes and reproduction commands.

The conformance data record every planned public corpus test for both halves of each pair. Cosmopolitan executables use the APE loader. Pinned upstream test source.

Built consumer file sizes
Unnormalized executable file bytes, as built
ProfileAlone bytes+Nelibc bytesLink mode
glibc22,544682,128Dynamic system libc
musl / Zig1,471,1043,530,936Static
Cosmopolitan1,682,1261,726,670Static

These are not normalized release sizes. The dynamic glibc executable excludes its shared libraries; symbols, debug information, archive granularity and static runtimes affect these files. No footprint winner is claimed.

What works today

AreaHybrid buildsStandalone
Memory, strings, conversionsBroad Nelua implementationBroad and growing
MathBroad real and complex coverage, incl. x86-64 long double and fenvBroad; edge cases remain
StdioMostly host libcPartial Nelua implementation
Files, processes, threadsHost and Nelua mixLinux x86-64 base; gaps remain
Locale, wide chars, networkingHost and Nelua mixPartial; resolver APIs remain
Terminals, non-local jumps, accountsHost libc<termios.h> with pty functions and tcgetpgrp/tcsetpgrp; <setjmp.h> in x86-64 assembly (musl's jmp_buf); <pwd.h>/<grp.h> from /etc files, no NSS; <libgen.h>, <sys/statvfs.h>, <sys/syscall.h>, the rand48 and random generators, execl/execle/execlp, vfork, System V IPC (msg*, sem*, shm*, ftok), popen/pclose, <mntent.h>, mktemp, daemon

Counts track exported names, not behavioral conformance. "Implemented" means the symbol is present in the archive. See the coverage notes for the methodology and the roadmap for the priority order.

Coverage explorer

Choose a header or archive inventory and a runtime to see which symbols Nelibc supplies.

Download the current inventory and profile data or open the historical musl coverage snapshot.

Build and historical gates

Requirements
Nelua and the Cosmopolitan compiler wrapper for the default hybrid build; Zig (zig cc) for the older profiles. GCC for the GCC profile; TinyCC mob branch for the TinyCC profile.
Build the measured revision
Use the Nelibc revision and toolchain versions recorded with the comparison. The target make smoke-cosmo uses x86_64-unknown-cosmo-cc from Cosmopolitan 4.0.2, checks the full archive link and rejects a glibc dependency. Supply COSMOCC=/path/to/cosmocc/bin/x86_64-unknown-cosmo-cc. Compile consumers with Cosmopolitan headers, without -Iinclude.
Older hybrid example
make dogfood-zig builds the hybrid archive, compiles examples/incremental.c, runs it and checks Nelibc's memcpy, strlen, strchr and strtol are the ones linked.
Matrices
make smoke-matrix (seven profiles), make dogfood-matrix (four consumers), make host-matrix, make host-bend-hello-zig.
7 November 2026 gate
2026-11-07 on main 1c7240a (branch commit d5f3456): Debian 12, glibc 2.36, GCC 12.2, Zig 0.17.0, Nelua dabbd9ef. 159 of 159 targets passed with no warnings: hybrid Zig/glibc, GCC/glibc and Zig/musl, standalone Zig and GCC, freestanding Zig and GCC, the host profile, and musl's libc-test against the hybrid and standalone archives. Until an earlier run that day the gate script had left libc-test out although the repository's gate list includes it; a <limits.h> regression in GCC hybrid builds slipped through that gap and was fixed.
Conformance
musl's libc-test runs against the gcc and zig hybrid archives with a committed expected-failure list that only shrinks: 112 and 118 after the first slice, 31 (gcc) and 35 (zig) in the recorded 2026-11-07 run, none of them math tests. Slice 2 fixed strftime, fnmatch, exact %La, the TZif reader's stack use and malloc_usable_size; the math slice ported musl's exp, pow, log, trigonometric, gamma and Bessel code with its exception-flag discipline, which cleared 76 math tests. A follow-up fixed the last seven: the sign of fma with a zero addend, fmaf rounding and underflow in the subnormal range, the sign of modfl's fraction, and musl ports of erfl, erfcl and exp10l. printf now formats every long double exactly: %Lf, %Le and %Lg write the full decimal expansion of the 80-bit value and round half to even, checked against glibc on 28 cases including LDBL_MAX in all 4,940 characters.
Standalone conformance
libc-test also runs against the standalone archive, where Nelibc is the whole C library: Nelibc's headers only, its own _start, libc-test's own runner with the 100 KiB stack limit. The first run passed 255 of 343 tests with GCC; after the fixes it led to (<limits.h>, <inttypes.h>, <langinfo.h>, <search.h> and <regex.h> (nebox's Pike VM engine behind the POSIX interface) for standalone, static constructors and destructors, scanf %n and ungetc pushback, cancellation points and PI mutex relock, ftello on append streams, sem_open reuse, pthread_create's EAGAIN, exit after the last pthread_exit) 300 pass with GCC and 301 with Zig, with no timeouts; with <pwd.h>/<grp.h>, <setjmp.h> and a batch of small POSIX families since, 326 pass with GCC and 328 with Zig; with iconv (UTF-8/16/32, UCS-2/4, the ISO-8859 and Windows code pages, KOI8, CP437/850, musl's * replacement), shm_open, dn_expand and a GCC <tgmath.h> on top, 332 pass with GCC and 333 with Zig (all 11 and 10 failures expected and listed; one of GCC's is a libc-test main without a return). mktime now honours a tm_isdst that contradicts the date, as glibc and musl do, a fix found through nebox's date -d '14 days ago'. Every math test that builds passes. The rest is a written map of what is missing (dl*, crypt, wordexp, ...) and of what is still open (a posix_spawnp null-envp divergence, destroying a locked robust mutex), in docs/libc-test.md.
CPU baseline
Zig builds default to -mcpu=x86_64; override with ZIGFLAGS='-mcpu=x86_64_v3' on purpose.