From 6b04565db2a345867e7ecf56e838321cc85a4e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Wed, 8 Jun 2022 19:55:22 +0000 Subject: [PATCH] Enable Large File Support extension (LFS) This PR adds flags to enable LFS to make 32-bit builds to correctly handle 64-bit inode from the ext4/xfs file systems. Specifically, many APIs internally uses `readdir()` for listing directory, which may crash with an `EOVERFLOW`, `Value too large for defined data type`. See https://bugs.gentoo.org/681790#c0 for some background about this issue. Closes https://github.com/dart-lang/sdk/pull/49179 GitOrigin-RevId: 34ff2282635ffd50cb8e5dffe57601bb0b2b18f7 Change-Id: Idd10d215f0791242fff986c18decc443609f471e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247245 Commit-Queue: Brian Quinlan Reviewed-by: Brian Quinlan --- build/config/linux/BUILD.gn | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn index cf3f77a50db..efaf502b04f 100644 --- a/build/config/linux/BUILD.gn +++ b/build/config/linux/BUILD.gn @@ -35,6 +35,13 @@ config("sdk") { ] } } + + # Enable Large File Support extension (LFS) + cflags += [ + "-D_FILE_OFFSET_BITS=64", + "-D_LARGEFILE_SOURCE", + "-D_LARGEFILE64_SOURCE", + ] } config("executable_config") {