Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
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. . .
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?
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
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/
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!
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
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. . . =-}
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
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. . .
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.