new file mode 100644
@@ -0,0 +1,60 @@
+From 25786d356ac391124489f2e55690281c03fa83db Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 22 Dec 2022 00:30:55 -0800
+Subject: [PATCH] Replace lstat64/stat64 functions on linux
+
+we define -D_FILE_OFFSET_BITS=64 which means lstat is operating on 64bit
+off_t and is same as lstat64, same for stat and stat64 case.
+
+This fixes build with musl where off_t has always been 64bit
+
+Upstream-Status: Submitted [https://gn-review.googlesource.com/c/gn/+/14960]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/base/files/file.h | 2 +-
+ src/base/files/file_posix.cc | 2 +-
+ src/base/files/file_util_posix.cc | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/base/files/file.h b/src/base/files/file.h
+index 2c94eb4e..99e87ed9 100644
+--- a/src/base/files/file.h
++++ b/src/base/files/file.h
+@@ -23,7 +23,7 @@ namespace base {
+
+ #if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) || \
+ defined(OS_HAIKU) || defined(OS_MSYS) || defined(OS_ZOS) || \
+- defined(OS_ANDROID) && __ANDROID_API__ < 21
++ defined(OS_LINUX) || defined(OS_ANDROID) && __ANDROID_API__ < 21
+ typedef struct stat stat_wrapper_t;
+ #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
+ typedef struct stat64 stat_wrapper_t;
+diff --git a/src/base/files/file_posix.cc b/src/base/files/file_posix.cc
+index b1f9f5e8..049568f0 100644
+--- a/src/base/files/file_posix.cc
++++ b/src/base/files/file_posix.cc
+@@ -26,7 +26,7 @@ namespace {
+
+ #if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) || \
+ defined(OS_HAIKU) || defined(OS_MSYS) || defined(OS_ZOS) || \
+- defined(OS_ANDROID) && __ANDROID_API__ < 21
++ defined(OS_LINUX) || defined(OS_ANDROID) && __ANDROID_API__ < 21
+ int CallFstat(int fd, stat_wrapper_t* sb) {
+ return fstat(fd, sb);
+ }
+diff --git a/src/base/files/file_util_posix.cc b/src/base/files/file_util_posix.cc
+index aa54731d..53be3d3b 100644
+--- a/src/base/files/file_util_posix.cc
++++ b/src/base/files/file_util_posix.cc
+@@ -61,7 +61,7 @@ namespace {
+
+ #if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) || \
+ defined(OS_HAIKU) || defined(OS_MSYS) || defined(OS_ZOS) || \
+- defined(OS_ANDROID) && __ANDROID_API__ < 21
++ defined(OS_LINUX) || defined(OS_ANDROID) && __ANDROID_API__ < 21
+ int CallStat(const char* path, stat_wrapper_t* sb) {
+ return stat(path, sb);
+ }
+--
+2.39.0
+
@@ -4,7 +4,8 @@ DEPENDS += "ninja-native"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d"
-SRC_URI = "git://gn.googlesource.com/gn;protocol=https;branch=main"
+SRC_URI = "git://gn.googlesource.com/gn;protocol=https;branch=main \
+ file://0001-Replace-lstat64-stat64-functions-on-linux.patch"
SRCREV = "bf4e17dc67b2a2007475415e3f9e1d1cf32f6e35"
PV = "0+git${SRCPV}"
Signed-off-by: Khem Raj <raj.khem@gmail.com> --- ...ce-lstat64-stat64-functions-on-linux.patch | 60 +++++++++++++++++++ meta-arm/recipes-devtools/gn/gn_git.bb | 3 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 meta-arm/recipes-devtools/gn/gn/0001-Replace-lstat64-stat64-functions-on-linux.patch