-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fixed zstd-pgo target for GCC #3281
Conversation
Since your Makefile uses obj/$(HASH_DIR) for object files, this code does not work correctly for GCC. Because profiles are saved in one directory, and are expected in another when reading. `$(RM) zstd *.o` - this line doesn't delete object files. Clang stores profiles in the current directory, so the problem doesn't appear when compiling with Clang. Also this code will work if BUILD_DIR is set.
programs/Makefile
Outdated
ifndef BUILD_DIR | ||
$(RM) zstd obj/$(HASH_DIR)/*.o | ||
else | ||
$(RM) zstd $(BUILD_DIR)/*.o | ||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest removing obj/$(HASH_DIR)/zstd
and $(BUILD_DIR)/zstd
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I also suggest re-using commit message from #3282 which sheds some light on the history of the issue. |
Just a precaution, because it works anyway.
I suggest this PR to be merged, this would be the first commit from Ilya into this repository, which in turn would facilitate his patch submissions in the future. |
Thanks ! |
Since your Makefile uses obj/$(HASH_DIR) for object files, this code does not work correctly for GCC. Because profiles are saved in one directory, and are expected in another when reading.
$(RM) zstd *.o
- this line doesn't delete object files.Clang stores profiles in the current directory, so the problem doesn't appear when compiling with Clang.
Also this code will work if BUILD_DIR is set.
Additional comment from @ldv-alt: