Skip to content

Conversation

icegood
Copy link
Contributor

@icegood icegood commented Aug 13, 2024

Description (original from @icegood)

With this PR it is easier to create more rigorous debug builds for further debugging in gdb. (for at least spk/ffmpeg)
Not applicable out of the box since other dependant repos need to be fit as well.

To check against: https://github.com/icegood/spksrc/tree/fix/libpng_debug_builds at it fixes png bug

Applicable for issue #6176

Additions (from @th0ma7)

  1. Dissociate CMake toolchain file generation from default spksrc.cross-cmake.mk (similar to meson)
  2. Enforce using an "empty" environment for both CMake and meson (fix issue against 'build' vs 'host' builds)
  3. Fix meson crossfile generation - needs [built-in options] and fortran_* instead of fc_*
  4. Fix CMake toolchain file generation with regards to ldshared definition
  5. Add CMAKE_*_FOR_BUILD to CMake toolchain definition
  6. Enable enforcing passing proper debug flags throughout CMake and Meson builds
  7. Add passing debug flags to ENV with autoconf/autotools
  8. Fixed a few cross/* Debug compile errors
  9. Fixed situation where spksrc.copy.mk would not exit on error using tar from pipe
  10. Updated cross/* when extra code was needed to allow debug build to work

Relates to #6719

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Bug fix
  • New Package
  • Package update
  • Includes small framework changes
  • This change requires a documentation update (e.g. Wiki)

Tests

Tested in debug mode against:

  • synocli-videodriver
  • ffmpeg
  • python312
  • tvheadend

Copy link
Contributor

@th0ma7 th0ma7 left a comment

Choose a reason for hiding this comment

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

First off, thnx a lot for your contribution. You actually went quite a bit into the weeds in here, well done. You'll find a a few questions, suggestions & changes proposed part of my review.

for at least spk/ffmpeg

To check against
https://github.com/icegood/spksrc/tree/fix/libpng_debug_builds
at it fixes png bug

Applicable for issue SynoCommunity#6176

Signed-off-by: Serhii Ivanov <[email protected]>
@th0ma7 th0ma7 force-pushed the fix/ffmpeg6_debug_builds branch from 5b303d0 to 2e7248b Compare September 23, 2025 21:09
@hgy59 hgy59 mentioned this pull request Sep 25, 2025
6 tasks
- Now enforce cleaning-up the environment to discard any *FLAGS
  which in turns avoid conflicting with 'build' vs 'host' compiling
  flags and should avoid generating 'build' targetted compiled tools
  to end-up being 'host' targetted arch due to env flags.
- Generation of the CMake toolchain file is now within its own
  spksrc.cross-cmake-toolchainfile.mk similar to meson using
  spksrc.cross-meson-crossfile.mk using the same code layout
@th0ma7 th0ma7 requested a review from hgy59 September 26, 2025 16:00
@th0ma7
Copy link
Contributor

th0ma7 commented Sep 26, 2025

@hgy59 Due to a crash with tvheadend I needed to generate a dull Debug build of its entire stack... i recalled the nice work from @icegood that I reused and enhanced and with it I can now generate a fully consistent debug build with proper debug_info sympbols. This is turn allow proper gdb usage to track exactly where the issue is.

If you don't mind having a look at this - and testing a few builds that you think may be useful to validate - would be real nice. Thnx.

@th0ma7
Copy link
Contributor

th0ma7 commented Sep 27, 2025

@hgy59 i've hit a few corner cases, needs a bit more love before its fully baked.

@th0ma7
Copy link
Contributor

th0ma7 commented Sep 29, 2025

@hgy59 I believe it is now ready for review and testing. I suggest you add GCC_DEBUG_INFO := 1 to spk you whishes to test in full. It should not impact normal (e.g. non-debug) builds although changes are a bit more agressive than anticipated.

EDIT: This PR is a hard dependency for #6719

@th0ma7
Copy link
Contributor

th0ma7 commented Sep 30, 2025

Builds looks good, from my perspective this is now ready for merge.

@th0ma7 th0ma7 merged commit 1dbe2db into SynoCommunity:master Sep 30, 2025
7 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants