Skip to contentSkip to conversation

hugetlb compile problems (2.4 with gcc-3.4)

DISCUSSION Bjorn Helgaas 1 participant 1 message Aug 13, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines · Stephane Eranian

I have run into some compilation problems on mm/hugetlb.c when using gcc3.4, it is more picky. It fails because in the latest 2.4 kernel there is the following:

static long htlbzone_pages;

Quoted 8 lines

int set_hugetlb_mem_size(int count)

{
	int j, lcount;
	struct page *page, *map;
Quoted 1 line
Quoted 1 line
Quoted 1 line
	extern long htlbzone_pages;
	extern struct list_head htlbpage_freelist;

}

I applied the following patch for 2.4:

#### AUTHOR [email protected]
#### COMMENT START
### Comments for ChangeSet
HUGETLB: remove bogus "extern" decls to satisfy gcc-3.4. ### Comments for arch/ia64/mm/hugetlbpage.c
HUGETLB: remove bogus "extern" decls to satisfy gcc-3.4. #### COMMENT END

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1076 -> 1.1077
# arch/ia64/mm/hugetlbpage.c 1.2 -> 1.3
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/13 [email protected] 1.1077
# HUGETLB: remove bogus "extern" decls to satisfy gcc-3.4.
# --------------------------------------------
#

arch/ia64/mm/hugetlbpage.c +1 -4
diff -Nru a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
@@ -12,12 +12,11 @@
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
 #include <linux/slab.h>
-#include <linux/module.h>
+#include <linux/sysctl.h>
 #include <asm/mman.h>
 #include <asm/pgalloc.h>
 #include <asm/tlb.h>
 
-#include <linux/sysctl.h>
 
 #define TASK_HPAGE_BASE (REGION_HPAGE << REGION_SHIFT)
 
@@ -357,8 +356,6 @@
 {
 	int j, lcount;
 	struct page *page, *map;
-	extern long htlbzone_pages;
-	extern struct list_head htlbpage_freelist;
 
 	if (count < 0)
 		lcount = count;