Repository: godot
Issue: Warnings emitted with GCC when linking with LTO
Labels: bug,topic:buildsystem,topic:thirdparty

### Tested versions

4.3.dev (5f05e2b9b1a3fedcdd7ecb2ab976a2687fd6f19a)

### System information

Fedora Linux 39 (KDE Plasma) - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 7600M XT (RADV NAVI33) () - AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (16 Threads)

### Issue description

Compiling on Fedora 39 with GCC 13.2.1-6 with `scons production=yes` (i.e. optimizations + LTO), the following warnings are emitted by thirdparty libraries:

- [x] **basis_universal/jpeg-compressor** #88508

```
thirdparty/basis_universal/encoder/jpgd.h:123:15: warning: type 'struct jpeg_decoder' violates the C++ One Definition Rule [-Wodr]
  123 |         class jpeg_decoder
      |               ^
thirdparty/jpeg-compressor/jpgd.h:124: note: a different type is defined in another translation unit
  124 |         class jpeg_decoder
      | 
thirdparty/jpeg-compressor/jpgd.h:276: note: the first difference of corresponding definitions is field 'm_has_sse2'
  276 |                 bool m_has_sse2;
      | 
thirdparty/jpeg-compressor/jpgd.h:124: note: a type with different number of fields is defined in another translation unit
  124 |         class jpeg_decoder
      | 
```

- [ ] **clipper2**

``` 
thirdparty/clipper2/src/clipper.engine.cpp: In member function 'AddPaths.constprop':
thirdparty/clipper2/src/clipper.engine.cpp:591:53: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  591 |     Vertex* vertices = new Vertex[total_vertex_count], * v = vertices;
      |                                                     ^
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
```

- [ ] **freetype**

```
thirdparty/freetype/src/autofit/afglobal.c: In function 'af_face_globals_new':
thirdparty/freetype/src/autofit/afglobal.c:344:5: warning: 'memset' writing 696 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
  344 |     FT_ZERO( &globals->metrics );
      |     ^
lto1: note: destination object is likely at address zero
```

- [ ] **glslang**

```
In function 'ProcessDeferred',
    inlined from 'CompileDeferred' at thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp:1299:27,
    inlined from 'parse' at thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp:1866:27,
    inlined from 'parse' at thirdparty/glslang/glslang/Include/../Public/ShaderLang.h:666:21,
    inlined from 'parse' at thirdparty/glslang/glslang/Include/../Public/ShaderLang.h:672:21,
    inlined from '_compile_shader_glsl' at modules/glslang/register_types.cpp:142:19:
thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp:819:39: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  819 |     std::unique_ptr<size_t[]> lengths(new size_t[numTotal]);
      |                                       ^
/usr/include/c++/13/new: In function '_compile_shader_glsl':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In function 'ProcessDeferred',
    inlined from 'CompileDeferred' at thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp:1299:27,
    inlined from 'parse' at thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp:1866:27,
    inlined from 'parse' at thirdparty/glslang/glslang/Include/../Public/ShaderLang.h:666:21,
    inlined from 'parse' at thirdparty/glslang/glslang/Include/../Public/ShaderLang.h:672:21,
    inlined from '_compile_shader_glsl' at modules/glslang/register_types.cpp:142:19:
thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp:820:44: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  820 |     std::unique_ptr<const char*[]> strings(new const char*[numTotal]);
      |                                            ^
/usr/include/c++/13/new: In function '_compile_shader_glsl':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In function 'ProcessDeferred',
    inlined from 'CompileDeferred' at thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp:1299:27,
    inlined from 'parse' at thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp:1866:27,
    inlined from 'parse' at thirdparty/glslang/glslang/Include/../Public/ShaderLang.h:666:21,
    inlined from 'parse' at thirdparty/glslang/glslang/Include/../Public/ShaderLang.h:672:21,
    inlined from '_compile_shader_glsl' at modules/glslang/register_types.cpp:142:19:
thirdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp:821:42: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  821 |     std::unique_ptr<const char*[]> names(new const char*[numTotal]);
      |                                          ^
/usr/include/c++/13/new: In function '_compile_shader_glsl':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
```

- [ ] **icu4c** For second issue, see discussion in #88659.

```
thirdparty/icu4c/common/udata.cpp:646: warning: type of 'icudt_godot74_dat' does not match original declaration [-Wlto-type-mismatch]
  646 | extern "C" const DataHeader U_DATA_API U_ICUDATA_ENTRY_POINT;
      | 
thirdparty/icu4c/icudata.gen.h:10: note: 'icudt_godot74_dat' was previously declared here
   10 | extern "C" U_EXPORT const unsigned char U_ICUDATA_ENTRY_POINT[] = {
      |
```
```
In member function 'compactIndex',
    inlined from 'compactTrie' at thirdparty/icu4c/common/umutablecptrie.cpp:1571:39:
thirdparty/icu4c/common/umutablecptrie.cpp:1307:5: warning: 'memcpy' writing between 128 and 2048 bytes into a region of size 24 overflows the destination [-Wstringop-overflow=]
 1307 |     uprv_memcpy(index16, fastIndex, fastIndexLength * 2);
      |     ^
thirdparty/icu4c/common/cmemory.cpp: In member function 'compactTrie':
thirdparty/icu4c/common/cmemory.cpp:30: note: destination object 'zeroMem' of size 24
   30 | static const int32_t zeroMem[] = {0, 0, 0, 0, 0, 0};
      | 
```

- [ ] **libktx/vulkan**

``` 
thirdparty/vulkan/include/vulkan/vulkan_core.h:1406: warning: type 'VkFormat' violates the C++ One Definition Rule [-Wodr]
 1406 | typedef enum VkFormat {
      |
thirdparty/vulkan/include/vulkan/vulkan_core.h:1626: note: name 'VK_FORMAT_G8_B8R8_2PLANE_444_UNORM' differs from name 'VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG' defined in another translation unit
 1626 |     VK_FORMAT_G8_B8R8_2PLANE_444_UNORM = 1000330000,
      | 
thirdparty/libktx/lib/vkformat_enum.h:21: note: an enum with different value name is defined in another translation unit
   21 | typedef enum VkFormat {
      |
thirdparty/libktx/lib/vkformat_enum.h:241: note: mismatching definition
  241 |     VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
      | 
```

- [ ] **mbedtls**

```
thirdparty/mbedtls/library/ssl_tls.c: In function 'ssl_calc_finished_tls_sha384':
thirdparty/mbedtls/library/ssl_tls.c:3316:5: warning: 'mbedtls_sha512_finish_ret' accessing 64 bytes in a region of size 48 [-Wstringop-overflow=]
 3316 |     mbedtls_sha512_finish_ret(&sha512, padbuf);
      |     ^
thirdparty/mbedtls/library/ssl_tls.c:3316:5: note: referencing argument 2 of type 'unsigned char[64]'
thirdparty/mbedtls/library/sha512.c:347: note: in a call to function 'mbedtls_sha512_finish_ret'
  347 | int mbedtls_sha512_finish_ret(mbedtls_sha512_context *ctx,
      | 
```

*Edit:* This seems to have been handled upstream by silencing the GCC warning already.
```c
    /* mbedtls_sha512_finish_ret's output parameter is declared as a
     * 64-byte buffer, but since we're using SHA-384, we know that the
     * output fits in 48 bytes. This is correct C, but GCC 11.1 warns
     * about it.
     */
#if defined(__GNUC__) && __GNUC__ >= 11
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
    mbedtls_sha512_finish_ret(&sha512, padbuf);
#if defined(__GNUC__) && __GNUC__ >= 11
#pragma GCC diagnostic pop
#endif
```
But this doesn't work during LTO linking due to a GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80922

- [ ] **noise**
  * See #88526 for details.

```
./thirdparty/noise/FastNoiseLite.h: In function 'SingleCellular.isra':
./thirdparty/noise/FastNoiseLite.h:1732: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
 1732 |                         zPrimed += PrimeZ;
      | 
./thirdparty/noise/FastNoiseLite.h:1715: note: within this loop
 1715 |                     for (int zi = zr - 1; zi <= zr + 1; zi++)
      | 
./thirdparty/noise/FastNoiseLite.h:1699: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
 1699 |                         zPrimed += PrimeZ;
      | 
./thirdparty/noise/FastNoiseLite.h:1682: note: within this loop
 1682 |                     for (int zi = zr - 1; zi <= zr + 1; zi++)
      | 
./thirdparty/noise/FastNoiseLite.h:1666: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
 1666 |                         zPrimed += PrimeZ;
      | 
./thirdparty/noise/FastNoiseLite.h:1649: note: within this loop
 1649 |                     for (int zi = zr - 1; zi <= zr + 1; zi++)
      |
```

- [ ] **vhacd**

