Skip to content

build: Honor Cargo debug info on Apple targets. - #2881

Open
booxter wants to merge 1 commit into
briansmith:mainfrom
booxter:apple-uuid-debug
Open

booxter wants to merge 1 commit into
briansmith:mainfrom
booxter:apple-uuid-debug

Conversation

@booxter

@booxter booxter commented Oct 16, 2026

Copy link
Copy Markdown

Debug info embeds archive paths in the Mach-O debug map, which can
change the linked binary's UUID when the build path length changes. Let
cc use Cargo's debug info setting instead of forcing -gfull.

Observed in nixpkgs buzz-cli where we have to pass the following for
reproducible builds: link-arg=-Wl,-no_uuid

Note: tried with -g3 to -g1 and they are all non-reproducible on macOS.

Debug info embeds archive paths in the Mach-O debug map, which can
change the linked binary's UUID when the build path length changes. Let
cc use Cargo's debug info setting instead of forcing -gfull.

Observed in nixpkgs buzz-cli where we have to pass the following for
reproducible builds: link-arg=-Wl,-no_uuid

Note: tried with -g3 to -g1 and they are all non-reproducible on macOS.
Comment thread build/build/c.rs
}

if APPLE_ABI.contains(&target.os.as_str()) {
// ``-gfull`` is required for Darwin's |-dead_strip|.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to come from old GCC days, but I'm not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant