# Zig cc dynamic C lib runtime error on NixOS

**URL:** <https://ziggit.dev/t/zig-cc-dynamic-c-lib-runtime-error-on-nixos/3075>\
**Category:** Help\
**Tags:** c\
**Created:** [January 31, 2024, 5:32pm UTC](https://ziggit.dev/t/zig-cc-dynamic-c-lib-runtime-error-on-nixos/3075 "2024-01-31T17:32:24Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Cloudef](https://ziggit.dev/user_avatar/ziggit.dev/cloudef/32/1370_2.png) [@Cloudef](https://ziggit.dev/u/Cloudef)\
**Post date:** [February 1, 2024, 7:13am UTC](https://ziggit.dev/t/zig-cc-dynamic-c-lib-runtime-error-on-nixos/3075/2 "2024-02-01T07:13:03Z")

</div>

Try with `zig cc -target x86_64-linux` by default zig applies host specific optimizations so the blas headers might look for different symbols that were compiled in. Nixpkgs are always packaged with `-mcpu=baseline` to have reproducible output. `-target` and `-Dtarget` (for zig build) always use the baseline for that target similar to `-mcpu=baseline`[Exe files not interchangeable among identical Linux systems - #6 by andrewrk](https://ziggit.dev/t/exe-files-not-interchangeable-among-identical-linux-systems/2708/6)

---

_[View the full topic](https://ziggit.dev/t/zig-cc-dynamic-c-lib-runtime-error-on-nixos/3075)._
