summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-12-18 22:39:50 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-09 14:34:35 +0000
commit666076dfc0528442a1098354dcc5d64672dd38ee (patch)
tree3b421daa80dd269afd0f7507c4af679dc5e8a45d /meta
parent14912b7859dbe217d42bdd9637794a74cb448ede (diff)
downloadpoky-666076dfc0528442a1098354dcc5d64672dd38ee.tar.gz
grub: Fix build with glibc 2.25
Backport relevant patch from grub git (From OE-Core rev: 5e501f8e3ecf14f31da3cca5ab762af5ddc81964) (From OE-Core rev: c22d80c26ddab86ef8c87f028d505a237502d4e2) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-bsp/grub/files/0001-build-Use-AC_HEADER_MAJOR-to-find-device-macros.patch92
-rw-r--r--meta/recipes-bsp/grub/grub2.inc1
2 files changed, 93 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/0001-build-Use-AC_HEADER_MAJOR-to-find-device-macros.patch b/meta/recipes-bsp/grub/files/0001-build-Use-AC_HEADER_MAJOR-to-find-device-macros.patch
new file mode 100644
index 0000000000..f95b9ef9a0
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/0001-build-Use-AC_HEADER_MAJOR-to-find-device-macros.patch
@@ -0,0 +1,92 @@
1From 7a5b301e3adb8e054288518a325135a1883c1c6c Mon Sep 17 00:00:00 2001
2From: Mike Gilbert <floppym@gentoo.org>
3Date: Tue, 19 Apr 2016 14:27:22 -0400
4Subject: [PATCH] build: Use AC_HEADER_MAJOR to find device macros
5
6Depending on the OS/libc, device macros are defined in different
7headers. This change ensures we include the right one.
8
9sys/types.h - BSD
10sys/mkdev.h - Sun
11sys/sysmacros.h - glibc (Linux)
12
13glibc currently pulls sys/sysmacros.h into sys/types.h, but this may
14change in a future release.
15
16https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html
17---
18Upstream-Status: Backport
19
20 configure.ac | 3 ++-
21 grub-core/osdep/devmapper/getroot.c | 6 ++++++
22 grub-core/osdep/devmapper/hostdisk.c | 5 +++++
23 grub-core/osdep/linux/getroot.c | 6 ++++++
24 grub-core/osdep/unix/getroot.c | 4 +++-
25 5 files changed, 22 insertions(+), 2 deletions(-)
26
27Index: grub-2.00/configure.ac
28===================================================================
29--- grub-2.00.orig/configure.ac
30+++ grub-2.00/configure.ac
31@@ -326,7 +326,8 @@ fi
32
33 # Check for functions and headers.
34 AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getextmntent)
35-AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h)
36+AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h)
37+AC_HEADER_MAJOR
38
39 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
40 #include <sys/param.h>
41Index: grub-2.00/grub-core/kern/emu/hostdisk.c
42===================================================================
43--- grub-2.00.orig/grub-core/kern/emu/hostdisk.c
44+++ grub-2.00/grub-core/kern/emu/hostdisk.c
45@@ -41,6 +41,12 @@
46 #include <errno.h>
47 #include <limits.h>
48
49+#if defined(MAJOR_IN_MKDEV)
50+#include <sys/mkdev.h>
51+#elif defined(MAJOR_IN_SYSMACROS)
52+#include <sys/sysmacros.h>
53+#endif
54+
55 #ifdef __linux__
56 # include <sys/ioctl.h> /* ioctl */
57 # include <sys/mount.h>
58Index: grub-2.00/util/getroot.c
59===================================================================
60--- grub-2.00.orig/util/getroot.c
61+++ grub-2.00/util/getroot.c
62@@ -35,6 +35,13 @@
63 #ifdef HAVE_LIMITS_H
64 #include <limits.h>
65 #endif
66+
67+#if defined(MAJOR_IN_MKDEV)
68+#include <sys/mkdev.h>
69+#elif defined(MAJOR_IN_SYSMACROS)
70+#include <sys/sysmacros.h>
71+#endif
72+
73 #include <grub/util/misc.h>
74 #include <grub/util/lvm.h>
75 #include <grub/cryptodisk.h>
76Index: grub-2.00/util/raid.c
77===================================================================
78--- grub-2.00.orig/util/raid.c
79+++ grub-2.00/util/raid.c
80@@ -29,6 +29,12 @@
81 #include <errno.h>
82 #include <sys/types.h>
83
84+#if defined(MAJOR_IN_MKDEV)
85+#include <sys/mkdev.h>
86+#elif defined(MAJOR_IN_SYSMACROS)
87+#include <sys/sysmacros.h>
88+#endif
89+
90 #include <linux/types.h>
91 #include <linux/major.h>
92 #include <linux/raid/md_p.h>
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index b69de9f340..ef893b327f 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -35,6 +35,7 @@ SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
35 file://0001-Enforce-no-pie-if-the-compiler-supports-it.patch \ 35 file://0001-Enforce-no-pie-if-the-compiler-supports-it.patch \
36 file://0001-grub-core-kern-efi-mm.c-grub_efi_finish_boot_service.patch \ 36 file://0001-grub-core-kern-efi-mm.c-grub_efi_finish_boot_service.patch \
37 file://0002-grub-core-kern-efi-mm.c-grub_efi_get_memory_map-Neve.patch \ 37 file://0002-grub-core-kern-efi-mm.c-grub_efi_get_memory_map-Neve.patch \
38 file://0001-build-Use-AC_HEADER_MAJOR-to-find-device-macros.patch \
38 " 39 "
39 40
40DEPENDS = "flex-native bison-native autogen-native" 41DEPENDS = "flex-native bison-native autogen-native"