Update debuginfo too

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2016-03-04 19:47:13 -05:00
parent 133f7eab29
commit e229c7b688
8 changed files with 139 additions and 134 deletions

View File

@ -1,7 +1,7 @@
From b29ab8b194e3543aa481568e4af0e9ffbad01636 Mon Sep 17 00:00:00 2001
From 1b2af2de1b5d9d5780cf6803124c18f460466c3c Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 21 Jul 2015 20:30:00 -0400
Subject: [PATCH 1/6] Put the correct .file directives in our .S files.
Subject: [PATCH 10001/10006] Put the correct .file directives in our .S files.
The wrong path makes generating debuginfo not work correctly.
@ -41,10 +41,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
31 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S
index ea167fe..96ced2f 100644
index c1df86d..8eb8fc8 100644
--- a/grub-core/boot/i386/pc/boot.S
+++ b/grub-core/boot/i386/pc/boot.S
@@ -108,7 +108,7 @@ cylinder_start:
@@ -112,7 +112,7 @@ cylinder_start:
/* more space... */
.endm
@ -67,10 +67,10 @@ index de4f809..d30b4be 100644
#define CODE_ADDR 0x6000
#define DATA_ADDR ((GRUB_BOOT_MACHINE_KERNEL_ADDR) + 0x200)
diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S
index c8b87ed..14c6d83 100644
index 05dd7fa..9c0b32a 100644
--- a/grub-core/boot/i386/pc/diskboot.S
+++ b/grub-core/boot/i386/pc/diskboot.S
@@ -25,7 +25,7 @@
@@ -27,7 +27,7 @@
#define MSG(x) movw $x, %si; call LOCAL(message)
@ -360,7 +360,7 @@ index a5373d3..6f58685 100644
GRUB_MOD_LICENSE "GPLv3+"
diff --git a/grub-core/lib/arm64/setjmp.S b/grub-core/lib/arm64/setjmp.S
index eabfd99..006660b 100644
index ffcabf6..7755d06 100644
--- a/grub-core/lib/arm64/setjmp.S
+++ b/grub-core/lib/arm64/setjmp.S
@@ -19,7 +19,7 @@
@ -399,12 +399,12 @@ index a0382d8..dba2cbf 100644
GRUB_MOD_LICENSE "GPLv2+"
diff --git a/grub-core/lib/mips/setjmp.S b/grub-core/lib/mips/setjmp.S
index f012945..365824c 100644
index 895235b..fa9c16e 100644
--- a/grub-core/lib/mips/setjmp.S
+++ b/grub-core/lib/mips/setjmp.S
@@ -19,7 +19,7 @@
#include <grub/symbol.h>
@@ -20,7 +20,7 @@
#include <grub/dl.h>
#include <grub/mips/asm.h>
- .file "setjmp.S"
+ .file "grub-core/lib/mips/setjmp.S"
@ -451,5 +451,5 @@ index 6b151bc..c975897 100644
GRUB_MOD_LICENSE "GPLv3+"
--
2.4.3
2.5.0

View File

@ -1,79 +0,0 @@
From 5804ce3d46ef5792ea4aa53e1460c341137961e9 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 25 Jun 2015 11:59:09 -0400
Subject: [PATCH 2/6] Make efi machines load an env block from a variable
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/Makefile.core.def | 1 +
grub-core/kern/efi/init.c | 32 ++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 38291ce..b3ba5ed 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -174,6 +174,7 @@ kernel = {
efi = kern/efi/init.c;
efi = kern/efi/mm.c;
efi = term/efi/console.c;
+ efi = lib/envblk.c;
x86 = kern/i386/tsc.c;
diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c
index e9c85de..d17d18e 100644
--- a/grub-core/kern/efi/init.c
+++ b/grub-core/kern/efi/init.c
@@ -25,9 +25,40 @@
#include <grub/env.h>
#include <grub/mm.h>
#include <grub/kernel.h>
+#include <grub/lib/envblk.h>
grub_addr_t grub_modbase;
+#define GRUB_EFI_GRUB_VARIABLE_GUID \
+ { 0x91376aff, 0xcba6, 0x42be, \
+ { 0x94, 0x9d, 0x06, 0xfd, 0xe8, 0x11, 0x28, 0xe8 } \
+ }
+
+/* Helper for grub_efi_env_init */
+static int
+set_var (const char *name, const char *value,
+ void *whitelist __attribute__((__unused__)))
+{
+ grub_env_set (name, value);
+ return 0;
+}
+
+static void
+grub_efi_env_init (void)
+{
+ grub_efi_guid_t efi_grub_guid = GRUB_EFI_GRUB_VARIABLE_GUID;
+ struct grub_envblk envblk_s = { NULL, 0 };
+ grub_envblk_t envblk = &envblk_s;
+
+ envblk_s.buf = grub_efi_get_variable ("GRUB_ENV", &efi_grub_guid,
+ &envblk_s.size);
+ if (!envblk_s.buf || envblk_s.size < 1)
+ return;
+
+ grub_envblk_iterate (envblk, NULL, set_var);
+ grub_free (envblk_s.buf);
+}
+
void
grub_efi_init (void)
{
@@ -42,6 +73,7 @@ grub_efi_init (void)
efi_call_4 (grub_efi_system_table->boot_services->set_watchdog_timer,
0, 0, 0, NULL);
+ grub_efi_env_init ();
grub_efidisk_init ();
}
--
2.4.3

View File

@ -1,7 +1,7 @@
From bdcd66a767a861370e55a3c2d624383a1f2ec2f5 Mon Sep 17 00:00:00 2001
From 5334ed8ae9c8f15928139be986a1e877e9837630 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 25 Jun 2015 15:41:06 -0400
Subject: [PATCH 3/6] Make it possible to enabled --build-id=sha1
Subject: [PATCH 10002/10006] Make it possible to enabled --build-id=sha1
Signed-off-by: Peter Jones <pjones@redhat.com>
---
@ -10,7 +10,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
2 files changed, 27 insertions(+)
diff --git a/acinclude.m4 b/acinclude.m4
index 609c4f2..8dd0989 100644
index 526f97a..48ccecc 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -136,6 +136,25 @@ if test "x$grub_cv_prog_ld_build_id_none" = xyes; then
@ -40,10 +40,10 @@ index 609c4f2..8dd0989 100644
AC_DEFUN([grub_PROG_NM_WORKS],
[AC_MSG_CHECKING([whether nm works])
diff --git a/configure.ac b/configure.ac
index 991cb15..8d780e3 100644
index d6ef6c3..3e897bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1202,7 +1202,15 @@ grub_PROG_TARGET_CC
@@ -1323,7 +1323,15 @@ grub_PROG_TARGET_CC
if test "x$TARGET_APPLE_LINKER" != x1 ; then
grub_PROG_OBJCOPY_ABSOLUTE
fi
@ -60,5 +60,5 @@ index 991cb15..8d780e3 100644
if test "$platform" != emu && test "x$TARGET_APPLE_LINKER" != x1 ; then
if test ! -z "$TARGET_IMG_LDSCRIPT"; then
--
2.4.3
2.5.0

View File

@ -1,14 +1,15 @@
From 22ba237a041b493cd0b7bb3e1c3fcd0a34dbdc2d Mon Sep 17 00:00:00 2001
From ddc6702d0b258e12f67f0df7c3c915a04ede1067 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Sun, 28 Jun 2015 17:57:24 -0400
Subject: [PATCH 4/6] Don't tell the compiler to do annoying things with -f.
Subject: [PATCH 10003/10006] Don't tell the compiler to do annoying things
with -f.
---
configure.ac | 34 ++--------------------------------
1 file changed, 2 insertions(+), 32 deletions(-)
configure.ac | 48 ++----------------------------------------------
1 file changed, 2 insertions(+), 46 deletions(-)
diff --git a/configure.ac b/configure.ac
index 8d780e3..5e2529a 100644
index 3e897bd..65f7f43 100644
--- a/configure.ac
+++ b/configure.ac
@@ -548,8 +548,8 @@ LDFLAGS="$TARGET_LDFLAGS"
@ -22,7 +23,7 @@ index 8d780e3..5e2529a 100644
if test "x$target_cpu" != xi386 && test "x$target_cpu" != xx86_64; then
TARGET_CFLAGS="$TARGET_CFLAGS -Wcast-align"
@@ -809,21 +809,6 @@ if test x"$target_cpu" = xsparc64 ; then
@@ -908,21 +908,6 @@ if test x"$target_cpu" = xsparc64 ; then
TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_mno_relax"
fi
@ -44,16 +45,17 @@ index 8d780e3..5e2529a 100644
if test x"$target_os" = xcygwin; then
AC_CACHE_CHECK([whether option -fno-reorder-functions works], grub_cv_cc_no_reorder_functions, [
CFLAGS="$TARGET_CFLAGS -fno-reorder-functions"
@@ -837,21 +822,6 @@ if test x"$target_os" = xcygwin && test "x$grub_cv_cc_no_reorder_functions" = xy
TARGET_CFLAGS="$TARGET_CFLAGS -fno-reorder-functions"
@@ -947,37 +932,8 @@ if test "x$grub_cv_cc_mno_stack_arg_probe" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
fi
-
-# By default, GCC 4.6 generates .eh_frame sections containing unwind
-# information in some cases where it previously did not. GRUB doesn't need
-# these and they just use up vital space. Restore the old compiler
-# behaviour.
-AC_CACHE_CHECK([whether -fno-asynchronous-unwind-tables works], [grub_cv_cc_fno_asynchronous_unwind_tables], [
- CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
- CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
- [grub_cv_cc_fno_asynchronous_unwind_tables=yes],
- [grub_cv_cc_fno_asynchronous_unwind_tables=no])
@ -63,9 +65,24 @@ index 8d780e3..5e2529a 100644
- TARGET_CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables"
-fi
-
AC_ARG_ENABLE([efiemu],
[AS_HELP_STRING([--enable-efiemu],
[build and install the efiemu runtimes (default=guessed)])])
-AC_CACHE_CHECK([whether -fno-unwind-tables works], [grub_cv_cc_fno_unwind_tables], [
- CFLAGS="$TARGET_CFLAGS -fno-unwind-tables"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
- [grub_cv_cc_fno_unwind_tables=yes],
- [grub_cv_cc_fno_unwind_tables=no])
-])
-
-if test "x$grub_cv_cc_fno_unwind_tables" = xyes; then
- TARGET_CFLAGS="$TARGET_CFLAGS -fno-unwind-tables"
-fi
-
-
CFLAGS="$TARGET_CFLAGS"
-
if test x"$platform" = xemu ; then
TARGET_OBJ2ELF=
grub_cv_target_cc_link_format=
--
2.4.3
2.5.0

View File

@ -1,7 +1,7 @@
From fa89f53a982350e80fcabbceb8c7066636b30761 Mon Sep 17 00:00:00 2001
From 5e50fc35ba1c2f03cc9ccbd6ae2f49dcb0ffd560 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Sun, 28 Jun 2015 13:09:58 -0400
Subject: [PATCH 5/6] Add grub_qdprintf() - grub_dprintf() without the
Subject: [PATCH 10004/10006] Add grub_qdprintf() - grub_dprintf() without the
file+line number.
This just makes copy+paste of our debug loading info easier.
@ -13,10 +13,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
2 files changed, 20 insertions(+)
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
index be6aa63..71f597d 100644
index d7dcd97..8e12a62 100644
--- a/grub-core/kern/misc.c
+++ b/grub-core/kern/misc.c
@@ -178,6 +178,24 @@ grub_real_dprintf (const char *file, const int line, const char *condition,
@@ -179,6 +179,24 @@ grub_real_dprintf (const char *file, const int line, const char *condition,
}
}
@ -42,7 +42,7 @@ index be6aa63..71f597d 100644
int
diff --git a/include/grub/misc.h b/include/grub/misc.h
index 2a9f87c..da44520 100644
index 0620814..4cb1ba5 100644
--- a/include/grub/misc.h
+++ b/include/grub/misc.h
@@ -326,6 +326,8 @@ void EXPORT_FUNC(grub_real_dprintf) (const char *file,
@ -55,5 +55,5 @@ index 2a9f87c..da44520 100644
int EXPORT_FUNC(grub_snprintf) (char *str, grub_size_t n, const char *fmt, ...)
__attribute__ ((format (GNU_PRINTF, 3, 4)));
--
2.4.3
2.5.0

View File

@ -1,7 +1,8 @@
From 2053c4610482deff681feb96f2637933c44f8f3f Mon Sep 17 00:00:00 2001
From 5dbc4254266d8d8d64d5d2fe2ad02ff200f4a7a6 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 25 Jun 2015 15:11:36 -0400
Subject: [PATCH 6/6] Make a "gdb" dprintf that tells us load addresses.
Subject: [PATCH 10005/10006] Make a "gdb" dprintf that tells us load
addresses.
This makes a grub_dprintf() call during platform init and during module
loading that tells us the virtual addresses of the .text and .data
@ -20,10 +21,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
4 files changed, 81 insertions(+), 4 deletions(-)
diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
index 58931fa..82c7abd 100644
index 247cd0a..f29691c 100644
--- a/grub-core/kern/dl.c
+++ b/grub-core/kern/dl.c
@@ -453,6 +453,24 @@ grub_dl_find_section (Elf_Ehdr *e, const char *name)
@@ -457,6 +457,24 @@ grub_dl_find_section (Elf_Ehdr *e, const char *name)
return NULL;
}
@ -48,7 +49,7 @@ index 58931fa..82c7abd 100644
/* Me, Vladimir Serbinenko, hereby I add this module check as per new
GNU module policy. Note that this license check is informative only.
Modules have to be licensed under GPLv3 or GPLv3+ (optionally
@@ -593,6 +611,38 @@ grub_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
@@ -600,6 +618,38 @@ grub_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
return GRUB_ERR_NONE;
}
@ -87,7 +88,7 @@ index 58931fa..82c7abd 100644
/* Load a module from core memory. */
grub_dl_t
grub_dl_load_core_noinit (void *addr, grub_size_t size)
@@ -651,6 +701,8 @@ grub_dl_load_core_noinit (void *addr, grub_size_t size)
@@ -658,6 +708,8 @@ grub_dl_load_core_noinit (void *addr, grub_size_t size)
grub_dprintf ("modules", "module name: %s\n", mod->name);
grub_dprintf ("modules", "init function: %p\n", mod->init);
@ -97,10 +98,10 @@ index 58931fa..82c7abd 100644
{
grub_dl_unload (mod);
diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
index 95c75d4..d757b2a 100644
index 101307f..7492f9d 100644
--- a/grub-core/kern/efi/efi.c
+++ b/grub-core/kern/efi/efi.c
@@ -298,7 +298,7 @@ grub_efi_secure_boot (void)
@@ -274,7 +274,7 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid,
/* Search the mods section from the PE32/PE32+ image. This code uses
a PE32 header, but should work with PE32+ as well. */
grub_addr_t
@ -109,7 +110,7 @@ index 95c75d4..d757b2a 100644
{
grub_efi_loaded_image_t *image;
struct grub_pe32_header *header;
@@ -312,6 +312,7 @@ grub_efi_modules_addr (void)
@@ -288,6 +288,7 @@ grub_efi_modules_addr (void)
if (! image)
return 0;
@ -117,7 +118,7 @@ index 95c75d4..d757b2a 100644
header = image->image_base;
coff_header = &(header->coff_header);
sections
@@ -323,7 +324,7 @@ grub_efi_modules_addr (void)
@@ -299,7 +300,7 @@ grub_efi_modules_addr (void)
i < coff_header->num_sections;
i++, section++)
{
@ -127,7 +128,7 @@ index 95c75d4..d757b2a 100644
}
diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c
index d17d18e..86935c6 100644
index a5b6c1d..9939fde 100644
--- a/grub-core/kern/efi/init.c
+++ b/grub-core/kern/efi/init.c
@@ -59,10 +59,33 @@ grub_efi_env_init (void)
@ -174,10 +175,10 @@ index d17d18e..86935c6 100644
}
diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h
index 2245632..6aa0106 100644
index 9a2da0e..37d57d8 100644
--- a/include/grub/efi/efi.h
+++ b/include/grub/efi/efi.h
@@ -85,7 +85,7 @@ extern void (*EXPORT_VAR(grub_efi_net_config)) (grub_efi_handle_t hnd,
@@ -84,7 +84,7 @@ extern void (*EXPORT_VAR(grub_efi_net_config)) (grub_efi_handle_t hnd,
char **device,
char **path);
@ -187,5 +188,5 @@ index 2245632..6aa0106 100644
void grub_efi_mm_init (void);
void grub_efi_mm_fini (void);
--
2.4.3
2.5.0

View File

@ -0,0 +1,66 @@
From ede25cf0ee4a6078f21d580f10d62de238b1729b Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 22 Jul 2015 16:09:59 -0400
Subject: [PATCH 10006/10006] Try it in gentpl again...
---
grub-core/Makefile.core.def | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 9fa9790..eed40d2 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -44,6 +44,18 @@ transform_data = {
enable = powerpc_ieee1275;
};
+library = {
+ name = kernel_noemu_nodist_symlist.a;
+ noemu_nodist = symlist.c;
+ ia64_efi_cflags = '-fno-builtin -fpic -minline-int-divide-max-throughput -g0';
+ x86_64_xen_cppflags = '$(CPPFLAGS_XEN) -g0';
+ i386_xen_cppflags = '$(CPPFLAGS_XEN) -g0';
+ mips_arc_cppflags = '-DGRUB_DECOMPRESSOR_LINK_ADDR=$(TARGET_DECOMPRESSOR_LINK_ADDR) -g0';
+ i386_qemu_cppflags = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR) -g0';
+ emu_cflags = '$(CFLAGS_GNULIB) -g0';
+ emu_cppflags = '$(CPPFLAGS_GNULIB) -g0';
+};
+
kernel = {
name = kernel;
@@ -133,7 +145,7 @@ kernel = {
noemu = kern/time.c;
noemu = kern/generic/millisleep.c;
- noemu_nodist = symlist.c;
+ ldadd = kernel_noemu_nodist_symlist.a;
mips = kern/generic/rtc_get_time_ms.c;
@@ -350,6 +362,13 @@ program = {
enable = emu;
};
+library = {
+ name = emu_nodist_symlist.a;
+ emu_nodist = symlist.c;
+ cflags = '-g0';
+ cppflags = '-g0';
+};
+
program = {
name = grub-emu-lite;
@@ -357,6 +376,7 @@ program = {
emu_nodist = symlist.c;
ldadd = 'kernel.exec$(EXEEXT)';
+ ldadd = emu_nodist_symlist.a;
ldadd = 'gnulib/libgnu.a $(LIBINTL) $(LIBUTIL) $(LIBSDL) $(LIBUSB) $(LIBPCIACCESS) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
enable = emu;
--
2.5.0

View File

@ -66,11 +66,11 @@ Source7: grub.patches
# git checkout debuginfo
# git format-patch fedora-23..
Patch10001: 10001-Put-the-correct-.file-directives-in-our-.S-files.patch
Patch10002: 10002-Make-efi-machines-load-an-env-block-from-a-variable.patch
Patch10003: 10003-Make-it-possible-to-enabled-build-id-sha1.patch
#Patch10004: 10004-Don-t-tell-the-compiler-to-do-annoying-things-with-f.patch
Patch10005: 10005-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch
Patch10006: 10006-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch
Patch10002: 10002-Make-it-possible-to-enabled-build-id-sha1.patch
#Patch10003: 10003-Don-t-tell-the-compiler-to-do-annoying-things-with-.patch
Patch10004: 10004-Add-grub_qdprintf-grub_dprintf-without-the-file-lin.patch
Patch10005: 10005-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch
#Patch10006: 10006-Try-it-in-gentpl-again.patch
BuildRequires: flex bison binutils python
BuildRequires: ncurses-devel xz-devel bzip2-devel