Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 148549 - suspend2-sources-2.6.18 compile error on amd64
Summary: suspend2-sources-2.6.18 compile error on amd64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Christian Heim (RETIRED)
URL: http://lkml.org/lkml/2006/7/26/223
Whiteboard:
Keywords:
: 148918 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-21 10:32 UTC by Wiktor Wandachowicz
Modified: 2006-09-24 05:50 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
complete patch from suspend2-2.2.8-for-2.6.18 (x86_64_nosave.patch,10.81 KB, patch)
2006-09-22 11:59 UTC, Jan Jitse Venselaar
Details | Diff
Patch that actually applies (x86_64_nosave.patch,3.05 KB, patch)
2006-09-22 12:10 UTC, Jan Jitse Venselaar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wiktor Wandachowicz 2006-09-21 10:32:42 UTC
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 Diego Busacca 2006-09-22 01:33:46 UTC
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 Jan Jitse Venselaar 2006-09-22 11:58:27 UTC
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 Jan Jitse Venselaar 2006-09-22 11:59:04 UTC
Created attachment 97777 [details, diff]
complete patch from suspend2-2.2.8-for-2.6.18
Comment 4 Jan Jitse Venselaar 2006-09-22 12:10:19 UTC
Created attachment 97781 [details, diff]
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 Jan Jitse Venselaar 2006-09-22 12:36:36 UTC
It compiles, links, boots and suspends to disk without problems.
Comment 6 Christian Heim (RETIRED) gentoo-dev 2006-09-23 10:29:45 UTC
(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 Jakub Moc (RETIRED) gentoo-dev 2006-09-24 05:50:31 UTC
*** Bug 148918 has been marked as a duplicate of this bug. ***