Skip to content

chore: pin libyulc 0.0.2 (solc 339 MiB -> 144 MiB) - #2

Merged
leonardoalt merged 1 commit into
developfrom
chore/pin-libyulc-0.0.2
Jul 30, 2026
Merged

chore: pin libyulc 0.0.2 (solc 339 MiB -> 144 MiB)#2
leonardoalt merged 1 commit into
developfrom
chore/pin-libyulc-0.0.2

Conversation

@leonardoalt

Copy link
Copy Markdown
Member

What

Bumps the pinned libyulc release from 0.0.1 to 0.0.2. Two lines in cmake/yulc.cmake.

Follow-up to #1, which merged just before this landed on that branch, so develop currently pins 0.0.1 and does not have the size reduction below.

Why

0.0.1 predated the Mathlib work in yul-compiler. Mathlib was being linked into the library because every Lean module's initializer references the initializer of each module it imports — a real symbol reference the linker cannot discard — so a single bare import Mathlib anywhere in the runtime closure pulled in all of compiled Mathlib. Narrowing those imports (powdr-labs/yul-compiler#137, powdr-labs/yul-compiler#138, powdr-labs/yul-semantics#40, all merged) took the link closure from 8,724 objects to 1,112. libyulc-v0.0.2 is cut from yul-compiler main with that in.

Measured

Rebuilt solc against each release, same tree, same flags:

0.0.1 0.0.2 delta
solc (USE_YULC=ON) 355,502,216 219,069,328 −136.4 MB
solc (+ SOLC_STRIP_SYMBOLS=ON) 236,446,528 151,078,184 −85.4 MB
.text 185,199,409 121,448,177 −63.8 MB
.eh_frame 23,688,712 14,218,448 −9.5 MB
.rodata 8,679,320 3,982,576 −4.7 MB
defined symbols 1,001,102 570,826 −430,276

So -DUSE_YULC=ON -DSOLC_STRIP_SYMBOLS=ON now costs 144.1 MiB against a 19.4 MiB baseline solc, where #1 as merged costs 339.0 MiB.

Both binaries compile the block-rooted and object-rooted test inputs to byte-identical bytecode:

$ solc --strict-assembly --yul-backend yulc t.yul
602a5f55
$ solc --strict-assembly --yul-backend yulc obj.yul
6024600b5f3960245ff3005f3560e01c8063371303c0141561001d575060015f54015f55610022565b505f5ffd5b00

The USE_YULC=OFF default build is untouched by this.

Notes

  • The release tarball shrank 242.8 MB → 211.4 MB and the bundled libyulc.so 198 MB → 79.8 MB, but libyulc.a is 759 MB, marginally larger. Expected: build-c-lib.sh archives every object under each package's build/ir, so Mathlib's objects are still in the archive — just no longer referenced, so the linker no longer pulls them.
  • Reconfiguring an existing build directory across this bump needs the cached pins cleared: -UYULC_VERSION -UYULC_RELEASE_SHA256 -UYULC_LIBRARY -UYULC_HEADER.

🤖 Generated with Claude Code

0.0.1 predated the Mathlib work in yul-compiler. Mathlib was being linked
into the library because every Lean module's initializer references the
initializer of each module it imports, so a single bare `import Mathlib`
in the runtime closure pulled all of compiled Mathlib in. Narrowing those
imports (powdr-labs/yul-compiler#137, argotorg#138 and powdr-labs/yul-semantics#40)
took the link closure from 8,724 objects to 1,112.

Measured on this branch, rebuilding solc against each release:

                          0.0.1          0.0.2         delta
  solc                355,502,216    219,069,328    -136.4 MB
  solc, stripped      236,446,528    151,078,184     -85.4 MB
  .text               185,199,409    121,448,177     -63.8 MB
  defined symbols       1,001,102        570,826        -430k

Both binaries compile the block- and object-rooted test inputs to
byte-identical bytecode.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@leonardoalt
leonardoalt merged commit 00a5824 into develop Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant