LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-01-2018, 12:43 PM   #1
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,960

Rep: Reputation: 271Reputation: 271Reputation: 271
Can I build a 64-bit kernel while in 32-bit?


I run 32-bit. I changed .config to built 64-bit. It errors out complaining about stackprotector support. Can I do this or must I download a built kernel?
 
Old 06-01-2018, 02:04 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
multilib and using -m64 is what I found on the question, compiling 64bit on a 32bit platform.
 
Old 06-01-2018, 07:33 PM   #3
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,960

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by BW-userx View Post
multilib and using -m64 is what I found on the question, compiling 64bit on a 32bit platform.
I don't understand this answer. Those are gcc switches. I suspect that building in 64-bit may require 64-bit libraries to build with, perhaps other 64-bit support.
 
Old 06-01-2018, 08:15 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by RandomTroll View Post
I don't understand this answer. Those are gcc switches. I suspect that building in 64-bit may require 64-bit libraries to build with, perhaps other 64-bit support.
let me check real quick, yep this is a Linux Forum, Linux default compiler is gcc. so yes, you need multilib and directive to tell it to compile for 64bit hence

multilib and using -m64

How much more plain can I get?

Last edited by BW-userx; 06-01-2018 at 08:18 PM.
 
Old 06-02-2018, 12:57 AM   #5
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,960

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
When I add -m64 to HOSTCFLAGS in the kernel's Makefile, cc1 tells me 64-bit mode isn't compiled in.


I don't find 'multilib' in the kernel docs. gcc's man page tells me too little to see its purpose.
 
Old 06-02-2018, 07:33 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
What are multilib? Your lack in understanding basic terminology is the programming arena does cast a shadow on your ability to grasp basic things relating to programming in general. Research what is multilib, or what does a multilib system consists of? Not the kernel specifically.
 
Old 06-02-2018, 12:18 PM   #7
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
With certain versions of gcc and certain versions of debian-based distros, configuring stack protection to anything but 'none' breaks the build.
 
Old 06-02-2018, 01:42 PM   #8
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
You can't build the Linux kernel without a specific toolchain for the target system. The README file in the top level source directory will point you to the build requirements. Although it is technically possible to build on a 32-bit system, I think it will be much easier to boot a 64-bit live distro and do it from there.
 
Old 06-03-2018, 09:14 PM   #9
X-LFS-2010
Member
 
Registered: Apr 2016
Posts: 510

Rep: Reputation: 58
Quote:
Originally Posted by RandomTroll View Post
I run 32-bit. I changed .config to built 64-bit. It errors out complaining about stackprotector support. Can I do this or must I download a built kernel?
there's a "stack canary" option you could try turning off

(i first saw that in win95 visual c++ 6.0 release. it's from microsoft. i wouldn't use it if you paid me. it's "speculative" and prevents this: a C program calling Pascal library routiines) (speculative: it checks the return and guesses if the value would be correct. it only is if programs are not allowed to load cross compatible libraries)

how it got in linux in the 2000's, is anyone's guess

HOWEVER - if your building using LFS (copies ubuntu setup kinda), ubuntu or other major distros: you might not get around it. there are many sidewinder "dependancies" built in to those things.

SUMMARY: try the option once if it doesn't work maybe you should get the pre-built one

Last edited by X-LFS-2010; 06-03-2018 at 09:18 PM.
 
Old 06-11-2018, 07:14 AM   #10
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,960

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by smallpond View Post
You can't build the Linux kernel without a specific toolchain for the target system. The README file in the top level source directory will point you to the build requirements.
What exactly is in a toolchain? I assume gcc and its buddies, but what else? Do I need the 64-bit gcc & pals? The README in the kernel source does not point me to the build requirements.

Quote:
Originally Posted by smallpond View Post
Although it is technically possible to build on a 32-bit system, I think it will be much easier to boot a 64-bit live distro and do it from there.
Hmmm... I just booted into 64-bit and get the same stackprotector error.
 
Old 06-15-2018, 09:23 AM   #11
Poison Nuke
Member
 
Registered: Aug 2012
Location: Germany
Posts: 41

Rep: Reputation: Disabled
take a look into tutorials regarding "cross-compilation", that will most likely cover your issue too. But as written it might be easier to create a live-distro on a USB-stick and boot into a real 64bit system. Such a live-distro might come in handy later on (to chroot into the original system in case that anything goes wrong with the new kernel).

A toolchain, as the name implies, is a set of tools used in specific order (chain). For compilation, you need more than one tool like gcc and make and so on. The wording "toolchain" is used in every industry, and does not only mean "software".
 
  


Reply



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
[SOLVED] Linux 4.4 seems to refuse to build IPv6 for the 64-bit build - 32-bit build works fine GameCodingNinja Linux From Scratch 2 02-07-2016 06:40 PM
Build dependency conflict on 32 bit and 64 bit machines sahil.jammu Linux - Newbie 5 10-15-2010 06:27 AM
Mozilla Firefox 64-bit build for Linux with Adobe Flash Player 64-bit integrated silos Linux - Software 4 12-03-2009 07:40 PM
Apache & Tomcat build fine in RHEL5 32-bit, not in 64-bit. Why? jackofalltrades Linux - Newbie 1 10-30-2009 01:07 PM
Can I build 32-bit LFS on a 64-bit AMD system? dhave Linux From Scratch 4 07-23-2007 07:00 PM

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

All times are GMT -5. The time now is 08:38 PM.

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