Skip to content

[Infrastructure] Use -gsplit-dwarf to improve linking#14145

Open
ktf wants to merge 2 commits intoAliceO2Group:masterfrom
ktf:split-dwarf
Open

[Infrastructure] Use -gsplit-dwarf to improve linking#14145
ktf wants to merge 2 commits intoAliceO2Group:masterfrom
ktf:split-dwarf

Conversation

@ktf
Copy link
Member

@ktf ktf commented Dec 9, 2025

No description provided.

@ktf ktf requested review from a team, alibuild, ddobrigk, iarsene and jgrosseo as code owners December 9, 2025 14:25
@github-actions
Copy link

github-actions bot commented Dec 9, 2025

O2 linter results: ❌ 0 errors, ⚠️ 0 warnings, 🔕 0 disabled

@github-actions github-actions bot changed the title Use -gsplit-dwarf=single to improve linking [Infrastructure] Use -gsplit-dwarf=single to improve linking Dec 9, 2025
@ktf
Copy link
Member Author

ktf commented Dec 9, 2025

In my minimal test seems to speed up building by 15%.

@alibuild
Copy link
Collaborator

alibuild commented Dec 9, 2025

Error while checking build/O2Physics/o2 for 7147fe1 at 2026-02-17 12:53:

## sw/BUILD/O2Physics-latest/log
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
c++: error: unrecognized debug output level 'split-dwarf=single'
ninja: build stopped: subcommand failed.

Full log here.

@vkucera
Copy link
Collaborator

vkucera commented Feb 19, 2026

@ktf The option -gsplit-dwarf does not seem to take any arguments.

@ktf ktf requested a review from dsekihat as a code owner February 19, 2026 07:49
@ktf
Copy link
Member Author

ktf commented Feb 19, 2026

Indeed... It's only supported by Clang... :-/ We can have the version without the option, however it will mean that we have to do some extra juggling to get the debug symbols working.

@vkucera
Copy link
Collaborator

vkucera commented Feb 19, 2026

Indeed... It's only supported by Clang... :-/ We can have the version without the option, however it will mean that we have to do some extra juggling to get the debug symbols working.

Isn't it enough to just use the Clang version for macOS and the GCC version for Linux?

@ktf
Copy link
Member Author

ktf commented Feb 19, 2026

This is only for linux (Clang and Linux), on macOS the debug symbols are handled in a different way (via .dSYM) and this does not really apply.

The GCC version will need some extra juggling in any case to allow the debugger to find the debug symbols. The nice thing of =single, AFAICT, is that there is still only one file (hence the name). Still, the debug information is completely separate with such an option from the elf layout point of view and the linker does way less heavy lifting to merge multiple objects.

@vkucera vkucera changed the title [Infrastructure] Use -gsplit-dwarf=single to improve linking [Infrastructure] Use -gsplit-dwarf to improve linking Feb 19, 2026
@alibuild
Copy link
Collaborator

alibuild commented Feb 25, 2026

Error while checking build/O2Physics/o2 for 5a0f145 at 2026-03-06 06:22:

[2882/2953] Linking CXX executable stage/bin/o2-analysistutorial-mm-my-example-task
[2883/2953] Building CXX object Tutorials/PWGLF/Strangeness/Derived/Analysis/CMakeFiles/O2Physicsexe-analysistutorial-lf-strangeness-derived-step2.dir/strangeness_derived_step2.cxx.o
[2884/2953] Building CXX object Tutorials/PWGCF/TwoParticleCorrelations/CMakeFiles/O2Physicsexe-analysis-cf-firstcfcorr.dir/src/firstcfcorrelations.cxx.o
[2885/2953] Linking CXX executable stage/bin/o2-analysistutorial-lf-strangeness-derived-step2
[2886/2953] Building CXX object Tutorials/PWGCF/EventPlane/src/CMakeFiles/O2Physicsexe-analysis-cf-spectator-plane-tutorial.dir/spectatorPlaneTutorial.cxx.o
[2887/2953] Linking CXX executable stage/bin/o2-analysis-cf-firstcfcorr
[2888/2953] Building CXX object Tutorials/PWGCF/FlowGenericFramework/src/CMakeFiles/O2Physicsexe-analysis-cf-flow-gfw-tutorial.dir/flowGFWTutorial.cxx.o
[2889/2953] Building CXX object Tutorials/PWGLF/Strangeness/Derived/Analysis/CMakeFiles/O2Physicsexe-analysistutorial-lf-strangeness-derived-step4.dir/strangeness_derived_step4.cxx.o
[2890/2953] Linking CXX executable stage/bin/o2-analysis-cf-spectator-plane-tutorial
[2891/2953] Building CXX object Tutorials/PWGLF/Strangeness/Original/CMakeFiles/O2Physicsexe-analysistutorial-lf-strangeness-step4.dir/strangeness_step4.cxx.o
[2892/2953] Linking CXX executable stage/bin/o2-analysis-cf-flow-gfw-tutorial
[2893/2953] Building CXX object Tutorials/PWGLF/Strangeness/Original/CMakeFiles/O2Physicsexe-analysistutorial-lf-strangeness-step3.dir/strangeness_step3.cxx.o
[2894/2953] Linking CXX executable stage/bin/o2-analysistutorial-lf-strangeness-derived-step4
[2895/2953] Linking CXX executable stage/bin/o2-analysistutorial-lf-strangeness-step4
[2896/2953] Linking CXX executable stage/bin/o2-analysistutorial-lf-strangeness-step3
[2897/2953] Building CXX object EventFiltering/CMakeFiles/O2Physicsexe-analysis-selected-bc-range-task.dir/selectBCRange.cxx.o
[2898/2953] Building CXX object Tutorials/PWGCF/FemtoFramework/CMakeFiles/O2Physicsexe-analysistutorial-cf-femtodream-tutorial-1.dir/src/CFTutorialTask1.cxx.o
[2899/2953] Building CXX object Tutorials/PWGHF/CMakeFiles/O2Physicsexe-analysistutorial-hf-skim-creator-mini.dir/skimCreatorMini.cxx.o
[2900/2953] Linking CXX executable stage/bin/o2-analysis-selected-bc-range-task
[2901/2953] Linking CXX executable stage/bin/o2-analysistutorial-cf-femtodream-tutorial-1
[2902/2953] Linking CXX executable stage/bin/o2-analysistutorial-hf-skim-creator-mini
[2903/2953] Building CXX object Tutorials/PWGCF/FemtoFramework/CMakeFiles/O2Physicsexe-analysistutorial-cf-femtodream-tutorial-3.dir/src/CFTutorialTask3.cxx.o
[2904/2953] Building CXX object Tutorials/PWGCF/FemtoFramework/CMakeFiles/O2Physicsexe-analysistutorial-cf-femtodream-tutorial-4.dir/src/CFTutorialTask4.cxx.o
[2905/2953] Linking CXX executable stage/bin/o2-analysistutorial-cf-femtodream-tutorial-3
[2906/2953] Building CXX object Tutorials/PWGCF/FemtoFramework/CMakeFiles/O2Physicsexe-analysistutorial-cf-femtodream-tutorial-2.dir/src/CFTutorialTask2.cxx.o
[2907/2953] Linking CXX executable stage/bin/o2-analysistutorial-cf-femtodream-tutorial-4
[2908/2953] Linking CXX executable stage/bin/o2-analysistutorial-cf-femtodream-tutorial-2
[2909/2953] Building CXX object Tutorials/PWGHF/CMakeFiles/O2Physicsexe-analysistutorial-hf-task-mini.dir/taskMini.cxx.o
[2910/2953] Building CXX object EventFiltering/CMakeFiles/O2Physicsexe-analysis-central-event-filter-task.dir/cefpTask.cxx.o
[2911/2953] Linking CXX executable stage/bin/o2-analysistutorial-hf-task-mini
[2912/2953] Linking CXX executable stage/bin/o2-analysis-central-event-filter-task
[WARN] Missing configuration json file: full_config.json
[INFO] NucleiFilters not present in the configuration, removing it.
[INFO] DiffractionFilters not present in the configuration, removing it.
[INFO] DqFilters not present in the configuration, removing it.
[INFO] HfFilters not present in the configuration, removing it.
[INFO] CFFilters not present in the configuration, removing it.
[INFO] JetFilters not present in the configuration, removing it.
[INFO] JetHFFilters not present in the configuration, removing it.
[INFO] FullJetFilters not present in the configuration, removing it.
[INFO] StrangenessFilters not present in the configuration, removing it.
[INFO] MultFilters not present in the configuration, removing it.
[INFO] PhotonFilters not present in the configuration, removing it.
[INFO] F1ProtonFilters not present in the configuration, removing it.
[INFO] DoublePhiFilters not present in the configuration, removing it.
[INFO] HeavyNeutralMesonFilters not present in the configuration, removing it.
[INFO] GlobalDimuonFilters not present in the configuration, removing it.
[INFO] H2fromLbFilters not present in the configuration, removing it.
[2913/2953] Building CXX object Tutorials/PWGCF/FemtoFramework/CMakeFiles/O2Physicsexe-analysistutorial-cf-femtodream-tutorial-5.dir/src/CFTutorialTask5.cxx.o
[2914/2953] Linking CXX executable stage/bin/o2-analysistutorial-cf-femtodream-tutorial-5

Full log here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants