Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 148549
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Christian Heim (RETIRED) <phreak@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Wiktor Wandachowicz <siryes@gmail.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
x86_64_nosave.patch complete patch from suspend2-2.2.8-for-2.6.18 patch Jan Jitse Venselaar 2006-09-22 11:59 0000 10.81 KB Details | Diff
x86_64_nosave.patch Patch that actually applies patch Jan Jitse Venselaar 2006-09-22 12:10 0000 3.05 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 148549 depends on: Show dependency tree
Bug 148549 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-09-21 10:32 0000
While compiling suspend2-sources-2.6.18 kernel on amd64 machine it
bailed out with: " undefined reference to `e820_mark_nosave_regions' ".
On another x86 machine kernel compiled fine.

  CC [M]  lib/crc-ccitt.o
  CC [M]  lib/libcrc32c.o
  CC [M]  lib/ts_kmp.o
  CC [M]  lib/ts_bm.o
  CC [M]  lib/ts_fsm.o
  CC      arch/x86_64/lib/io.o
  AS      arch/x86_64/lib/iomap_copy.o
  LD      arch/x86_64/lib/built-in.o
  CC      arch/x86_64/lib/bitops.o
  CC      arch/x86_64/lib/bitstr.o
  AS      arch/x86_64/lib/clear_page.o
  AS      arch/x86_64/lib/copy_page.o
  AS      arch/x86_64/lib/copy_user.o
  AS      arch/x86_64/lib/csum-copy.o
  CC      arch/x86_64/lib/csum-partial.o
  CC      arch/x86_64/lib/csum-wrappers.o
  CC      arch/x86_64/lib/delay.o
  AS      arch/x86_64/lib/getuser.o
  AS      arch/x86_64/lib/memcpy.o
  CC      arch/x86_64/lib/memmove.o
  AS      arch/x86_64/lib/memset.o
  AS      arch/x86_64/lib/putuser.o
  AS      arch/x86_64/lib/thunk.o
  CC      arch/x86_64/lib/usercopy.o
  AR      arch/x86_64/lib/lib.a
  GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      vmlinux
arch/x86_64/kernel/built-in.o: In function `setup_arch':
(.init.text+0x18e0): undefined reference to `e820_mark_nosave_regions'
make: *** [vmlinux] Error 1


As a quick check I grepped for the problematic symbol:

# pwd
/usr/src/linux-2.6.18-suspend2

# grep -R e820_mark_nosave_regions .
./include/asm-x86_64/e820.h:extern void e820_mark_nosave_regions(void);
./include/asm/e820.h:extern void e820_mark_nosave_regions(void);
Binary file ./arch/x86_64/kernel/built-in.o matches
Binary file ./arch/x86_64/kernel/setup.o matches
./arch/x86_64/kernel/setup.c:   e820_mark_nosave_regions();

Note: there's no *.c file with the actual definition of this function.

Asking Google: http://www.google.pl/search?q=e820_mark_nosave_regions
yielded three results, of which I copied the first one into example URL.

From what I can tell it looks like that the 'e820_mark_nosave_regions'
function should reside in the 'arch/x86_64/kernel/e820.c' file. But it
could not be found there (vide: grep results). Probably suspend2 patches
somehow missed that.

Please check and fix.

PS.
If you want my .config, just ask and I'll attach it :-)

------- Comment #1 From Diego Busacca 2006-09-22 01:33:46 0000 -------
Same problem here.
I've tried untarring the kernel source and applying the suspend2 patch from
www.suspend2.net and the kernel compile fine.

------- Comment #2 From Jan Jitse Venselaar 2006-09-22 11:58:27 0000 -------
The patch 4411-x86_64-nosave.patch is incomplete, which gives this error.
It patches only the following:
---
 arch/x86_64/kernel/e820.c  |   48 ++++++++++++++++++++++++++++++++++++++++=
+++++
 arch/x86_64/kernel/setup.c |    1 =

 include/asm-x86_64/e820.h  |    1 =

 3 files changed, 50 insertions(+)

Index: linux-2.6.18/arch/x86_64/kernel/e820.c
===================================================================
--- linux-2.6.18.orig/arch/x86_64/kernel/e820.c
+++ linux-2.6.18/arch/x86_64/kernel/e820.c
@@ -16,6 +16,7 @@
 #include <linux/string.h>
 #include <linux/kexec.h>
 #include <linux/module.h>
+#include <linux/mm.h>

 #include <asm/pgtable.h>
 #include <asm/page.h>
Index: linux-2.6.18/arch/x86_64/kernel/setup.c
===================================================================
--- linux-2.6.18.orig/arch/x86_64/kernel/setup.c
+++ linux-2.6.18/arch/x86_64/kernel/setup.c
@@ -690,6 +690,7 @@ void __init setup_arch(char **cmdline_p)
        probe_roms();
       e820_reserve_resources();

+       e820_mark_nosave_regions();
        request_resource(&iomem_resource, &video_ram_resource);

        {
Index: linux-2.6.18/include/asm-x86_64/e820.h
===================================================================
--- linux-2.6.18.orig/include/asm-x86_64/e820.h
+++ linux-2.6.18/include/asm-x86_64/e820.h
@@ -46,6 +46,7 @@ extern void setup_memory_region(void);
 extern void contig_e820_setup(void);
 extern unsigned long e820_end_of_ram(void);
 extern void e820_reserve_resources(void);
+extern void e820_mark_nosave_regions(void);
 extern void e820_print_map(char *who);
 extern int e820_any_mapped(unsigned long start, unsigned long end, unsigned
type);
 extern int e820_all_mapped(unsigned long start, unsigned long end, unsigned
type);


while it should patch more. Complete patch (from the suspend2-patches from
suspend2.net) attached.

------- Comment #3 From Jan Jitse Venselaar 2006-09-22 11:59:04 0000 -------
Created an attachment (id=97777) [details]
complete patch from suspend2-2.2.8-for-2.6.18

------- Comment #4 From Jan Jitse Venselaar 2006-09-22 12:10:19 0000 -------
Created an attachment (id=97781) [details]
Patch that actually applies

The previous patch was broken (e-mail program added some stuff). I've tracked
down the original patch, and had to modify it a bit to apply. Still testing if
this compiles.

------- Comment #5 From Jan Jitse Venselaar 2006-09-22 12:36:36 0000 -------
It compiles, links, boots and suspends to disk without problems.

------- Comment #6 From Christian Heim (RETIRED) 2006-09-23 10:29:45 0000 -------
(In reply to comment #5)
> It compiles, links, boots and suspends to disk without problems.

Thanks a lot for your efforts Jan. I just commited an updated ebuild (no
version bump), so you'll have to sync (in an hour or so) and then remerge
=suspend2-sources-2.6.18.

------- Comment #7 From Jakub Moc (RETIRED) 2006-09-24 05:50:31 0000 -------
*** Bug 148918 has been marked as a duplicate of this bug. ***

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug