Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for setting -gdwarf-{version} based on RUSTFLAGS #1395

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wesleywiser
Copy link
Member

Detect if -Zdwarf-version (which will probably be stabilized soon as -Cdwarf-version) was passed in RUSTFLAGS and set the corresponding Clang/GCC option to the same value.

Detect if `-Zdwarf-version` (which will probably be stabilized soon
as `-Cdwarf-version`) was passed in RUSTFLAGS and set the corresponding
Clang/GCC option to the same value.
Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

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

Thanks LGTM!

cc @madsmtm for a double checkq

Copy link
Collaborator

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

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

Looks fine after parsing. I verified that the semantics are the same.

// https://doc.rust-lang.org/beta/unstable-book/compiler-flags/dwarf-version.html
// FIXME: Drop the -Z variant and update the doc link once the option is stablized
"-Zdwarf-version" | "-Cdwarf-version" => {
self.dwarf_version = Some(flag_ok_or(value, "-Zdwarf-version must have a value")?);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can imagine us wanting to do different stuff based on the actual version, so maybe we should parse it to an integer here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add a helper arg_to_int or smth, similar to arg_to_bool.

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.

3 participants