Skip to content

[Dependency Scan] Do not pass clang's -dwarf-debug-flags to swift #79179

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

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

cachemeifyoucan
Copy link
Contributor

When turning on directCC1 scanning, swift will ask clang driver to expand all cc1 flags and pass that explicitly on command-line. In such case, if RC_DEBUG_OPTIONS env is set on darwin platform, it will cause clang driver to encode all the options it gets and pass those clang driver options as a cc1 options -dwarf-debug-flags.

After the change, swift scanner will no longer generate a long -Xcc -dwarf-debug-flag -Xcc <long list of flags> for later compilation. Losing such information in DWARF doesn't affect swift debugging. It will instead, make command-line a lot shorter, save spaces in swift binary module, and make swift caching build more reliable.

rdar://144267483

When turning on directCC1 scanning, swift will ask clang driver to
expand all cc1 flags and pass that explicitly on command-line. In such
case, if `RC_DEBUG_OPTIONS` env is set on darwin platform, it will cause
clang driver to encode all the options it gets and pass those clang
driver options as a cc1 options `-dwarf-debug-flags`.

After the change, swift scanner will no longer generate a long
`-Xcc -dwarf-debug-flag -Xcc <long list of flags>` for later
compilation. Losing such information in DWARF doesn't affect swift
debugging. It will instead, make command-line a lot shorter, save spaces
in swift binary module, and make swift caching build more reliable.

rdar://144267483
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

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

This LGTM. The embedded clang's flags are not interesting in the use case RC_DEBUG_OPTIONS is intended for.

@cachemeifyoucan cachemeifyoucan merged commit e17556a into swiftlang:main Feb 6, 2025
3 checks passed
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.

2 participants