Skip to contentSkip to conversation

Can't build current snapshot

DISCUSSION Peter Chubb 2 participants 3 messages Jul 16, 2003

lore
Share & tools
lore
#0 lore raw

From David's BK tree as of this morning, when building for the simulator:

     ...

LD .tmp_vmlinux1
arch/ia64/kernel/built-in.o(.text+0x962): In function `efi_init':
arch/ia64/kernel/efi.c:468: relocation truncated to fit: IMM22 per_cpu__ia64_phys_stacked_size_p8 arch/ia64/kernel/built-in.o(.text+0xbe2):arch/ia64/kernel/efi.c:482: relocation truncated to fit: IMM22 per_cpu__ia64_phys_stacked_size_p8 arch/ia64/kernel/built-in.o(.text+0x3302): In function fsys_gettimeofday': : relocation truncated to fit: IMM22 per_cpu__cpu_info

This is with the current cvs snapshot binutils,
gcc 3.2.3 20030221 (Debian prerelease)

CONFIG_SMP is *not* set, CONFIG_VIRTUAL_MEM_MAP is *not* set.

--
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au
You are lost in a maze of BitKeeper repositories, all slightly different.

#1 lore raw
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line · Peter Chubb

From David's BK tree as of this morning, when building for the simulator:

Peter> ... LD .tmp_vmlinux1
Peter> arch/ia64/kernel/built-in.o(.text+0x962): In function Peter> `efi_init': arch/ia64/kernel/efi.c:468: relocation truncated Peter> to fit: IMM22 per_cpu__ia64_phys_stacked_size_p8
Peter> arch/ia64/kernel/built-in.o(.text+0xbe2):arch/ia64/kernel/efi.c:482:
Peter> relocation truncated to fit: IMM22
Peter> per_cpu__ia64_phys_stacked_size_p8
Peter> arch/ia64/kernel/built-in.o(.text+0x3302): In function Peter> fsys_gettimeofday': : relocation truncated to fit: IMM22 Peter> per_cpu__cpu_info

Peter> This is with the current cvs snapshot binutils, gcc 3.2.3 Peter> 20030221 (Debian prerelease)

Peter> CONFIG_SMP is *not* set, CONFIG_VIRTUAL_MEM_MAP is *not* set.

You'd get this if the per-cpu area is not linked at -PER_CPU_PAGE_SIZE. Did you start with a clean tree (make mrproper)?

	--david
#2 lore raw
In reply to Peter Chubb
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Peter Chubb

Peter> I've just cleared out ccache and done a make mrproper; make Peter> config; make. The same relocation errors appear.

OK.

Peter> There's something funny going on here, because the offending symbol is Peter> defined and used in setup.c (and entry.S), not efi.c

Peter> It's put in the data section.
Peter> $ nm arch/ia64/kernel/setup.o|grep ia64_phys_ Peter> 0000000000000028 G per_cpu__ia64_phys_stacked_size_p8

Peter> I'm a little suprised that it isn't in the BSS.

Peter> There is no per-cpu area as such.
Peter> CONFIG_SMP is not defined, so DEFINE_PER_CPU Peter> doesn't put the per_cpu variables into a separate segment

Peter> From asm-ia64/percpu.h:

Peter> #define DEFINE_PER_CPU(type, name) __typeof__(type) per_cpu__##name

Oh, it all makes sense now. Yes, on UP we failed to put per-CPU stuff in a special section. We have to do that now, so that the variables remain "addl"-addressable.

The patch below should fix the problem.

Thanks for tracking this down.

	--david

=== include/asm-ia64/percpu.h 1.9 vs edited ==--- 1.9/include/asm-ia64/percpu.h Tue Jul 15 14:39:31 2003
+++ edited/include/asm-ia64/percpu.h Tue Jul 15 22:49:34 2003
@@ -18,6 +18,10 @@

#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name

+/* Separate out the type, so (int[3], foo) works. */
+#define DEFINE_PER_CPU(type, name) \
+ __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
+
/*
* Pretty much a literal copy of asm-generic/percpu.h, except that percpu_modcopy() is an
* external routine, to avoid include-hell.
@@ -29,10 +33,6 @@
/* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */ DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);

-/* Separate out the type, so (int[3], foo) works. */
-#define DEFINE_PER_CPU(type, name) \
- __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
-
#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset)))

@@ -40,7 +40,6 @@

#else /* ! SMP */

-#define DEFINE_PER_CPU(type, name) __typeof__(type) per_cpu__##name
#define per_cpu(var, cpu) ((void)cpu, per_cpu__##var)
#define __get_cpu_var(var) per_cpu__##var