LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 07-08-2003, 12:10 AM   #1
Electrode
Member
 
Registered: Oct 2002
Location: Michigan
Distribution: Debian
Posts: 158

Rep: Reputation: 16
Question 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.

Last edited by Electrode; 07-08-2003 at 12:31 AM.
 
Old 07-08-2003, 01:11 AM   #2
BittaBrotha
Member
 
Registered: Jan 2002
Location: Third Stone from the Sun
Distribution: Debian Sid, SourceMage 0.9.5, & To be Continued on a TP
Posts: 800

Rep: Reputation: 31
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?


Last edited by BittaBrotha; 07-08-2003 at 01:12 AM.
 
Old 07-08-2003, 01:32 AM   #3
Electrode
Member
 
Registered: Oct 2002
Location: Michigan
Distribution: Debian
Posts: 158

Original Poster
Rep: Reputation: 16
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.
 
Old 07-08-2003, 02:30 AM   #4
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
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. . .
 
Old 07-08-2003, 01:49 PM   #5
Electrode
Member
 
Registered: Oct 2002
Location: Michigan
Distribution: Debian
Posts: 158

Original Poster
Rep: Reputation: 16
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?

Last edited by Electrode; 07-08-2003 at 03:09 PM.
 
Old 07-08-2003, 03:14 PM   #6
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
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/
 
Old 07-08-2003, 03:55 PM   #7
Electrode
Member
 
Registered: Oct 2002
Location: Michigan
Distribution: Debian
Posts: 158

Original Poster
Rep: Reputation: 16
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!

Last edited by Electrode; 07-08-2003 at 03:58 PM.
 
Old 07-08-2003, 07:38 PM   #8
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
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. . . =-}
 
Old 07-08-2003, 11:26 PM   #9
Electrode
Member
 
Registered: Oct 2002
Location: Michigan
Distribution: Debian
Posts: 158

Original Poster
Rep: Reputation: 16
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.
 
Old 07-09-2003, 12:27 AM   #10
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
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
 
Old 07-09-2003, 12:37 AM   #11
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
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. . .
 
Old 07-09-2003, 04:00 AM   #12
Electrode
Member
 
Registered: Oct 2002
Location: Michigan
Distribution: Debian
Posts: 158

Original Poster
Rep: Reputation: 16
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...
 
Old 07-09-2003, 09:55 AM   #13
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
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).
 
Old 07-09-2003, 02:59 PM   #14
Electrode
Member
 
Registered: Oct 2002
Location: Michigan
Distribution: Debian
Posts: 158

Original Poster
Rep: Reputation: 16
Well, you could use Bit Torrent or something...
 
Old 07-09-2003, 08:50 PM   #15
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
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). =-}
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
x86_64 library compile problem zypo Fedora 1 10-10-2005 04:46 AM
kernel compile on x86_64 fails acidjuice Linux - Software 1 05-06-2005 04:30 PM
Fedora FC2 Arch= x86_64 install leaves duplicate packages in RPM database w8hrq Fedora - Installation 2 10-05-2004 01:14 PM
installing i386 software on x86_64 arch--easy way? silex Linux - Software 0 09-09-2004 12:02 PM
Compile errors on x86_64 SUSE marsonist Linux - Software 5 05-20-2004 05:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration