Rust Error for mach-o section specifier requires a segment and section separated by comma
When attempting to build a binary for my Adafruit Macropad I kept getting this error:
LLVM ERROR: Global variable '__INTERRUPTS' has an invalid section specifier '.vector_table.interrupts': mach-o section specifier requires a segment and section separated by a comma.
error: could not compile `rp2040-pac` (lib)
The solution is a real face palm...
.cargo/config was in my
src directory and not my project root.
That meant that anytime I ran
cargo run --release it didn't find a
config to target my device, so it was building the binary for MacOS.
Make sure that you have your Rust
.cargo/config for any of the embedded projects you're doing at your project root and not somewhere else in the tree.
I hope this saves you ton of head scratching. 🤦♂️