From c9a3d4efa4a81a5c52814f2f5bb66c9550477cd1 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Thu, 31 Oct 2019 22:16:02 +0800 Subject: [PATCH] sysroot: Fix fcntl compat in glibc 2.28 --- src/build/linux/sysroot_scripts/sysroot-creator.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/build/linux/sysroot_scripts/sysroot-creator.sh b/src/build/linux/sysroot_scripts/sysroot-creator.sh index 88645dad34..f2e1b73e1a 100644 --- a/src/build/linux/sysroot_scripts/sysroot-creator.sh +++ b/src/build/linux/sysroot_scripts/sysroot-creator.sh @@ -327,6 +327,14 @@ HacksAndPatchesCommon() { nm -D --defined-only --with-symbol-versions "${libc_so}" | \ "${SCRIPT_DIR}/find_incompatible_glibc_symbols.py" >> "${glob_h}" + # fcntl64() was introduced in glibc 2.28. Make sure to use fcntl() instead. + local fcntl_h="${INSTALL_ROOT}/usr/include/fcntl.h" + sed -i '{N; s/#ifndef \(__USE_FILE_OFFSET64\nextern int fcntl\)/#ifdef \1/}' \ + "${fcntl_h}" + # On i386, fcntl() was updated in glibc 2.28. + nm -D --defined-only --with-symbol-versions "${libc_so}" | \ + "${SCRIPT_DIR}/find_incompatible_glibc_symbols.py" >> "${fcntl_h}" + # This is for chrome's ./build/linux/pkg-config-wrapper # which overwrites PKG_CONFIG_LIBDIR internally SubBanner "Move pkgconfig scripts"