Skip to content

Conversation

@voltur01
Copy link
Contributor

No description provided.

Change-Id: Ie4da7fd0209b6cc613c0cf148a9408492495ef8b
@pratlucas
Copy link
Contributor

Do we want to disable the debug symbols for all build types, or only for release builds?

@voltur01
Copy link
Contributor Author

Build types: do you mean that we have release and minsize e.g. in https://github.com/arm/arm-toolchain/blob/arm-software/arm-software/embedded/arm-multilib/json/variants/armv8m.main_hard_fp_exn_rtti.json and https://github.com/arm/arm-toolchain/blob/arm-software/arm-software/embedded/arm-multilib/json/variants/armebv6m_soft_nofp.json ?

Then yes, both.

I believe that the debug symbols are not usable anyway because they refer to source files from the build server. There may be a separate question if we want to make it possible to rebuild libraries locally with usable symbols - not sure that we have an immediate use case for that.

@smithp35
Copy link
Contributor

Meson looks to have some strange interaction with buildtype and debug
https://mesonbuild.com/Builtin-options.html#details-for-buildtype

I think buildtype=release would use O3 and disable debug
buildtype=minsize enables Debug so we'd need to manually disable with -debug.

I think it is reasonable to have the library debug settings separate from the tools. I think if a developer wants picolibc debug then they can alter the buildscript.

@voltur01
Copy link
Contributor Author

I think buildtype=release would use O3 and disable debug

this was my reading of the docs as well, but still variants built with release had debug symbols included.

Copy link
Contributor

@smithp35 smithp35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm comfortable with turning off debug for the libraries build. It is the only option that is documented to work with both a buildtype of minsize and release.

There's a possibility that we could detect if the CMake build type is debug and only put this in if that's the case, but I expect debugging the tools to be a separate use case from debugging the libraries. Perhaps in future we could add a separate PICOLIBC_DEBUG variable if needed.

@voltur01
Copy link
Contributor Author

Would it help if we derive picolibc debug symbols option value based on CMAKE_BUILD_TYPE? Should be straightforward to do.

@smithp35
Copy link
Contributor

Would it help if we derive picolibc debug symbols option value based on CMAKE_BUILD_TYPE? Should be straightforward to do.

Personally I don't think its worth it. It may be a bit more work than that if we want to try and map the CMAKE_BUILD_TYPEs to meson.

Thinking of what would happen for llvm-project libraries. As I understand it they would inherit the CMAKE_BUILD_TYPE value that is used for the tools. However for picolibc we hard code the optimisation level on a per library level.

I think we could simply map meson's debug=true to CMAKE_BUILD_TYPE=Debug or CMAKE_BUILD_TYPE=RelWithDebInfo without tinkering with the optimization option. However that won't make for a good debugging experience, Ideally we'd want to turn off optimization with CMAKE_BUILD_TYPE=Debug. That would mean overriding the per-library choice.

@voltur01 voltur01 merged commit 3e5e650 into arm:arm-software Feb 26, 2025
voltur01 added a commit to voltur01/arm-toolchain that referenced this pull request Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants