Skip to content

Driver: correct profiling symbol preservation on Windows #37605

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
May 24, 2021

Conversation

compnerd
Copy link
Member

The Windows linker does not support -u. Furthermore, the compiler
driver does not forward the -u option to the linker. We correctly use
the /include: option from the linker. This should ensure that the
symbol is preserved even with /opt:ref. This spelling should be
compatible with both lld and link, which should provide sufficient
portability.

Take the opportunity to make it more obvious that the two parameters are
creating a pair that will be concatenated by using a braced initializer.

See
https://docs.microsoft.com/en-us/cpp/build/reference/include-force-symbol-references?view=msvc-160
for more details on the option.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

The Windows linker does not support `-u`.  Furthermore, the compiler
driver does not forward the `-u` option to the linker.  We correctly use
the `/include:` option from the linker.  This should ensure that the
symbol is preserved even with `/opt:ref`.  This spelling should be
compatible with both lld and link, which should provide sufficient
portability.

Take the opportunity to make it more obvious that the two parameters are
creating a pair that will be concatenated by using a braced initializer.

See
https://docs.microsoft.com/en-us/cpp/build/reference/include-force-symbol-references?view=msvc-160
for more details on the option.
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd compnerd merged commit 1050470 into swiftlang:main May 24, 2021
@compnerd compnerd deleted the preservation branch May 24, 2021 00:09
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