LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can't get kernel to compile as x86_64 arch... (http://www.linuxquestions.org/questions/linux-software-2/can%27t-get-kernel-to-compile-as-x86_64-arch-70854/)

Electrode 07-08-2003 12:10 AM

Can't get kernel to compile with ARCH=x86_64...
 
If the subject line didn't clearly define the problem, I'm trying to compile a 64-bit kernel for my AMD Opteron box. 32-bit kernel (ARCH=i386) compiled and runs fine, but when I set ARCH=x86_64 in the Makefile, configure and run make dep:

Code:

electrode@belphegor:/usr/src/linux$ make dep
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/mkdep scripts/mkdep.c
make[1]: Entering directory `/usr/src/linux-2.4.21-ac4/arch/x86_64/tools'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/src/linux-2.4.21-ac4/arch/x86_64/tools'
make[1]: Entering directory `/usr/src/linux-2.4.21-ac4/arch/x86_64/boot'
make[1]: Nothing to be done for `dep'.
make[1]: Leaving directory `/usr/src/linux-2.4.21-ac4/arch/x86_64/boot'
rm -f .depend .hdepend
make _sfdep_arch/x86_64/tools _sfdep_kernel _sfdep_drivers _sfdep_mm _sfdep_fs _sfdep_net _sfdep_ipc _sfdep_lib _sfdep_arch/x86_64/kernel _sfdep_arch/x86_64/mm _sfdep_arch/x86_64/lib _sfdep_arch/x86_64/ia32 _FASTDEP_ALL_SUB_DIRS="arch/x86_64/tools kernel drivers mm fs net ipc lib arch/x86_64/kernel arch/x86_64/mm arch/x86_64/lib arch/x86_64/ia32"
make[1]: Entering directory `/usr/src/linux-2.4.21-ac4'
make -C arch/x86_64/tools fastdep
make[2]: Entering directory `/usr/src/linux-2.4.21-ac4/arch/x86_64/tools'
gcc -D__KERNEL__ -I/usr/src/linux-2.4.21-ac4/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -finline-limit=2000 -fno-strength-reduce -fno-asynchronous-unwind-tables -S -o offset.tmp offset.c
cc1: code model `kernel' not supported in the 32 bit mode
In file included from /usr/src/linux-2.4.21-ac4/include/linux/fs.h:23,
                from /usr/src/linux-2.4.21-ac4/include/linux/capability.h:17,
                from /usr/src/linux-2.4.21-ac4/include/linux/binfmts.h:5,
                from /usr/src/linux-2.4.21-ac4/include/linux/sched.h:9,
                from offset.c:9:
/usr/src/linux-2.4.21-ac4/include/linux/string.h:31: warning: conflicting types for built-in function `strncpy'
/usr/src/linux-2.4.21-ac4/include/linux/string.h:37: warning: conflicting types for built-in function `strncat'
/usr/src/linux-2.4.21-ac4/include/linux/string.h:43: warning: conflicting types for built-in function `strncmp'
/usr/src/linux-2.4.21-ac4/include/linux/string.h:77: warning: conflicting types for built-in function `memcmp'
In file included from /usr/src/linux-2.4.21-ac4/include/linux/timex.h:152,
                from /usr/src/linux-2.4.21-ac4/include/linux/sched.h:14,
                from offset.c:9:
/usr/src/linux-2.4.21-ac4/include/asm/timex.h: In function `get_cycles':
/usr/src/linux-2.4.21-ac4/include/asm/timex.h:30: warning: left shift count >= width of type
In file included from offset.c:15:
/usr/src/linux-2.4.21-ac4/include/asm/desc.h: In function `_set_gate':
/usr/src/linux-2.4.21-ac4/include/asm/desc.h:96: warning: right shift count >= width of type
/usr/src/linux-2.4.21-ac4/include/asm/desc.h: In function `set_tssldt_descriptor':
/usr/src/linux-2.4.21-ac4/include/asm/desc.h:126: warning: right shift count >= width of type
offset.c: In function `main':
offset.c:35: structure has no member named `processor'
make[2]: *** [offset.h] Error 1
make[2]: Leaving directory `/usr/src/linux-2.4.21-ac4/arch/x86_64/tools'
make[1]: *** [_sfdep_arch/x86_64/tools] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.21-ac4'
make: *** [dep-files] Error 2

Advice?

By the way, I'm using kernel 2.4.21-ac4 with no other patches, and I'm compiling on Slackware 9.0.

BittaBrotha 07-08-2003 01:11 AM

Quote:

cc1: code model `kernel' not supported in the 32 bit mode
It sounds like you're trying to compile a 64bit kernel on a 32bit system or something like that. Is it a way to turn on the 64 bit mode?