```
In member function 'PushBack',
    inlined from 'Process' at thirdparty/vhacd/src/vhacdICHull.cpp:265:46,
    inlined from 'SimplifyConvexHull' at thirdparty/vhacd/src/VHACD.cpp:1504:19,
    inlined from 'SimplifyConvexHull' at thirdparty/vhacd/src/VHACD.cpp:1421:0,
    inlined from '_ZN5VHACD5VHACD19SimplifyConvexHullsERKNS_6IVHACD10ParametersE.part.0' at thirdparty/vhacd/src/VHACD.cpp:1536:27:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function '_ZN5VHACD5VHACD19SimplifyConvexHullsERKNS_6IVHACD10ParametersE.part.0':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
thirdparty/vhacd/src/VHACD.cpp: In member function '_ZN5VHACD5VHACD24ComputeBestClippingPlaneEPKNS_12PrimitiveSetEdRKNS_6SArrayINS_5PlaneELm64EEERKNS_4Vec3IdEEdddiddRS5_RdRKNS_6IVHACD10ParametersE.part.0':
thirdparty/vhacd/src/VHACD.cpp:702:84: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  702 |     SArray<Vec3<double> >* chPts = new SArray<Vec3<double> >[2 * m_ompNumProcessors];
      |                                                                                    ^
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
thirdparty/vhacd/src/VHACD.cpp:703:48: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  703 |     Mesh* chs = new Mesh[2 * m_ompNumProcessors];
      |                                                ^
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'PushBack',
    inlined from 'ComputeAxesAlignedClippingPlanes' at thirdparty/vhacd/src/VHACD.cpp:499:24,
    inlined from 'ComputeACD' at thirdparty/vhacd/src/VHACD.cpp:1082:53:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function 'ComputeACD':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'PushBack',
    inlined from 'ComputeAxesAlignedClippingPlanes' at thirdparty/vhacd/src/VHACD.cpp:511:24,
    inlined from 'ComputeACD' at thirdparty/vhacd/src/VHACD.cpp:1082:53:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function 'ComputeACD':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'PushBack',
    inlined from 'ComputeAxesAlignedClippingPlanes' at thirdparty/vhacd/src/VHACD.cpp:523:24,
    inlined from 'ComputeACD' at thirdparty/vhacd/src/VHACD.cpp:1082:53:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function 'ComputeACD':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'PushBack',
    inlined from 'ComputeAxesAlignedClippingPlanes' at thirdparty/vhacd/src/VHACD.cpp:547:24,
    inlined from 'ComputeACD' at thirdparty/vhacd/src/VHACD.cpp:1086:53:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function 'ComputeACD':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'PushBack',
    inlined from 'ComputeAxesAlignedClippingPlanes' at thirdparty/vhacd/src/VHACD.cpp:557:24,
    inlined from 'ComputeACD' at thirdparty/vhacd/src/VHACD.cpp:1086:53:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function 'ComputeACD':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'PushBack',
    inlined from 'ComputeAxesAlignedClippingPlanes' at thirdparty/vhacd/src/VHACD.cpp:567:24,
    inlined from 'ComputeACD' at thirdparty/vhacd/src/VHACD.cpp:1086:53:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function 'ComputeACD':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'PushBack',
    inlined from 'ComputeACD' at thirdparty/vhacd/src/VHACD.cpp:1151:34:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function 'ComputeACD':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'PushBack',
    inlined from 'ComputeACD' at thirdparty/vhacd/src/VHACD.cpp:1152:34:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function 'ComputeACD':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'PushBack',
    inlined from 'ComputeACD' at thirdparty/vhacd/src/VHACD.cpp:1165:31:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function 'ComputeACD':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'operator=',
    inlined from 'ComputeACD' at thirdparty/vhacd/src/VHACD.cpp:1178:24:
thirdparty/vhacd/inc/vhacdSArray.h:124:22: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  124 |             m_data = new T[m_maxSize];
      |                      ^
/usr/include/c++/13/new: In member function 'ComputeACD':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'PushBack',
    inlined from 'ComputeACD' at thirdparty/vhacd/src/VHACD.cpp:1184:23:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function 'ComputeACD':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'PushBack',
    inlined from 'ComputeConvexHull' at thirdparty/vhacd/src/vhacdVolume.cpp:453:29:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function 'ComputeConvexHull':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function 'PushBack',
    inlined from 'ComputeConvexHull' at thirdparty/vhacd/src/vhacdVolume.cpp:1129:29:
thirdparty/vhacd/inc/vhacdSArray.h:82:23: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   82 |             T* temp = new T[maxSize];
      |                       ^
/usr/include/c++/13/new: In member function 'ComputeConvexHull':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
```

- [x] **`servers/audio/effects/audio_effect_pitch_shift.cpp`** ~#88509~ #88658

```
servers/audio/effects/audio_effect_pitch_shift.cpp: In member function 'PitchShift.constprop':
servers/audio/effects/audio_effect_pitch_shift.cpp:163:31: warning: 'memset' specified bound between 18446744065119617024 and 18446744073709551608 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
  163 |                         memset(gSynMagn, 0, fftFrameSize*sizeof(float));
      |                               ^
servers/audio/effects/audio_effect_pitch_shift.cpp:164:31: warning: 'memset' specified bound between 18446744065119617024 and 18446744073709551608 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
  164 |                         memset(gSynFreq, 0, fftFrameSize*sizeof(float));
      |                               ^
```

This is related to #50910 which we'll keep that old one focused on the `3.x` branch.

### Steps to reproduce

- `scons production=yes`

### Minimal reproduction project (MRP)

n/a