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 a make flag to produce a seperate debug archive #74067

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

Conversation

kevingranade
Copy link
Member

Summary

None

Purpose of change

Split debugging data into separate files.
This also reduces link time and memory utilization.
It also seems to decrease ccache disk utilization locally.

Describe the solution

Add a flag to the Makefile that splits debug data to .dwo files instead of writing them to .o files, and then bundles them into a .dwp file.
This .dwp file will need to be archived and such in CI so we can retrieve it for testing.
For testing and for build speed benefits I'm trying out enabling it on most CI builds.

Testing

Produces .dwo and .dwp files locally.
Launched cataclysm and cata_test under gdb, able to print full backtraces, step, print variable names, etc.
You shouldn't need to do anything to have this work on local builds.

Additional context

This will need some more follow up to bundle the new archive from CI.

@github-actions github-actions bot added Code: Build Issues regarding different builds and build environments Code: Tests Measurement, self-control, statistics, balancing. Code: Tooling Tooling that is not part of the main game but is part of the repo. astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels May 25, 2024
@github-actions github-actions bot removed json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels May 25, 2024
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels May 25, 2024
tests/Makefile Outdated Show resolved Hide resolved
@akrieger
Copy link
Member

akrieger commented May 26, 2024

Segmentation fault (core dumped)

That's not promising lol.

https://github.com/CleverRaven/Cataclysm-DDA/actions/runs/9245036514/job/25431113711#step:14:1147

@akrieger
Copy link
Member

cc1plus: note: ‘-gsplit-dwarf’ is not supported with LTO, disabling

Well there's your problem.

@kevingranade
Copy link
Member Author

Damn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88389

So -flto looks like fundamentally incompatible with -gsplit-dwarf
and I doubt it's worth supporting it for the fat part of the objects.

Need to test on more recent gcc in case they reversed this. LTO is the #1 place where this helps in principle.

@kevingranade
Copy link
Member Author

Clang doesn't seem happy about split-dwarf plus LTO either: https://discourse.llvm.org/t/lto-thinlto-and-split-dwarf/70927
probably just cancel split-dwarf if the LTO flag is set for now, there might be some kind of solution somewhere but no need to block getting this going for all the non-LTO builds first.

@akrieger
Copy link
Member

https://github.com/CleverRaven/Cataclysm-DDA/actions/runs/9248288152/job/25561768627?pr=74067#step:14:533

Seems like it's still OOMing on some builds, in the dwp step.

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@github-actions github-actions bot added the stale Closed for lack of activity, but still valid. label Jun 28, 2024
@Night-Pryanik Night-Pryanik reopened this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions Code: Build Issues regarding different builds and build environments Code: Tests Measurement, self-control, statistics, balancing. Code: Tooling Tooling that is not part of the main game but is part of the repo. json-styled JSON lint passed, label assigned by github actions stale Closed for lack of activity, but still valid.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants