Chase AdamsChase Adams
AboutContentPromptsPlayground

Rust Error for mach-o section specifier requires a segment and section separated by comma

Essays and updates on product, engineering, and AI by Chase Adams.

1 minute read

Lately I've been learning Rust and Embedded Programming at the same time.

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...

My .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.

Solution

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. 🤦‍♂️

First Cohort
No Coding Experience Required

Build Your Website with AI—No Code Required

Learn to create and deploy professional websites using ChatGPT and Claude. Go from complete beginner to confident website builder.

Start Building Today

Post Details

Published
Nov 23, 2023
Category
Engineering
Share
Ask ChatGPT
Ask Claude

Latest Posts

Joining Rocket Money as VP of AI Engineering

Joining Rocket Money as VP of AI Engineering

Leading AI engineering at Rocket Money to write the playbook for how engineering teams operate in the AI era

AboutAI Workflow SpecContentStacksNewsletterPromptsRSS

Ask me anything

Loading...

Hi! Ask me anything about Chase's work.

I can answer questions based on his blog posts and articles.

Experimental: This chat is a side project I work on in my free time. Responses may vary in quality and accuracy.