LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 02-07-2017, 03:01 AM   #1
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 695

Rep: Reputation: 71
compile 32 bit kernel on 64 bit system


I understand that in x86 land it is possible to use -m32 to compile a 32 bit program on a 64 bit system but that this will not work in an arm environment. Is there anything available the will enable compiling 32bit programs on a 64 bit arm system?
 
Old 02-09-2017, 02:00 AM   #2
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 480
Blog Entries: 13

Rep: Reputation: 43
I don't have any 64bit ARM devices I can play with so this might be irrelevant but this is my thought on the matter:
If you're running 32bit SlackwareARM on a 64bit ARM machine (like the Pi3) I would expect the compiler to build 32bit binaries by default.
If you're running a 64bit Linux ARM distribution on your 64bit ARM machine I'm not sure but -m32 is not valid for ARM architecture (according to my gcc man page) ... maybe there is an equivalent for ARM.
Try plying with the ARM specific options (maybe -march with a 32 bit architecture choice).

Last edited by louigi600; 02-09-2017 at 02:05 AM.
 
Old 02-09-2017, 03:18 PM   #3
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 695

Original Poster
Rep: Reputation: 71
I have a Bananapi M-2 (Sinovoip) that's been sitting around collecting dust for a couple years that I couldn't even give away.Its an A31s not A20. I thought I'd get Slackwarearm up on it and make it into something useful. I've installed Armbian on an sd card fine but that's 64bit. Haven't figured out how to compile a 32bit kernel for it. I thought that I might be able to do that compiling natively on the the Bpi M2 using distcc and the x-toolchain but without having a -m32 equivalent for arm this won't work then again might not work anyway with an equivalent. When I have time again might try setting up a 32 bit cross compiler on my desktop.
 
Old 02-13-2017, 01:28 AM   #4
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 480
Blog Entries: 13

Rep: Reputation: 43
If you choose a 32 bit architecture compatible with where you want it to run on maybe you get what you want.
Code:
-march=name
           This specifies the name of the target ARM architecture.  GCC uses this name to
           determine what kind of instructions it can emit when generating assembly code.
           This option can be used in conjunction with or instead of the -mcpu= option.
           Permissible names are: armv2, armv2a, armv3, armv3m, armv4, armv4t, armv5,
           armv5t, armv5e, armv5te, armv6, armv6j, armv6t2, armv6z, armv6zk, armv6-m,
           armv7, armv7-a, armv7-r, armv7-m, armv8-a, iwmmxt, iwmmxt2, ep9312
This section in wikipedia ARM Architecture article might be helpful in choosing a compatible architecture.
 
Old 02-15-2017, 03:52 PM   #5
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 1,101
Blog Entries: 2

Rep: Reputation: 132Reputation: 132
Do feedback as You proceed, as I figure this will be direly needed down the road with the upcoming 64 Slackware port and I expect it become multilib quite soon?
 
  


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
LXer: How-To: Compile Latest Wine 32-bit on 64-bit Ubuntu (15.10) LXer Syndicated Linux News 0 10-17-2015 03:14 PM
[SOLVED] If I compile from source on 64 bit system will the compiled program be 64 bit? SharpyWarpy Linux - Software 3 08-14-2012 02:59 PM
Unable to compile 64 bit kernel on 64 bit machine even after successful compilation. atulsdeshmukh Linux - Kernel 2 09-18-2009 02:28 AM
Compile 32-bit kernel on a 64-bit machine kushalkoolwal Debian 6 06-15-2009 05:48 PM
how to compile 32 bit kernel on 64bit system slantoflight Linux - General 3 03-15-2006 11:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 08:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration