RFR: 8271148: static-libs-image target --with-native-debug-symbols=external doesn't produce debug info

Severin Gehwolf sgehwolf at openjdk.java.net
Thu Jul 22 18:13:21 UTC 2021


On Thu, 22 Jul 2021 17:38:28 GMT, Mikael Vidstedt <mikael at openjdk.org> wrote:

>> Hi!
>> 
>> Please review this tiny patch which removes the special casing of `--with-native-debug-symbols=external` for the static libs build. I don't see why this is needed. If no debug symbols are wanted `--with-native-debug-symbols=none` can be used to achieve the same effect. Therefore, I propose to remove this hunk.
>> 
>> Testing: Inspecting of the log files and seeing that `-g` switch is there. Run the reproducer test on the resulting static libraries.
>> 
>> Thoughts?
>
> If I understand things correctly (and I may well be misunderstanding something), with this change the debug symbols are included in release versions of the static libraries when --with-native-debug-symbols=external is specified. That's a significant change - people may be depending on debug symbols *not* being included in the resulting release binaries.
> 
> Doesn't --with-native-debug-symbols=none turn off debug symbols completely for all native code? What if one wants external debug symbols for other (non-static) libraries?

@vidmik Yes, correct. It's equally incorrect to **not** produce any debuginfo for `--with-native-debug-symbols=external`, no? With this change we have a situation where the external case for static libraries would have them include like the 'internal' case does. What's missing is the stripping part of `*.a` files, which if desired can get added to this patch too (for Linux). But to me this special casing, is not very intuitive either. Thoughts?

> Doesn't --with-native-debug-symbols=none turn off debug symbols completely for all native code? What if one wants external debug symbols for other (non-static) libraries?

Yes. Are you suggesting that somebody is relying on these exact semantics? Configure **once** with `--with-native-debug-symbols=external` and expect static libs to have *no* debuginfo (neither inline nor in an external file) while shared bits should have them in external files? That use case would still be possible by using two configurations. One with `--with-native-debug-symbols=external` and one with `--with-native-debug-symbols=none` and building only the needed targets each.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4876



More information about the build-dev mailing list