# cc,wasi: build referenced-only emulated components · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/4e4722a65e3bc3d6bb4518df3082ffea7c2a7c5d)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 4e4722a65e3bc3d6bb4518df3082ffea7c2a7c5d

Requested commit: 4e4722a65e3bc3d6bb4518df3082ffea7c2a7c5d

Commit: 4e4722a65e3bc3d6bb4518df3082ffea7c2a7c5d

Tree: 02bf3ff87229ec8df06bd8296050e318e1cb90cc

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
cc,wasi: build referenced-only emulated components

Move parsing of system libs into `main.zig` next to where we decide
if we should link libC, and, if targeting WASI, if the specified
libname equals one of the emulated components, save it on the side
and remove it from the system libs. Then, build *only* those parts
of WASI libc that were preserved in the previous step.

This also fixes building of different crt1 bits needed to support
reactors and commands.

```

## Parents

- [93a4403271ef62d8ae2cd10f58cc23d4b7bbdf4d](https://git.cafe/gitcafe/zig/commit/93a4403271ef62d8ae2cd10f58cc23d4b7bbdf4d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/4e4722a65e3bc3d6bb4518df3082ffea7c2a7c5d?format=markdown)
