From 5e501f8e3ecf14f31da3cca5ab762af5ddc81964 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 18 Dec 2016 22:39:50 -0800 Subject: grub: Fix build with glibc 2.25 Backport relevant patch from grub git Signed-off-by: Khem Raj --- ...Use-AC_HEADER_MAJOR-to-find-device-macros.patch | 92 ++++++++++++++++++++++ meta/recipes-bsp/grub/grub2.inc | 1 + 2 files changed, 93 insertions(+) create mode 100644 meta/recipes-bsp/grub/files/0001-build-Use-AC_HEADER_MAJOR-to-find-device-macros.patch 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 @@ +From 7a5b301e3adb8e054288518a325135a1883c1c6c Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Tue, 19 Apr 2016 14:27:22 -0400 +Subject: [PATCH] build: Use AC_HEADER_MAJOR to find device macros + +Depending on the OS/libc, device macros are defined in different +headers. This change ensures we include the right one. + +sys/types.h - BSD +sys/mkdev.h - Sun +sys/sysmacros.h - glibc (Linux) + +glibc currently pulls sys/sysmacros.h into sys/types.h, but this may +change in a future release. + +https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html +--- +Upstream-Status: Backport + + configure.ac | 3 ++- + grub-core/osdep/devmapper/getroot.c | 6 ++++++ + grub-core/osdep/devmapper/hostdisk.c | 5 +++++ + grub-core/osdep/linux/getroot.c | 6 ++++++ + grub-core/osdep/unix/getroot.c | 4 +++- + 5 files changed, 22 insertions(+), 2 deletions(-) + +Index: grub-2.00/configure.ac +=================================================================== +--- grub-2.00.orig/configure.ac ++++ grub-2.00/configure.ac +@@ -326,7 +326,8 @@ fi + + # Check for functions and headers. + AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getextmntent) +-AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h) ++AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h) ++AC_HEADER_MAJOR + + AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default + #include +Index: grub-2.00/grub-core/kern/emu/hostdisk.c +=================================================================== +--- grub-2.00.orig/grub-core/kern/emu/hostdisk.c ++++ grub-2.00/grub-core/kern/emu/hostdisk.c +@@ -41,6 +41,12 @@ + #include + #include + ++#if defined(MAJOR_IN_MKDEV) ++#include ++#elif defined(MAJOR_IN_SYSMACROS) ++#include ++#endif ++ + #ifdef __linux__ + # include /* ioctl */ + # include +Index: grub-2.00/util/getroot.c +=================================================================== +--- grub-2.00.orig/util/getroot.c ++++ grub-2.00/util/getroot.c +@@ -35,6 +35,13 @@ + #ifdef HAVE_LIMITS_H + #include + #endif ++ ++#if defined(MAJOR_IN_MKDEV) ++#include ++#elif defined(MAJOR_IN_SYSMACROS) ++#include ++#endif ++ + #include + #include + #include +Index: grub-2.00/util/raid.c +=================================================================== +--- grub-2.00.orig/util/raid.c ++++ grub-2.00/util/raid.c +@@ -29,6 +29,12 @@ + #include + #include + ++#if defined(MAJOR_IN_MKDEV) ++#include ++#elif defined(MAJOR_IN_SYSMACROS) ++#include ++#endif ++ + #include + #include + #include 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 \ file://0001-Enforce-no-pie-if-the-compiler-supports-it.patch \ file://0001-grub-core-kern-efi-mm.c-grub_efi_finish_boot_service.patch \ file://0002-grub-core-kern-efi-mm.c-grub_efi_get_memory_map-Neve.patch \ + file://0001-build-Use-AC_HEADER_MAJOR-to-find-device-macros.patch \ " DEPENDS = "flex-native bison-native autogen-native" -- cgit 1.2.3-korg