Skip to content

wasm automatically links and re-exports all of libc #7133

@fengb

Description

@fengb
$ zig build-lib empty.zig -OReleaseSmall -target wasm32-freestanding

$ ls -l empty.*
-rwxr-xr-x  1 fengb  staff  48776 Nov 16 12:06 empty.wasm
-rw-r--r--  1 fengb  staff      0 Nov 16 12:06 empty.zig

$ twiggy top empty.wasm 
 Shallow Bytes │ Shallow % │ Item
───────────────┼───────────┼────────────────────────────────────────────────
          4255 ┊     8.72% ┊ data[0]
          2851 ┊     5.85% ┊ "function names" subsection
          1884 ┊     3.86% ┊ __divtf3
          1477 ┊     3.03% ┊ compiler_rt.addXf3.addXf3.27
          1384 ┊     2.84% ┊ __multf3
           941 ┊     1.93% ┊ __divdf3
           879 ┊     1.80% ┊ compiler_rt.udivmod.udivmod.64
           864 ┊     1.77% ┊ fma
           803 ┊     1.65% ┊ __muldf3
           778 ┊     1.60% ┊ compiler_rt.addXf3.addXf3.26
           767 ┊     1.57% ┊ __udivmoddi4
           675 ┊     1.38% ┊ __divsf3
           639 ┊     1.31% ┊ compiler_rt.addXf3.addXf3
           592 ┊     1.21% ┊ __mulsf3
           551 ┊     1.13% ┊ sqrt
           519 ┊     1.06% ┊ fmod
           512 ┊     1.05% ┊ expf
[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasm32-bit and 64-bit WebAssembly

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions