Building gdextensions with lto=full warns about serial compilaton

Open Beginner friendly
#2,002 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
cpp

Research direction

Start in common_compiler_flags.py and locate the instances of '-flto'. Reproduce the warning with scons lto=full on a GD extension, then verify that the compiler uses parallel LTO without the serial-compilation warning. Confirm the relevant build checks or extension compilation still pass.

Written by the indexing model from the issue text.

Description

enhancement topic:buildsystem
Godot version

4.6

godot-cpp version

3a7edf0

System information

Arch Linux

Issue description

Building GD extensions with the 'lto=full' flag produces the following warning

warning: using serial compilation of 10 LTRANS jobs
lto-wrapper: note: see the '-flto' option documentation for more information

Which slows down compilation times.

After some research the warning appears due to a change in the -flto option introduced in GCC 11.4. The -flto option only uses parallel compilation if explicitly instructed to do so. By default, it uses slow serial compilation. updating "common_compiler_flags.py" to change instances of '-flto' to '-flto=auto' will re-enable parallelization.

Steps to reproduce

Compile any GD Extension with scons lto=full

Minimal reproduction project

N/A

Dominant language
C++
Stars
2.7k
Forks
810
Avg merge
1d 3h
Merged PRs (30d)
8

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from godotengine/godot-cpp

All issues in godotengine/godot-cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.