Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

1.8 KB
Raw Blame
# Per-target rustflags. Portable across all supported targets.
#
# `target-cpu=native` (previous global setting) was great for host-
# local perf but poisoned cross-compiles: rustc baked the build
# host's x86 features (e.g. `znver4`) into every invocation,
# including aarch64 ones, which rejected the flag with "unknown
# processor znver4". Release binaries must also be portable across
# machines, so we pin to a generic baseline per-arch:
#
#   x86_64 → `x86-64-v2` (Nehalem+, SSE4.2/POPCNT, no AVX/AVX2).
#            Pre-Haswell CPUs, some Atom/Celeron/Pentium parts, and
#            VMs that hide AVX2 can run the binary (#2161). The HNSW
#            dot-product kernel compiles an AVX2+FMA variant and
#            selects it at runtime when the CPU has both features, so
#            Haswell and newer keep that kernel's v3 speed.
#   aarch64 → default (ARMv8-A) — universally available.
#
# To re-enable target-cpu=native locally:
#   export RUSTFLAGS="-C target-cpu=native"
# (env RUSTFLAGS takes precedence over this file.)
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "target-cpu=x86-64-v2"]

[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "target-cpu=x86-64-v2"]

[target.aarch64-unknown-linux-gnu]
rustflags = []

[target.aarch64-unknown-linux-musl]
rustflags = []

[target.x86_64-apple-darwin]
rustflags = ["-C", "target-cpu=x86-64-v2"]

[target.aarch64-apple-darwin]
# `ring 0.17.14` has a compile-time assertion
# (`CAPS_STATIC == MIN_STATIC_FEATURES`) that fails on GitHub's
# macos-14 runners when the target CPU is generic. Pinning to
# `apple-m1` selects the exact feature set ring expects on Apple
# Silicon (NEON + AES + SHA2 + PMULL) and the assertion passes.
rustflags = ["-C", "target-cpu=apple-m1"]

[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-cpu=x86-64-v2"]

[target.aarch64-pc-windows-msvc]
rustflags = []