GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-30345: Add -g to LDFLAGS to ease debug by vstinner · Pull Request #7709 · python/cpython Conversation
|
|
cc @Traceur759 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hum, who can review this change? :-) @pitrou @ned-deily @serhiy-storchaka @methane @doko42 modified configure.ac recently. Also @encukou maybe? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| fi | ||
| # bpo-30345: When using PGO+LTO and compile without LDFLAGS=-g, | ||
| # gdb fails to get function arguments. | ||
| LDFLAGS="$LDFLAGS -g" |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be added only in debug mode? I afraid that adding -g in release mode can disable some optimizations.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We already always pass -g to CFLAGS, even in release mode.
Extract of gcc manual page:
-g Produce debugging information in the operating system's native
format (stabs, COFF, XCOFF, or DWARF). GDB can work with this
debugging information.
On most systems that use stabs format, -g enables use of extra
debugging information that only GDB can use; this extra information
makes debugging work better in GDB but probably makes other
debuggers crash or refuse to read the program. If you want to
control for certain whether to generate the extra information, use
-gstabs+, -gstabs, -gxcoff+, -gxcoff, or -gvms (see below).
It's unrelated to optimizations. It's just an option to ask to include also debug symbols in the produced binary file (like ELF file on Linux).
If you want to get ride of them, just run "strip python". Linux vendors are able to distribute these debug symbols in a different package, like python-debuginfo on Fedora.
I'm not 100% sure, that's why I'm asking for a review :-)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thank you, now I got this.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think it's ok to add |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
AFAIK, LINKCC is CC for most case, but not always. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I think it means whether CC supports |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
"AFAIK, -g is required only when LTO because code generation is happen in link time. So I think it's safer that adding -g here in configure.ac." Done. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
"(also, what exactly is $ac_cv_prog_cc_g?) I think it means whether CC supports -g or not." Hum, why, I cannot add -g for all platforms? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Only add -g if it's supported by the C compiler.
|
I don't know linker without -g support. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I modified my PR to respect $ac_cv_prog_cc_g. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm sorry, I meant why ac_cv_prog_cc_g is used in general. LTO is used only with clang and gcc. So no need to worry about others when adding |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm OK to merge this with or without $ac_cv_prog_cc_g check. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @vstinner, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add -g to LDFLAGS when compiling with LTO to get debug symbols. (cherry picked from commit 06fe77a) Co-authored-by: Victor Stinner <[email protected]>
|
GH-7824 is a backport of this pull request to the 3.7 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-7826 is a backport of this pull request to the 3.6 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add -g to LDFLAGS when compiling with LTO to get debug symbols. (cherry picked from commit 06fe77a) Co-authored-by: Victor Stinner <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.