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

Python 3.8.13 unconditionally enables -g with LTO even without debug features #91620

Closed
mandree opened this issue Apr 16, 2022 · 3 comments
Closed
Labels
build The build process and cross-build pending The issue will be closed if no feedback is provided type-bug An unexpected behavior, bug, or error

Comments

@mandree
Copy link

mandree commented Apr 16, 2022

Python 3.8.13 unconditionally adds -g to CFLAGS and LDFLAGS if LTO is enabled, even if no debugging support is requested. This considerably raises memory requirements, and I am unable to link Python 3.8.13 with LTO on FreeBSD 13.0 amd64 on a computer with 1 GB RAM + 1 GB swap, where I used to be able to link it without -flto -g. (This computer uses clang 11 as system compiler, and ld.lld for the linker).

Manually removing the excess -g from CFLAGS and LDFLAGS (CONFIGURE_*FLAGS_NODIST) considerably reduces memory requirement of the linker to below 400 MB virtual, and the computer does not need to reach into swap, in spite of LTO.

I am hereby proposing that configure.ac should only add the -g along with -flto if debug support is enabled.

@mandree mandree added the type-bug An unexpected behavior, bug, or error label Apr 16, 2022
@sweeneyde sweeneyde added the build The build process and cross-build label Apr 16, 2022
@erlend-aasland
Copy link
Contributor

See also gh-74530

@erlend-aasland
Copy link
Contributor

Based on a quick glance at the discussion in gh-74530, I don't expect the -g flag to be removed with LTO any time soon. Unless the problem in gh-74530 is no longer a problem, or it can be worked around in another way.

@erlend-aasland erlend-aasland added the pending The issue will be closed if no feedback is provided label May 19, 2022
@erlend-aasland
Copy link
Contributor

Closing due to the lack of response.

@erlend-aasland erlend-aasland closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build pending The issue will be closed if no feedback is provided type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants