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

feat: Add support for -fprofile-prefix-path gcc option (#1507) #1515

Merged
merged 1 commit into from
Sep 22, 2024

Conversation

jdavidpeter
Copy link
Contributor

Current CCache (4.10.2) doesn't support shared caching for coverage builds in different build workspaces using gcc as the "apparent real path" of the object file is always part of the cache key.

This is needed as gcc by default uses the "apparent real path" of the object file to create gcda files and therefore these paths will be embedded in the object file.

gcc 10+ added the -fprofile-prefix-path=path option that can be used to lstrip the gcda filenames and enable the same object files to be created in different build workspaces when using --coverage.
This change adds support for -fprofile-prefix-path=path thus enables ccache to reuse object files across build workspaces with the correct settings.

See #1507 for more details.

@jdavidpeter jdavidpeter force-pushed the feature/1507 branch 6 times, most recently from 52b2c73 to 76fa999 Compare September 18, 2024 11:10
@jdavidpeter jdavidpeter marked this pull request as draft September 18, 2024 11:30
Copy link
Member

@jrosdahl jrosdahl left a comment

Choose a reason for hiding this comment

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

Thanks for writing a test case, much appreciated!

src/ccache/argprocessing.cpp Outdated Show resolved Hide resolved
test/suites/profiling_gcc_10+.bash Outdated Show resolved Hide resolved
test/suites/profiling_gcc_10+.bash Outdated Show resolved Hide resolved
test/suites/profiling_gcc_10+.bash Outdated Show resolved Hide resolved
@jrosdahl jrosdahl added this to the 4.11 milestone Sep 21, 2024
@jrosdahl jrosdahl added the feature New or improved feature label Sep 21, 2024
@jdavidpeter jdavidpeter force-pushed the feature/1507 branch 3 times, most recently from f1b30dd to 456d48d Compare September 21, 2024 19:39
@jdavidpeter jdavidpeter marked this pull request as ready for review September 21, 2024 19:41
@jrosdahl jrosdahl linked an issue Sep 22, 2024 that may be closed by this pull request
@jrosdahl jrosdahl merged commit 1e86886 into ccache:master Sep 22, 2024
44 checks passed
@jrosdahl
Copy link
Member

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New or improved feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support to -fprofile-prefix-path=path
2 participants