Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 10-09-2008, 03:41 PM   #1
Registered: Feb 2008
Location: Netherlands, Zeeland
Distribution: Slackware64 current multilib, Gentoo
Posts: 41

Rep: Reputation: 18
compile kernel for x86_64

I have an Intel dual core (64bits) computer and I have some experience with kernel compiling. I have a very simple -maybe very stupid- question:

Is it possible to install or compile the kernel for x86_64, so that the kernel is 64 bits and that it can support 32bits applications?

I searched and searched but can't find a good answer. I found something that you first must compile gcc for 64 bits, but how to do that, no idea...
(I don't even know if it is really possible...)
The only thing I found via google is that it is very tricky(?)

Can someone help me out of my dreams, or maybe... give the solution.

(I work of course with slackware (the real one, 32 bits)

Thanks in advance.

Last edited by henkees; 10-09-2008 at 03:50 PM.
Old 10-09-2008, 04:00 PM   #2
Senior Member
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,125
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
Its easiest just to install a 64bit OS and then install the 32bit compatibility libraries for running the 32bit stuff.
Old 10-09-2008, 04:17 PM   #3
Registered: Feb 2008
Location: Netherlands, Zeeland
Distribution: Slackware64 current multilib, Gentoo
Posts: 41

Original Poster
Rep: Reputation: 18
I must say that I also work with Suse (64 bits), but I like Slack more because it's "clear and simple".
I have several times compiled the kernel so that it's quite small and it loads just what is needed for my hardware.
I can say it is quite fast for 32 bits now!

I have read that it could be possible to compile a kernel 64 bits on a 32 bits system with a gcc compiler that supports 64bits.
IF it is possible, then the system would get a little bit faster... IS it possible? How? Or is this really difficult stuff?
Thanks anyway!
Old 10-09-2008, 10:06 PM   #4
Senior Member
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,366

Rep: Reputation: 835Reputation: 835Reputation: 835Reputation: 835Reputation: 835Reputation: 835Reputation: 835
If you want a 64-bit Slackware with 32-bit compatibility, give Slamd64 a try. Bluewhite64 is a 64-bit port (if you can call it a port -- it differs from Slackware quite a bit), but WITHOUT 32-bit compatibility (as far as I know -- though this may have changed as of late). Slamd64 is more similar to a direct 64-bit port (and some prefer it for political reasons -- do a search if you want more information about that), and if I were to switch, that's the distro I would use. Slamd64 does seem to get updated a lot slower than Bluewhite64, though. However, regular 32-bit Slackware works fine for me without any 32-bit compatibility issues (for obvious reasons), so I see no need to switch -- yet.

As for compiling 64-bit stuff, if you do need a 64-bit gcc etc., you would need to do the circular copmilation technique, as far as I know -- but I haven't played with this stuff so I am probably dead wrong. If you do need to build circularly, it's a lot of effort.
Old 10-10-2008, 03:08 AM   #5
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,873

Rep: Reputation: 553Reputation: 553Reputation: 553Reputation: 553Reputation: 553Reputation: 553
The kernel doesn't care whether applications are 32 bit or 64 bit. The applications depend on whether glibc is 32bit or 64bit. Since the kernel doesn't need or use any external libs, it doesn't care.
Creating a 64bit system is whole 'nother matter. but if all you want is 64bit optimization for your kernel, just select the appropriate arch and recompile.
Old 10-10-2008, 05:18 AM   #6
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
I don't think there's much use in compiling a 64-bit kernel for a 32-bit system. Just install slamd64, it's an unofficial port of Slackware to 64-bit with multilib support, meaning it can run 32-bit apps too.
Old 10-10-2008, 12:10 PM   #7
Petri Kaukasoina
Registered: Mar 2007
Posts: 262

Rep: Reputation: 107Reputation: 107
I run a x86_64 kernel on my pentium 4 with Slackware-current (normal 32-bit userspace). I just build the kernel on another system (x86_64 Centos). CONFIG_IA32_EMULATION=y is needed in the kernel config.

Maybe its merits are questionable but at least no HIMEM is needed: all memory is readily accessible with 64 address bits. I also installed a 64-bit version of Matlab (plus some 64-bit shared libraries for Matlab in /lib64 which I copied from Centos). And, some number crunching fortran and C programs were a bit faster (6-11 %) as x86_64 binaries vs. x86_32.
Old 10-10-2008, 03:36 PM   #8
Registered: Feb 2008
Location: Netherlands, Zeeland
Distribution: Slackware64 current multilib, Gentoo
Posts: 41

Original Poster
Rep: Reputation: 18
Thanks for all the answers!
It's getting more clear to me.
I'll try kernel compiling with 64bits arch supporting. I want to stay on Slack and not to go to Slamd64, because Slamd64 gave me some problems with the Intel processor. (I never buy an Intel anymore, but that's an other story...)
Thanks again, greetings, Henkees.


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
How to compile 32bit .c .cc On 64bit x86_64 systems? Leo Park Linux - Software 4 01-09-2008 11:57 PM
x86_64 library compile problem zypo Fedora 1 10-10-2005 05:46 AM
kernel compile on x86_64 fails acidjuice Linux - Software 1 05-06-2005 05:30 PM
Compile errors on x86_64 SUSE marsonist Linux - Software 5 05-20-2004 06:21 PM
Can't get kernel to compile as x86_64 arch... Electrode Linux - Software 22 12-18-2003 10:11 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:39 AM.

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