build: Revert "Drop support for Ubuntu 18.04 Bionic"

https://chromium-review.googlesource.com/c/chromium/src/+/5598748
This commit is contained in:
klzgrad 2024-08-01 22:27:05 +08:00
parent 6476db90b3
commit 76e7bbed0f
2 changed files with 11 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import subprocess
# This constant comes from the oldest glibc version in
# //chrome/installer/linux/debian/dist_package_versions.json and
# //chrome/installer/linux/rpm/dist_package_provides.json
MAX_ALLOWED_GLIBC_VERSION = [2, 28]
MAX_ALLOWED_GLIBC_VERSION = [2, 26]
VERSION_PATTERN = re.compile("GLIBC_([0-9\.]+)")
SECTION_PATTERN = re.compile(r"^ *\[ *[0-9]+\] +(\S+) +\S+ + ([0-9a-f]+) .*$")

View File

@ -303,9 +303,17 @@ def hacks_and_patches(install_root: str, script_dir: str, arch: str) -> None:
os.remove(qtchooser_conf)
# __GLIBC_MINOR__ is used as a feature test macro. Replace it with the
# earliest supported version of glibc (2.28).
# earliest supported version of glibc (2.26).
features_h = os.path.join(install_root, "usr", "include", "features.h")
replace_in_file(features_h, r"(#define\s+__GLIBC_MINOR__)", r"\1 28 //")
replace_in_file(features_h, r"(#define\s+__GLIBC_MINOR__)", r"\1 26 //")
# fcntl64() was introduced in glibc 2.28. Make sure to use fcntl() instead.
fcntl_h = os.path.join(install_root, "usr", "include", "fcntl.h")
replace_in_file(
fcntl_h,
r"#ifndef __USE_FILE_OFFSET64(\nextern int fcntl)",
r"#if 1\1",
)
# Do not use pthread_cond_clockwait as it was introduced in glibc 2.30.
cppconfig_h = os.path.join(