[oe] [meta-browser][PATCH] chromium: fix missing include of sys/stat.h

Max Krummenacher max.oss.09 at gmail.com
Wed Oct 28 08:43:33 UTC 2015


Explicitely include a needed header to fix compile time error.

sys/stat.h used to be indirectly included from another header but
no longer is.

Signed-off-by: Max Krummenacher <max.oss.09 at gmail.com>
---
 .../chromium-40/add_missing_stat_h_include.patch   | 39 ++++++++++++++++++++++
 recipes-browser/chromium/chromium_40.0.2214.91.bb  |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 recipes-browser/chromium/chromium/chromium-40/add_missing_stat_h_include.patch

diff --git a/recipes-browser/chromium/chromium/chromium-40/add_missing_stat_h_include.patch b/recipes-browser/chromium/chromium/chromium-40/add_missing_stat_h_include.patch
new file mode 100644
index 0000000..64fe840
--- /dev/null
+++ b/recipes-browser/chromium/chromium/chromium-40/add_missing_stat_h_include.patch
@@ -0,0 +1,39 @@
+sys/stat.h used to be indirectly included through
+device/udev_linux/scoped_udev.h -> libudev.h -> sys/stat.h
+but libudev.h in jethro no longer includes sys/stat.h resulting in the
+following compile time errors:
+
+arm-angstrom-linux-gnueabi-g++ ...  ../../components/storage_monitor/storage_monitor_linux.cc -o obj/components/storage_monitor/storage_monitor.storage_monitor_linux.o
+../../components/storage_monitor/storage_monitor_linux.cc: In function 'scoped_ptr<storage_monitor::StorageInfo> storage_monitor::{anonymous}::GetDeviceInfo(const base::FilePath&, const base::FilePath&)':
+../../components/storage_monitor/storage_monitor_linux.cc:132:15: error: aggregate 'storage_monitor::{anonymous}::GetDeviceInfo(const base::FilePath&, const base::FilePath&)::stat device_stat' has incomplete type and cannot be defined
+   struct stat device_stat;
+               ^
+../../components/storage_monitor/storage_monitor_linux.cc:133:53: error: invalid use of incomplete type 'struct storage_monitor::{anonymous}::GetDeviceInfo(const base::FilePath&, const base::FilePath&)::stat'
+   if (stat(device_path.value().c_str(), &device_stat) < 0)
+                                                     ^
+../../components/storage_monitor/storage_monitor_linux.cc:132:10: error: forward declaration of 'struct storage_monitor::{anonymous}::GetDeviceInfo(const base::FilePath&, const base::FilePath&)::stat'
+   struct stat device_stat;
+          ^
+../../components/storage_monitor/storage_monitor_linux.cc:137:34: error: 'S_ISCHR' was not declared in this scope
+   if (S_ISCHR(device_stat.st_mode))
+                                  ^
+../../components/storage_monitor/storage_monitor_linux.cc:139:39: error: 'S_ISBLK' was not declared in this scope
+   else if (S_ISBLK(device_stat.st_mode))
+                                       ^
+
+As the code makes use of stat systemcalls include the file explicitely.
+Tested with ARCH armv7.
+
+Signed-off-by: Max Krummenacher <max.oss.09 at gmail.com>
+Upstream-Status: Pending
+
+--- chromium-40.0.2214.91/components/storage_monitor/storage_monitor_linux.cc~	2015-01-21 21:28:16.000000000 +0100
++++ chromium-40.0.2214.91/components/storage_monitor/storage_monitor_linux.cc	2015-10-27 13:21:08.405655894 +0100
+@@ -8,6 +8,7 @@
+ 
+ #include <mntent.h>
+ #include <stdio.h>
++#include <sys/stat.h>
+ 
+ #include <list>
+ 
diff --git a/recipes-browser/chromium/chromium_40.0.2214.91.bb b/recipes-browser/chromium/chromium_40.0.2214.91.bb
index 44f8593..8bc05ee 100644
--- a/recipes-browser/chromium/chromium_40.0.2214.91.bb
+++ b/recipes-browser/chromium/chromium_40.0.2214.91.bb
@@ -27,6 +27,7 @@ SRC_URI = "\
         file://google-chrome \
         file://google-chrome.desktop \
         file://chromium-40/fix-build-error-with-GCC-in-Debug-mode.patch \
+        file://chromium-40/add_missing_stat_h_include.patch \
 "
 #
 # * use-egl : Without this packageconfig, the Chromium build will use GLX for creating an OpenGL context in X11,
-- 
1.9.3




More information about the Openembedded-devel mailing list