-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
--disable-debug-info enables debug information #1646
Comments
Doesn't
Maybe you need to use something like the following?
E.g. see here: |
That's a great point re: Looking at the configure code I think that this switch can only add debug symbols, and it seems that the underlying repos (gcc etc.) already have symbols enabled by default somehow. I will try your |
Probably worth looking at the build log to see what flags are being used. It'll be a day or two before I can try a build myself to check this out. |
Thanks for looking at this. I should be able to make some progress with these tips. Would you mind clarifying about the extra variables? Judging by the fact that |
If you want to affect the toolchain binaries themselves then maybe simply |
That was the ticket (for the binaries!). Leaving this open for the libraries. |
Does a combination of |
FWIW, as far as I can see the I presume that the issue for you @jefftrull is that you want the toolchain to be as lean as possible and not unnecessarily carrying any additional baggage such as debug info/symbols? Just tagging @ilg-ul to ask if he does something different with his xPack build in order to produce a toolchain distro that bundles some or all components already stripped? |
Can you be more specific? There are a lot of configuration options, both for GCC and binutils. |
Are some, most or all cross development host and RISC-V target binaries/libraries/object files in the xPack RISC-V GCC toolchain stripped (of debug information/symbols)? I just haven't had a chance to check. |
I did not check either, but, as far as I remember, the xPack build scripts strip all native executables and libraries of debug information. There are options to prevent this for development builds. As for the cross libraries... I don't know, but generally running debug sessions with the GCC runtime and newlib libraries is not possible. |
Unfortunately not.
It looks to me as though |
@jefftrull, what is the problem with debug information in the libraries? In a bare-metal deployment scenario the debug info sections are never actually loaded on the target. They just exist in the ELF file on the development host to facilitate debugging. What is the exact problem that you are trying to address here? Other than the fact (it seems) that |
The xPack build scripts run lots of post-processing actions, including stripping debug infos. |
I am creating Docker container images containing the toolchain, for continuous integration and other purposes. The images produced at the moment are surprisingly large, consuming resources on the host machines as well as taking up time for data transfer. I also discovered that it increases build time (I assume for writing all this data to disk). |
I've made an interesting discovery. So when I tried to remove debug symbols from the toolchain binaries by using So maybe the proper procedure is:
|
If you identified a bug in the configure script, please report it to GCC bugzilla. |
That's the riscv-gnu-toolchain configure script :) |
Seems to be inverted alright?
|
Looks to me like maybe the option
Maybe @kito-cheng, @cmuellner or @jeremybennett might know more about this? Is |
For now I think that you need to do this:
So, by default and unless explicitly requested otherwise, the libs are built without debug info. |
And to build the toolchain binaries (that run on the cross development host system) with/without debug info:
|
FWIW...
|
I am building toolchains for use in Docker containers and I find that the
--disable-debug-info
configure option does nothing - debug info is always present in the toolchain binaries, causing my container images to be very large. For example:shows all the binaries as
with debug_info, not stripped
.I can see that
--enable-debug-info
does add-g
to the compile flags, but it seems like it must be there by default in gcc (at least) and what we need is some way of turning that off.The text was updated successfully, but these errors were encountered: