Ubuntu 24 support for the UE4 build pipeline - #9689
Merged
Merged
Conversation
Ubuntu 24 (glibc 2.38+) breaks the UE4/clang-10 toolchain in three ways: 1. Bundled ld (2019) cannot read .relr.dyn ELF sections present in glibc ≥ 2.36. Ubuntu24Compat.sh detects this at runtime and wraps CC/CXX to inject -fuse-ld=lld; older systems are unaffected. 2. Server-side deps (xerces, proj, osm2odr) compiled against system glibc 2.38+ headers reference __isoc23_* C23 aliases that do not exist in UE4's centos7 sysroot. Adding --sysroot to CMAKE_CXX_FLAGS forces the C standard headers to come from the centos7 SDK, which predates glibc 2.38. -idirafter /usr/include keeps fallback access to headers absent from the sysroot (e.g. zlib.h). 3. Boost b2 bootstrap invokes the linker directly without going through the CC/CXX wrapper, so --with-toolset=gcc is used to bootstrap b2 itself on Ubuntu 24+; Boost libraries are still built with clang. Ubuntu 20/22 keep --with-toolset=clang (original behavior). Additionally: - Ubuntu 24+ ships Python as externally-managed (PEP 668); the wheel is now built but not pip-installed, with clear instructions logged. - CMake ≥ 4.0 rejects cmake_minimum_required < 3.5; Ubuntu24Compat.sh wraps cmake to inject -DCMAKE_POLICY_VERSION_MINIMUM=3.5. All changes in Ubuntu24Compat.sh are runtime-detected; the script is a no-op on Ubuntu 20 and 22. Based on approach and reference implementation by @berndgassmann in #9478.
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update our CHANGELOG.md based on your changes. |
Blyron
reviewed
Apr 23, 2026
Contributor
There was a problem hiding this comment.
What is this script for? is necesary?
Contributor
Author
There was a problem hiding this comment.
yes, this script only executes if the Ubuntu version is 24 or newer, it sets the linker, because the bundled linker cannot read .relr.dyn sections present in glibc ≥ 2.36 and also adds the compatibility mode for CMake
Blyron
requested changes
Apr 24, 2026
Blyron
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Summary
Ubuntu 24 (glibc 2.38+) breaks the UE4/clang-10 toolchain in several ways.
This PR introduces a detection-based compatibility shim (
Ubuntu24Compat.sh)that is a no-op on Ubuntu 20 and 22, and applies fixes only where needed.
Problems fixed
__isoc23_*undefined symbols at link timeServer-side deps (xerces, proj, osm2odr) compiled against system glibc 2.38+
headers reference C23 aliases (
__isoc23_sscanf,__isoc23_strtol, …) thatdon't exist in UE4's centos7 sysroot. Fixed by adding
--sysroottoCMAKE_CXX_FLAGSfor all server builds, with-idirafter /usr/includeas afallback for headers absent from the centos7 SDK (e.g.
zlib.h).Bundled
ldcannot read.relr.dynELF sections (glibc ≥ 2.36)UE4's 2019 bundled linker crashes on objects from modern distros. Fixed by
runtime-detecting the failure and wrapping
CC/CXXto inject-fuse-ld=lld.Boost b2 bootstrap fails with
--with-toolset=clangbootstrap.shinvokes the linker directly, bypassing theCC/CXXwrapper.Fixed by using
--with-toolset=gccon Ubuntu 24+; Boost libraries are stillbuilt with clang via b2
toolset=.PEP 668 blocks system-wide
pip install(Ubuntu 24+)The wheel is now built and placed in
dist/without being installed, with clearlog messages showing how to install it manually (pip, conda, pyenv, uv, …).
CMake ≥ 4.0 rejects
cmake_minimum_required < 3.5Fixed by wrapping
cmaketo inject-DCMAKE_POLICY_VERSION_MINIMUM=3.5.Other changes
BuildCarlaUE4.sh:USE_SIMREADYdefaults tofalse.gitignore: added.zed,compile_commands.json,Unreal/CarlaUE4/.ignoreCredits
Approach and reference implementation by @berndgassmann in #9478.
This change is