#!/bin/sh # Compile C++ with zig's bundled glibc sysroot; no system C toolchain # needed. Same arrangement as vidya's, with one addition it did not need. # # `cc-rs` builds a `--target=` from the Rust triple, which carries a vendor # field: `x86_64-unknown-linux-gnu`. zig's own triples have no vendor, and it # refuses the whole query rather than ignoring the part it does not want — # "unable to parse target query: UnknownOperatingSystem", which reads as though # Linux were the problem. aws-lc-sys compiles C, so this is the difference # between a workspace that builds and one that does not. # # Drop the vendor on the way past. Nothing else is touched. for arg do case "$arg" in --target=*-unknown-linux-*) arg="--target=$(echo "${arg#--target=}" | sed 's/-unknown-linux-/-linux-/')" ;; esac set -- "$@" "$arg" shift done exec "$(dirname "$0")/zig" c++ "$@"