# cmake: Pass \-fno-sanitize=undefined when building zig2\. · gitcafe/zig

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

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

Visibility: public

Requested revision: 957a5ae56038517316f66777d8dc5f090f15c214

Requested commit: 957a5ae56038517316f66777d8dc5f090f15c214

Commit: 957a5ae56038517316f66777d8dc5f090f15c214

Tree: a68448e20d655eeff811737c99f0688716b64275

Author: Alex Rønne Petersen

Committer: Alex Rønne Petersen

## Message

```
cmake: Pass -fno-sanitize=undefined when building zig2.

We build zig2.c and compiler_rt.c with -O0 but then proceed to link with -O3.
So zig2.o and compiler_rt.o will have references to ubsan-rt symbols, but the
-O3 causes the compiler to not link ubsan-rt. We don't actually need the safety
here, so just explicitly disable ubsan.

```

## Parents

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

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