Blame SOURCES/0085-Don-t-attempt-to-export-the-start-and-_start-symbols.patch

5593c8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
5593c8
From: Javier Martinez Canillas <javierm@redhat.com>
5593c8
Date: Sat, 12 May 2018 11:29:07 +0200
5593c8
Subject: [PATCH] Don't attempt to export the start and _start symbols for
5593c8
 grub-emu
5593c8
5593c8
Commit 318ee04aadc ("make better backtraces") reworked the backtrace logic
5593c8
but the changes lead to the following build error on the grub-emu platform:
5593c8
5593c8
grub_emu_lite-symlist.o:(.data+0xf08): undefined reference to `start'
5593c8
collect2: error: ld returned 1 exit status
5593c8
make[3]: *** [Makefile:25959: grub-emu-lite] Error 1
5593c8
make[3]: *** Waiting for unfinished jobs....
5593c8
cat kernel_syms.input | grep -v '^#' | sed -n \
5593c8
  -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/defined kernel '""'\1/;p;}' \
5593c8
  -e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/defined kernel '""'\1/;p;}' \
5593c8
  | sort -u >kernel_syms.lst
5593c8
5593c8
The problem is that start and _start symbols are exported unconditionally,
5593c8
but these aren't defined for grub-emu since is an emultaed platform so it
5593c8
doesn't have a startup logic. Don't attempt to export those for grub-emu.
5593c8
5593c8
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
5593c8
---
5593c8
 include/grub/kernel.h | 2 ++
5593c8
 1 file changed, 2 insertions(+)
5593c8
5593c8
diff --git a/include/grub/kernel.h b/include/grub/kernel.h
1c6ba0
index 300a9766cd..55849777ea 100644
5593c8
--- a/include/grub/kernel.h
5593c8
+++ b/include/grub/kernel.h
5593c8
@@ -111,8 +111,10 @@ grub_addr_t grub_modules_get_end (void);
5593c8
 
5593c8
 #endif
5593c8
 
5593c8
+#if !defined(GRUB_MACHINE_EMU)
5593c8
 void EXPORT_FUNC(start) (void);
5593c8
 void EXPORT_FUNC(_start) (void);
5593c8
+#endif
5593c8
 
5593c8
 /* The start point of the C code.  */
5593c8
 void grub_main (void) __attribute__ ((noreturn));