8000 LTO warnings on Fedora 36+ · Issue #11517 · tarantool/tarantool · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

LTO warnings on Fedora 36+ #11517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Buristan opened this issue May 20, 2025 · 0 comments
Open

LTO warnings on Fedora 36+ #11517

Buristan opened this issue May 20, 2025 · 0 comments

Comments

@Buristan
Copy link
Collaborator

After updating the CMake minimum required version to the 3.5 the CMP0065 policy is set to NEW by default.
Thus, without exporting symbols from the test executables, they are produced the following warnings:

[ 72%] Linking CXX executable luaT_tuple_new.test
In function ‘rmean_collect’,
    inlined from ‘txn_complete_success’ at src/box/txn.c:836:2,
    inlined from ‘txn_limbo_complete’ at src/box/txn_limbo.c:205:3:
src/lib/core/rmean.c:65:9: error: ‘__atomic_add_fetch_8’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   65 |         __atomic_add_fetch(&rmean->stats[name].value[0], value, __ATOMIC_RELAXED);
      |         ^
In function ‘txn_limbo_complete’:
lto1: note: destination object is likely at address zero

Originally observed on 2.11, see this CI run. But may be reproduced on the master branch (before #11509 is merged) with the following Dockerfile:

FROM fedora:39
RUN dnf upgrade --refresh -y
RUN dnf install -y git
RUN dnf install -y vim
RUN dnf install -y bash
RUN dnf install -y make
RUN dnf install -y cmake
RUN dnf install -y gcc
RUN dnf install -y g++
RUN dnf install -y libicu-devel
RUN dnf install -y openssl-devel
RUN dnf install -y readline-devel
RUN dnf install -y zlib-devel
RUN dnf install -y autoconf automake
RUN dnf install -y libtool

CMD ["bash"]

In the Docker: clone the Tarantool repo and build with the following command:

cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_LTO=ON -DENABLE_WERROR=ON -DENABLE_DIST=ON && make -j3

The issue is observed on the following systems with the following GCC versions:

  • Fedora 36; gcc: 12.2.1;
  • Fedora 37; gcc: 12.3.1;
  • Fedora 38; gcc: 13.2.1;
  • Fedora 39; gcc: 13.3.1;

It looks like the rmean_box is considered not initialized but used in the luaT_tuple_new.c test. It looks suspicious, since none of the functions that call rmean_collect are called either. This warning should be investigated as well as #3742.

Buristan added a commit to Buristan/tarantool that referenced this issue May 20, 2025
This patch is a follow-up to the commit
25af976 ("build: support cmake 4.0").
Since version 3.4, CMake doesn't add flags to export symbols from
executables without the ENABLE_EXPORTS target property, see CMP0065 [1]
for details.  Without this property, some unit C tests produce build
warnings with LTO optimization enabled (for example, on Fedora 39):

NO_WRAP
```
[ 72%] Linking CXX executable luaT_tuple_new.test
In function ‘rmean_collect’,
    inlined from ‘txn_complete_success’ at src/box/txn.c:836:2,
    inlined from ‘txn_limbo_complete’ at src/box/txn_limbo.c:205:3:
src/lib/core/rmean.c:65:9: error: ‘__atomic_add_fetch_8’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   65 |         __atomic_add_fetch(&rmean->stats[name].value[0], value, __ATOMIC_RELAXED);
      |         ^
In function ‘txn_limbo_complete’:
lto1: note: destination object is likely at address zero
```
NO_WRAP

The real reason should be investigated in the scope of tarantool#11517. The
compilation warning may be suppressed, but it may also mask the actual
problems in the future tests. The CMP0065 is removed from CMake version
4.0 [2]. Thus, this patch fixes the behaviour by setting the property
`ENABLE_EXPORTS` for unit tests directly.

[1]: https://cmake.org/cmake/help/latest/policy/CMP0065.html
[2]: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html#policies-introduced-by-cmake-3-4-removed-by-cmake-4-0

NO_DOC=build
NO_TEST=build
NO_CHANGELOG=build
Buristan added a commit that referenced this issue May 21, 2025
This patch is a follow-up to the commit
25af976 ("build: support cmake 4.0").
Since version 3.4, CMake doesn't add flags to export symbols from
executables without the ENABLE_EXPORTS target property, see CMP0065 [1]
for details.  Without this property, some unit C tests produce build
warnings with LTO optimization enabled (for example, on Fedora 39):

NO_WRAP
```
[ 72%] Linking CXX executable luaT_tuple_new.test
In function ‘rmean_collect’,
    inlined from ‘txn_complete_success’ at src/box/txn.c:836:2,
    inlined from ‘txn_limbo_complete’ at src/box/txn_limbo.c:205:3:
src/lib/core/rmean.c:65:9: error: ‘__atomic_add_fetch_8’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   65 |         __atomic_add_fetch(&rmean->stats[name].value[0], value, __ATOMIC_RELAXED);
      |         ^
In function ‘txn_limbo_complete’:
lto1: note: destination object is likely at address zero
```
NO_WRAP

The real reason should be investigated in the scope of #11517. The
compilation warning may be suppressed, but it may also mask the actual
problems in the future tests. The CMP0065 is removed from CMake version
4.0 [2]. Thus, this patch fixes the behaviour by setting the property
`ENABLE_EXPORTS` for unit tests directly.

[1]: https://cmake.org/cmake/help/latest/policy/CMP0065.html
[2]: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html#policies-introduced-by-cmake-3-4-removed-by-cmake-4-0

NO_DOC=build
NO_TEST=build
NO_CHANGELOG=build
github-actions bot pushed a commit that referenced this issue May 21, 2025
This patch is a follow-up to the commit
25af976 ("build: support cmake 4.0").
Since version 3.4, CMake doesn't add flags to export symbols from
executables without the ENABLE_EXPORTS target property, see CMP0065 [1]
for details.  Without this property, some unit C tests produce build
warnings with LTO optimization enabled (for example, on Fedora 39):

NO_WRAP
```
[ 72%] Linking CXX executable luaT_tuple_new.test
In function ‘rmean_collect’,
    inlined from ‘txn_complete_success’ at src/box/txn.c:836:2,
    inlined from ‘txn_limbo_complete’ at src/box/txn_limbo.c:205:3:
src/lib/core/rmean.c:65:9: error: ‘__atomic_add_fetch_8’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   65 |         __atomic_add_fetch(&rmean->stats[name].value[0], value, __ATOMIC_RELAXED);
      |         ^
In function ‘txn_limbo_complete’:
lto1: note: destination object is likely at address zero
```
NO_WRAP

The real reason should be investigated in the scope of #11517. The
compilation warning may be suppressed, but it may also mask the actual
problems in the future tests. The CMP0065 is removed from CMake version
4.0 [2]. Thus, this patch fixes the behaviour by setting the property
`ENABLE_EXPORTS` for unit tests directly.

[1]: https://cmake.org/cmake/help/latest/policy/CMP0065.html
[2]: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html#policies-introduced-by-cmake-3-4-removed-by-cmake-4-0

NO_DOC=build
NO_TEST=build
NO_CHANGELOG=build

(cherry picked from commit 2bde926)
github-actions bot pushed a commit that referenced this issue May 21, 2025
This patch is a follow-up to the commit
25af976 ("build: support cmake 4.0").
Since version 3.4, CMake doesn't add flags to export symbols from
executables without the ENABLE_EXPORTS target property, see CMP0065 [1]
for details.  Without this property, some unit C tests produce build
warnings with LTO optimization enabled (for example, on Fedora 39):

NO_WRAP
```
[ 72%] Linking CXX executable luaT_tuple_new.test
In function ‘rmean_collect’,
    inlined from ‘txn_complete_success’ at src/box/txn.c:836:2,
    inlined from ‘txn_limbo_complete’ at src/box/txn_limbo.c:205:3:
src/lib/core/rmean.c:65:9: error: ‘__atomic_add_fetch_8’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   65 |         __atomic_add_fetch(&rmean->stats[name].value[0], value, __ATOMIC_RELAXED);
      |         ^
In function ‘txn_limbo_complete’:
lto1: note: destination object is likely at address zero
```
NO_WRAP

The real reason should be investigated in the scope of #11517. The
compilation warning may be suppressed, but it may also mask the actual
problems in the future tests. The CMP0065 is removed from CMake version
4.0 [2]. Thus, this patch fixes the behaviour by setting the property
`ENABLE_EXPORTS` for unit tests directly.

[1]: https://cmake.org/cmake/help/latest/policy/CMP0065.html
[2]: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html#policies-introduced-by-cmake-3-4-removed-by-cmake-4-0

NO_DOC=build
NO_TEST=build
NO_CHANGELOG=build

(cherry picked from commit 2bde926)
Buristan added a commit to Buristan/tarantool that referenced this issue May 21, 2025
This patch is a follow-up to the commit
25af976 ("build: support cmake 4.0").
Since version 3.4, CMake doesn't add flags to export symbols from
executables without the ENABLE_EXPORTS target property, see CMP0065 [1]
for details.  Without this property, some unit C tests produce build
warnings with LTO optimization enabled (for example, on Fedora 39):

NO_WRAP
```
[ 72%] Linking CXX executable luaT_tuple_new.test
In function ‘rmean_collect’,
    inlined from ‘txn_complete_success’ at src/box/txn.c:836:2,
    inlined from ‘txn_limbo_complete’ at src/box/txn_limbo.c:205:3:
src/lib/core/rmean.c:65:9: error: ‘__atomic_add_fetch_8’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   65 |         __atomic_add_fetch(&rmean->stats[name].value[0], value, __ATOMIC_RELAXED);
      |         ^
In function ‘txn_limbo_complete’:
lto1: note: destination object is likely at address zero
```
NO_WRAP

The real reason should be investigated in the scope of tarantool#11517. The
compilation warning may be suppressed, but it may also mask the actual
problems in the future tests. The CMP0065 is removed from CMake version
4.0 [2]. Thus, this patch fixes the behaviour by setting the property
`ENABLE_EXPORTS` for unit tests directly.

[1]: https://cmake.org/cmake/help/latest/policy/CMP0065.html
[2]: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html#policies-introduced-by-cmake-3-4-removed-by-cmake-4-0

NO_DOC=build
NO_TEST=build
NO_CHANGELOG=build

(cherry picked from commit 2bde926)
Buristan added a commit to Buristan/tarantool that referenced this issue May 21, 2025
This patch is a follow-up to the commit
25af976 ("build: support cmake 4.0").
Since version 3.4, CMake doesn't add flags to export symbols from
executables without the ENABLE_EXPORTS target property, see CMP0065 [1]
for details.  Without this property, some unit C tests produce build
warnings with LTO optimization enabled (for example, on Fedora 39):

NO_WRAP
```
[ 72%] Linking CXX executable luaT_tuple_new.test
In function ‘rmean_collect’,
    inlined from ‘txn_complete_success’ at src/box/txn.c:836:2,
    inlined from ‘txn_limbo_complete’ at src/box/txn_limbo.c:205:3:
src/lib/core/rmean.c:65:9: error: ‘__atomic_add_fetch_8’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   65 |         __atomic_add_fetch(&rmean->stats[name].value[0], value, __ATOMIC_RELAXED);
      |         ^
In function ‘txn_limbo_complete’:
lto1: note: destination object is likely at address zero
```
NO_WRAP

The real reason should be investigated in the scope of tarantool#11517. The
compilation warning may be suppressed, but it may also mask the actual
problems in the future tests. The CMP0065 is removed from CMake version
4.0 [2]. Thus, this patch fixes the behaviour by setting the property
`ENABLE_EXPORTS` for unit tests directly.

[1]: https://cmake.org/cmake/help/latest/policy/CMP0065.html
[2]: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html#policies-introduced-by-cmake-3-4-removed-by-cmake-4-0

NO_DOC=build
NO_TEST=build
NO_CHANGELOG=build

(cherry picked from commit 2bde926)
Buristan added a commit that referenced this issue May 26, 2025
This patch is a follow-up to the commit
25af976 ("build: support cmake 4.0").
Since version 3.4, CMake doesn't add flags to export symbols from
executables without the ENABLE_EXPORTS target property, see CMP0065 [1]
for details.  Without this property, some unit C tests produce build
warnings with LTO optimization enabled (for example, on Fedora 39):

NO_WRAP
```
[ 72%] Linking CXX executable luaT_tuple_new.test
In function ‘rmean_collect’,
    inlined from ‘txn_complete_success’ at src/box/txn.c:836:2,
    inlined from ‘txn_limbo_complete’ at src/box/txn_limbo.c:205:3:
src/lib/core/rmean.c:65:9: error: ‘__atomic_add_fetch_8’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   65 |         __atomic_add_fetch(&rmean->stats[name].value[0], value, __ATOMIC_RELAXED);
      |         ^
In function ‘txn_limbo_complete’:
lto1: note: destination object is likely at address zero
```
NO_WRAP

The real reason should be investigated in the scope of #11517. The
compilation warning may be suppressed, but it may also mask the actual
problems in the future tests. The CMP0065 is removed from CMake version
4.0 [2]. Thus, this patch fixes the behaviour by setting the property
`ENABLE_EXPORTS` for unit tests directly.

[1]: https://cmake.org/cmake/help/latest/policy/CMP0065.html
[2]: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html#policies-introduced-by-cmake-3-4-removed-by-cmake-4-0

NO_DOC=build
NO_TEST=build
NO_CHANGELOG=build

(cherry picked from commit 2bde926)
Buristan added a commit that referenced this issue May 26, 2025
This patch is a follow-up to the commit
25af976 ("build: support cmake 4.0").
Since version 3.4, CMake doesn't add flags to export symbols from
executables without the ENABLE_EXPORTS target property, see CMP0065 [1]
for details.  Without this property, some unit C tests produce build
warnings with LTO optimization enabled (for example, on Fedora 39):

NO_WRAP
```
[ 72%] Linking CXX executable luaT_tuple_new.test
In function ‘rmean_collect’,
    inlined from ‘txn_complete_success’ at src/box/txn.c:836:2,
    inlined from ‘txn_limbo_complete’ at src/box/txn_limbo.c:205:3:
src/lib/core/rmean.c:65:9: error: ‘__atomic_add_fetch_8’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   65 |         __atomic_add_fetch(&rmean->stats[name].value[0], value, __ATOMIC_RELAXED);
      |         ^
In function ‘txn_limbo_complete’:
lto1: note: destination object is likely at address zero
```
NO_WRAP

The real reason should be investigated in the scope of #11517. The
compilation warning may be suppressed, but it may also mask the actual
problems in the future tests. The CMP0065 is removed from CMake version
4.0 [2]. Thus, this patch fixes the behaviour by setting the property
`ENABLE_EXPORTS` for unit tests directly.

[1]: https://cmake.org/cmake/help/latest/policy/CMP0065.html
[2]: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html#policies-introduced-by-cmake-3-4-removed-by-cmake-4-0

NO_DOC=build
NO_TEST=build
NO_CHANGELOG=build

(cherry picked from commit 2bde926)
Buri 8000 stan added a commit that referenced this issue May 26, 2025
This patch is a follow-up to the commit
25af976 ("build: support cmake 4.0").
Since version 3.4, CMake doesn't add flags to export symbols from
executables without the ENABLE_EXPORTS target property, see CMP0065 [1]
for details.  Without this property, some unit C tests produce build
warnings with LTO optimization enabled (for example, on Fedora 39):

NO_WRAP
```
[ 72%] Linking CXX executable luaT_tuple_new.test
In function ‘rmean_collect’,
    inlined from ‘txn_complete_success’ at src/box/txn.c:836:2,
    inlined from ‘txn_limbo_complete’ at src/box/txn_limbo.c:205:3:
src/lib/core/rmean.c:65:9: error: ‘__atomic_add_fetch_8’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   65 |         __atomic_add_fetch(&rmean->stats[name].value[0], value, __ATOMIC_RELAXED);
      |         ^
In function ‘txn_limbo_complete’:
lto1: note: destination object is likely at address zero
```
NO_WRAP

The real reason should be investigated in the scope of #11517. The
compilation warning may be suppressed, but it may also mask the actual
problems in the future tests. The CMP0065 is removed from CMake version
4.0 [2]. Thus, this patch fixes the behaviour by setting the property
`ENABLE_EXPORTS` for unit tests directly.

[1]: https://cmake.org/cmake/help/latest/policy/CMP0065.html
[2]: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html#policies-introduced-by-cmake-3-4-removed-by-cmake-4-0

NO_DOC=build
NO_TEST=build
NO_CHANGELOG=build

(cherry picked from commit 2bde926)
Buristan added a commit that referenced this issue May 26, 2025
This patch is a follow-up to the commit
25af976 ("build: support cmake 4.0").
Since version 3.4, CMake doesn't add flags to export symbols from
executables without the ENABLE_EXPORTS target property, see CMP0065 [1]
for details.  Without this property, some unit C tests produce build
warnings with LTO optimization enabled (for example, on Fedora 39):

NO_WRAP
```
[ 72%] Linking CXX executable luaT_tuple_new.test
In function ‘rmean_collect’,
    inlined from ‘txn_complete_success’ at src/box/txn.c:836:2,
    inlined from ‘txn_limbo_complete’ at src/box/txn_limbo.c:205:3:
src/lib/core/rmean.c:65:9: error: ‘__atomic_add_fetch_8’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
   65 |         __atomic_add_fetch(&rmean->stats[name].value[0], value, __ATOMIC_RELAXED);
      |         ^
In function ‘txn_limbo_complete’:
lto1: note: destination object is likely at address zero
```
NO_WRAP

The real reason should be investigated in the scope of #11517. The
compilation warning may be suppressed, but it may also mask the actual
problems in the future tests. The CMP0065 is removed from CMake version
4.0 [2]. Thus, this patch fixes the behaviour by setting the property
`ENABLE_EXPORTS` for unit tests directly.

[1]: https://cmake.org/cmake/help/latest/policy/CMP0065.html
[2]: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html#policies-introduced-by-cmake-3-4-removed-by-cmake-4-0

NO_DOC=build
NO_TEST=build
NO_CHANGELOG=build

(cherry picked from commit 2bde926)
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

No branches or pull requests

1 participant
0