From b9107ef58aeda1901b73d2faec17415ed0fd499b Mon Sep 17 00:00:00 2001 From: devins2518 Date: Mon, 6 Jun 2022 22:20:16 -0500 Subject: [PATCH] change macOS notes to use self-compiled llvm and clang --- Development-with-nix.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Development-with-nix.md b/Development-with-nix.md index b766404..1a8a457 100644 --- a/Development-with-nix.md +++ b/Development-with-nix.md @@ -68,11 +68,14 @@ Alternatively, you can use this sample `flake.nix`: ## Notes for macOS users -If using macOS, you may need to include the following to properly use nix's clang. +If using macOS, you will need to [build llvm yourself](https://github.com/ziglang/zig/wiki/How-to-build-LLVM,-libclang,-and-liblld-from-source) and use the system's clang to build zig. This is possible using the sample `shell.nix` below. ```nix - shellHook = with pkgs.llvmPackages_13; '' - export CPATH="${clang}" # Use clang's stdlib - export LDFLAGS="-stdlib=libc++ -lc++abi" # Link against the stdlib - ''; +with import { }; + +pkgs.mkShellNoCC { + nativeBuildInputs = with pkgs; [ cmake gdb ninja qemu wasmtime ]; + + hardeningDisable = [ "all" ]; +} ``` \ No newline at end of file