Opteron is a 64 bit cpu?


Electrode 07-08-2003 01:32 AM

Quote:

Originally posted by BittaBrotha
Is it a way to turn on the 64 bit mode?
Not without a 64-bit kernel.

Quote:

Opteron is a 64 bit cpu?
Correct.

moses 07-08-2003 02:30 AM

Have you tried compiling the 2.5.x kernel? I know it's dev, but it's supposed to support the Opteron better than the 2.4.x kernels. I'm curious as to whether it (the 2.5) will compile, or if you need to muck with gcc to make it 64-bit aware.
I'll be dealing with this problem in a week or so when I start building an Opteron machine at work, so if you figure it out, I'd appreciate it if you send any hints LQ's way. . .

Electrode 07-08-2003 01:49 PM

I just tried 2.5, and that didn't work out either. When doing make menuconfig, I got the same error message, "code model 'kernel' not supported in 32-bit mode".

Maybe I need a cross-compiler. Anyone know anything about building these, specificly one for x86-64?

moses 07-08-2003 03:14 PM

I wonder if you need to have 64-bit gcc and binutils. Uggg. Well, it looks like I'll be fighting with this problem soon.
Have you looked at http://www.x86-64.org/

Electrode 07-08-2003 03:55 PM

That site hasn't been updated in a year.

since I can't compile a 64-bit kernel without a cross-compiler, and I'm not having any luck building that, I think my only option is to find a 64-bit distro to build things from. The problem there is, I can't find one! :mad:

moses 07-08-2003 07:38 PM

If you have $500 to spend, Suse has an enterprise server for AMD64. . . I haven't spent the time to really investigate it yet. Maybe this evening, though I would rather wait until I get the computer. . . =-}

Electrode 07-08-2003 11:26 PM

After blowing $1100 on a motherboard and pair of CPUs, I don't have any money to spend! :)

I heard that there's a free 64-bit build of RedHat out there somewhere. I've yet to find it.

moses 07-09-2003 12:27 AM

You can also download the development packages from Suse:
ftp://ftp.suse.com/pub/suse/x86-64/supplementary/GCC/ ftp://ftp.suse.com/pub/suse/x86-64/supplementary/GLIBC
etc.
http://www.amd.com/us-en/assets/cont...ide_All_OS.pdf

moses 07-09-2003 12:37 AM

My plan is to build Slackware from source on the Opteron, but I'm not sure how well that will go. . . I will probably use the above dev packages from Suse, but I'm still in the nebulous planning stages. . .

Electrode 07-09-2003 04:00 AM

well, whatever you decide to do, perhaps when everything is set up you could build a 64-bit live CD for us to work with? :)

Even just a tarball with kernel, gcc and minimal userland would be helpful... :D

moses 07-09-2003 09:55 AM

If I get it to work, I will be both sending the changes back to Patrick and also figuring out some way of providing a bootable CD to the rest of the world (though I have bandwidth issues).

Electrode 07-09-2003 02:59 PM

Well, you could use Bit Torrent or something... :)

moses 07-09-2003 08:50 PM

I'll worry about it more once I get it working (if I don't give up and have my boss spend $500 on Suse). =-}


All times are GMT -5. The time now is 02:06 AM.