diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-12-18 22:39:50 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-20 15:22:16 +0000 |
commit | a6a49f763f164feea39c37d53d5afc1244ca9aa6 (patch) | |
tree | 351dbe9c908c473d019aa833102472a21daa5499 /meta/recipes-bsp/grub | |
parent | 118bfb82ffe5d0a9dbb97df2c17fdaeb108540c5 (diff) | |
download | poky-a6a49f763f164feea39c37d53d5afc1244ca9aa6.tar.gz |
grub: Fix build with glibc 2.25
Backport relevant patch from grub git
(From OE-Core rev: 5e501f8e3ecf14f31da3cca5ab762af5ddc81964)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp/grub')
-rw-r--r-- | meta/recipes-bsp/grub/files/0001-build-Use-AC_HEADER_MAJOR-to-find-device-macros.patch | 92 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/grub2.inc | 1 |
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 @@ | |||
1 | From 7a5b301e3adb8e054288518a325135a1883c1c6c Mon Sep 17 00:00:00 2001 | ||
2 | From: Mike Gilbert <floppym@gentoo.org> | ||
3 | Date: Tue, 19 Apr 2016 14:27:22 -0400 | ||
4 | Subject: [PATCH] build: Use AC_HEADER_MAJOR to find device macros | ||
5 | |||
6 | Depending on the OS/libc, device macros are defined in different | ||
7 | headers. This change ensures we include the right one. | ||
8 | |||
9 | sys/types.h - BSD | ||
10 | sys/mkdev.h - Sun | ||
11 | sys/sysmacros.h - glibc (Linux) | ||
12 | |||
13 | glibc currently pulls sys/sysmacros.h into sys/types.h, but this may | ||
14 | change in a future release. | ||
15 | |||
16 | https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html | ||
17 | --- | ||
18 | Upstream-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 | |||
27 | Index: 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> | ||
41 | Index: 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> | ||
58 | Index: 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> | ||
76 | Index: 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 | ||
40 | DEPENDS = "flex-native bison-native autogen-native" | 41 | DEPENDS = "flex-native bison-native autogen-native" |