Skip to content

Fix compile on some linux distros#15225

Merged
tezc merged 3 commits into
redis:unstablefrom
tezc:fix-lto
May 18, 2026
Merged

Fix compile on some linux distros#15225
tezc merged 3 commits into
redis:unstablefrom
tezc:fix-lto

Conversation

@tezc

@tezc tezc commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes:

  1. After Reduce memory allocation overhead #15096, we pass -flto to jemalloc. On Azure Linux, the resulting jemalloc library cannot be handled at link time and the build fails. Adding -ffat-lto-objects so the compiler also emits regular object code that the linker can fall back to when it cannot handle the LTO-compiled library.
  2. Fixed a warning about path being NULL in moduleLoadInternalModules().
  3. Fixed compile warnings on older GCC versions introduced by Implement the new Redis Array type #15162
    (reported on Ubuntu 20.04)

Co-authored-by: debing.sun [email protected]


Note

Low Risk
Low risk: changes are limited to build flags and compiler-version guards, plus a minor log formatting fix when path can be NULL.

Overview
Improves build compatibility on some Linux toolchains by adding -ffat-lto-objects alongside GCC -flto=auto, letting linkers fall back to non-LTO objects when needed.

Adjusts GCC-version guards in deps/tre xmalloc.c to avoid warnings on older GCC (moves __attribute__((access)) to GCC 11+ and only suppresses -Wuse-after-free on GCC 12+). Also makes the module load failure log in moduleOnLoad handle a NULL path (internal modules) without warnings.

Reviewed by Cursor Bugbot for commit 394bb0c. Bugbot is set up for automated code reviews on this repo. Configure here.

tezc and others added 3 commits May 18, 2026 13:22
@tezc tezc merged commit 0d06e51 into redis:unstable May 18, 2026
18 checks passed
@tezc tezc deleted the fix-lto branch May 18, 2026 21:16
@tezc tezc added the release-notes indication that this issue needs to be mentioned in the release notes label May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes indication that this issue needs to be mentioned in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants