Skip to content

Ubuntu 24 support for the UE4 build pipeline - #9689

Merged
Blyron merged 4 commits into
ue4-devfrom
luis/ue4_dev_support_ubuntu24
Apr 24, 2026
Merged

Ubuntu 24 support for the UE4 build pipeline#9689
Blyron merged 4 commits into
ue4-devfrom
luis/ue4_dev_support_ubuntu24

Conversation

@LuisPovedaCano

@LuisPovedaCano LuisPovedaCano commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

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 time
Server-side deps (xerces, proj, osm2odr) compiled against system glibc 2.38+
headers reference C23 aliases (__isoc23_sscanf, __isoc23_strtol, …) that
don't exist in UE4's centos7 sysroot. Fixed by adding --sysroot to
CMAKE_CXX_FLAGS for all server builds, with -idirafter /usr/include as a
fallback for headers absent from the centos7 SDK (e.g. zlib.h).

Bundled ld cannot read .relr.dyn ELF sections (glibc ≥ 2.36)
UE4's 2019 bundled linker crashes on objects from modern distros. Fixed by
runtime-detecting the failure and wrapping CC/CXX to inject -fuse-ld=lld.

Boost b2 bootstrap fails with --with-toolset=clang
bootstrap.sh invokes the linker directly, bypassing the CC/CXX wrapper.
Fixed by using --with-toolset=gcc on Ubuntu 24+; Boost libraries are still
built 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 clear
log messages showing how to install it manually (pip, conda, pyenv, uv, …).

CMake ≥ 4.0 rejects cmake_minimum_required < 3.5
Fixed by wrapping cmake to inject -DCMAKE_POLICY_VERSION_MINIMUM=3.5.

Other changes

  • BuildCarlaUE4.sh: USE_SIMREADY defaults to false
  • .gitignore: added .zed, compile_commands.json, Unreal/CarlaUE4/.ignore

Credits

Approach and reference implementation by @berndgassmann in #9478.


This change is Reviewable

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.
@LuisPovedaCano
LuisPovedaCano requested a review from a team as a code owner April 23, 2026 11:26
@update-docs

update-docs Bot commented Apr 23, 2026

Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this script for? is necesary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread Util/BuildTools/BuildCarlaUE4.sh Outdated
@LuisPovedaCano
LuisPovedaCano requested a review from Blyron April 24, 2026 07:46
@Blyron
Blyron merged commit 487cc5b into ue4-dev Apr 24, 2026
0 of 2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants