Skip to contentSkip to conversation

Problems compiling 2.4 kernel

uml-devel Anthony Brock 3 participants 3 messages Jul 1, 2004 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

I've been using 2.6 kernels for several months. However, a new project requires me to build a UML 2.4 kernel. Unfortunately, I can't seem to compile the guest kernel. For this task, we've deployed a new machine with:

SuSE 9.0
C/C++ Development installed

My steps are as follows:

lynx http://www.kernel.org/ (download the 2.4.26 kernel)
lynx http://prdownloads.sourceforge.net/user-mode-linux/uml-patch-2.4.26-1.bz2
tar -zxf linux-2.4.26.tar.gz
chown -R root:root linux-2.4.26
cd linux-2.4.26/
patch -p1 <../uml-patch-2.4.26-1 (applies cleanly with no rejects)
vi Makefile (replace all instances of '-02' with '-01')
gzip -dc /proc/config.gz > .config
make oldconfig ARCH=um
make dep ARCH=um (this just flies - it takes less than one second)
make ARCH=um

At this point, I see over 5000 errors lines. It starts with:

gcc -D__KERNEL__ -I/root/uml-2.4/linux-2.4.26/include -Wall -Wstrict-prototypes -Wno-trigraphs -O1 -fno-strict-aliasing -fno-common -U__i386__ -Ui386 -g -D__arch_um__ -DSUBARCH=\"i386\" -D_LARGEFILE64_SOURCE -I/root/uml-2.4/linux-2.4.26/arch/um/include -Derrno=kernel_errno -I/root/uml-2.4/linux-2.4.26/arch/um/kernel/tt/include -I/root/uml-2.4/linux-2.4.26/arch/um/kernel/skas/include -DKBUILD_BASENAME=main -c -o init/main.o init/main.c
In file included from /root/uml-2.4/linux-2.4.26/include/linux/posix_types.h:46,

                 from /root/uml-2.4/linux-2.4.26/include/linux/types.h:15,
                 from /root/uml-2.4/linux-2.4.26/include/linux/capability.h:16,
                 from /root/uml-2.4/linux-2.4.26/include/linux/binfmts.h:5,
                 from /root/uml-2.4/linux-2.4.26/include/linux/sched.h:9,
                 from /root/uml-2.4/linux-2.4.26/include/linux/mm.h:4,
                 from /root/uml-2.4/linux-2.4.26/include/linux/slab.h:14,
                 from /root/uml-2.4/linux-2.4.26/include/linux/proc_fs.h:5,
                 from init/main.c:15:
/root/uml-2.4/linux-2.4.26/include/asm/posix_types.h:4:34: asm/arch/posix_types.h: No such file or directory
In file included from /root/uml-2.4/linux-2.4.26/include/linux/types.h:16,
                 from /root/uml-2.4/linux-2.4.26/include/linux/capability.h:16,
                 from /root/uml-2.4/linux-2.4.26/include/linux/binfmts.h:5,
                 from /root/uml-2.4/linux-2.4.26/include/linux/sched.h:9,
                 from /root/uml-2.4/linux-2.4.26/include/linux/mm.h:4,
                 from /root/uml-2.4/linux-2.4.26/include/linux/slab.h:14,
                 from /root/uml-2.4/linux-2.4.26/include/linux/proc_fs.h:5,
                 from init/main.c:15:
/root/uml-2.4/linux-2.4.26/include/asm/types.h:4:28: asm/arch/types.h: No such file or directory
In file included from /root/uml-2.4/linux-2.4.26/include/linux/capability.h:16,
                 from /root/uml-2.4/linux-2.4.26/include/linux/binfmts.h:5,
                 from /root/uml-2.4/linux-2.4.26/include/linux/sched.h:9,
                 from /root/uml-2.4/linux-2.4.26/include/linux/mm.h:4,
                 from /root/uml-2.4/linux-2.4.26/include/linux/slab.h:14,
                 from /root/uml-2.4/linux-2.4.26/include/linux/proc_fs.h:5,
                 from init/main.c:15:

/root/uml-2.4/linux-2.4.26/include/linux/types.h:21: error: parse error before "dev_t" /root/uml-2.4/linux-2.4.26/include/linux/types.h:21: warning: type defaults to int' in declaration of dev_t' /root/uml-2.4/linux-2.4.26/include/linux/types.h:21: warning: data definition has no type or storage class /root/uml-2.4/linux-2.4.26/include/linux/types.h:22: error: parse error before "ino_t"

Help is greatly appreciated!

Tony

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 1 line · [email protected] said:

gzip -dc /proc/config.gz > .config

wtf are you trying to accomplish here? You can't use the host's (i386 2.6) .config to build a 2.4 UML kernel.

Jeff

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#2 lore raw

Alle 18:43, giovedì 1 luglio 2004, Jeff Dike ha scritto:

Quoted 1 line

[email protected] said:

The problem is another: uml Makefile don't manage properly the include/asm/arch symlink, and it is not created:

Quoted 1 line

asm/arch/posix_types.h: No such file or directory

To workaround this:
cd include
<make sure that asm points to asm-um>
cd asm
ln -s ../asm-i386 arch

There is a lot of other people claiming similar problems. For instance, somebody else complained that to build UML he must avoid doing "make mrproper ARCH=um" because some files are not recreated (with 2.4.24-3).

However, Anthony, I would recommend using, for optimal stability, a 2.4.26 vanilla kernel patched with 2.4.24-1um + the attached patch.

Bye

Signature · 2 lines
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
include/asm-um/system-i386.h +0 -31
@@ -5,35 +5,4 @@
 
 #define __HAVE_ARCH_CMPXCHG 1
 
-static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
-				      unsigned long new, int size)
-{
-	unsigned long prev;
-	switch (size) {
-	case 1:
-		__asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
-				     : "=a"(prev)
-				     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-				     : "memory");
-		return prev;
-	case 2:
-		__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
-				     : "=a"(prev)
-				     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-				     : "memory");
-		return prev;
-	case 4:
-		__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
-				     : "=a"(prev)
-				     : "q"(new), "m"(*__xg(ptr)), "0"(old)
-				     : "memory");
-		return prev;
-	}
-	return old;
-}
-
-#define cmpxchg(ptr,o,n)\
-	((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
-					(unsigned long)(n),sizeof(*(ptr))))
-    
 #endif