aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-11-28 16:43:44 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-28 17:42:22 -0500
commite0f39591cc178026607fcbbe9a53be435fe8285d (patch)
tree18387c401edd3f672a30246b6e580067d8806355
parent5cd9194a1b0b0fa219c31421ac64dfd38670ed49 (diff)
[PATCH] Workaround for gcc 2.96 (undefined references)
LD .tmp_vmlinux1 mm/built-in.o(.text+0x100d6): In function `copy_page_range': : undefined reference to `__pud_alloc' mm/built-in.o(.text+0x1010b): In function `copy_page_range': : undefined reference to `__pmd_alloc' mm/built-in.o(.text+0x11ef4): In function `__handle_mm_fault': : undefined reference to `__pud_alloc' fs/built-in.o(.text+0xc930): In function `install_arg_page': : undefined reference to `__pud_alloc' make: *** [.tmp_vmlinux1] Error 1 Those missing references in mm/memory.c arise from this code in include/linux/mm.h, combined with the fact that __PGTABLE_PMD_FOLDED and __PGTABLE_PUD_FOLDED are both set and __ARCH_HAS_4LEVEL_HACK is not: /* * The following ifdef needed to get the 4level-fixup.h header to work. * Remove it when 4level-fixup.h has been removed. */ #if defined(CONFIG_MMU) && !defined(__ARCH_HAS_4LEVEL_HACK) static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) { return (unlikely(pgd_none(*pgd)) && __pud_alloc(mm, pgd, address))? NULL: pud_offset(pgd, address); } static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) { return (unlikely(pud_none(*pud)) && __pmd_alloc(mm, pud, address))? NULL: pmd_offset(pud, address); } #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ With my configuration the pgd_none and pud_none routines are inlines returning a constant 0. Apparently the old compiler avoids generating calls to __pud_alloc and __pmd_alloc but still lists them as undefined references in the module's symbol table. I don't know which change caused this problem. I think it was added somewhere between 2.6.14 and 2.6.15-rc1, because I remember building several 2.6.14-rc kernels without difficulty. However I can't point to an individual culprit. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--mm/memory.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c
index b57fbc636058..9ab206b829a2 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2160,6 +2160,12 @@ int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
2160 spin_unlock(&mm->page_table_lock); 2160 spin_unlock(&mm->page_table_lock);
2161 return 0; 2161 return 0;
2162} 2162}
2163#else
2164/* Workaround for gcc 2.96 */
2165int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
2166{
2167 return 0;
2168}
2163#endif /* __PAGETABLE_PUD_FOLDED */ 2169#endif /* __PAGETABLE_PUD_FOLDED */
2164 2170
2165#ifndef __PAGETABLE_PMD_FOLDED 2171#ifndef __PAGETABLE_PMD_FOLDED
@@ -2188,6 +2194,12 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
2188 spin_unlock(&mm->page_table_lock); 2194 spin_unlock(&mm->page_table_lock);
2189 return 0; 2195 return 0;
2190} 2196}
2197#else
2198/* Workaround for gcc 2.96 */
2199int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
2200{
2201 return 0;
2202}
2191#endif /* __PAGETABLE_PMD_FOLDED */ 2203#endif /* __PAGETABLE_PMD_FOLDED */
2192 2204
2193int make_pages_present(unsigned long addr, unsigned long end) 2205int make_pages_present(unsigned long addr, unsigned long end)