GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — ARM64 build uses host target-cpu=native for native dependencies and can produce SIGILL on Lambda · Issue #934 · cargo-lambda/cargo-lambda Open DescriptionProblemI ran into an ARM64 Lambda that would randomly die with: The same binary worked on some Lambda hosts and consistently failed on others. It turned out the failing hosts didn't support ARM SHA3, while the binary contained unconditional I eventually traced those instructions back to native code inside Rust dependencies. I was building on Apple Silicon, and the Zig C compiler wrapper generated by cargo-zigbuild contained Environment
Configuration that triggers itMy Cargo configuration contains: [build] rustflags = ["-C", "target-cpu=native"] Cargo Lambda overrides this with I found this generated wrapper at: It contained: exec "/opt/homebrew/bin/cargo-lambda" zig cc -- -g -fno-sanitize=all -mcpu=native -target aarch64-linux-gnu "$@" So Rust code gets the Lambda-specific CPU target, while C code inside dependencies gets I know that using Reproducerhttps://github.com/libbkmz/cargo-lambda-arm64-sigill-repro The repository contains a small Rust Lambda using Ring's X25519 API. The script builds it twice:
Run: ./reproduce.sh On my Apple Silicon machine, this produces: No AWS deployment is needed to reproduce the build difference. The script disassembles Ring's ExpectedOnce Cargo Lambda selects The build shouldn't silently use the Apple host's CPU features for native dependencies. ActualRust compilation uses the Lambda CPU target, but the generated Zig C wrapper uses This can produce instructions unsupported by some Lambda ARM64 hosts. The resulting failure looks intermittent because it depends on which host runs the function. WorkaroundForcing native dependencies to use baseline ARMv8-A removes the instructions: [env] CFLAGS_aarch64_unknown_linux_gnu = { value = "-march=armv8-a", force = true } After rebuilding with this setting, the affected function contains no ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |