LinuxQuestions.org
Review your favorite Linux distribution.
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 01-17-2005, 12:02 AM   #1
zaicheke
Member
 
Registered: Apr 2004
Distribution: Slackware 10, Open BSD 3.6, Mac OS 10.3.7, Splack 10 beta
Posts: 393

Rep: Reputation: 30
cross compile


how would i cross compile something on OS X for linux?
 
Old 01-17-2005, 10:31 AM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,528

Rep: Reputation: 178Reputation: 178
"how would i cross compile something on OS X for linux"

Use gcc. Pass gcc two options. For the OS pass it:
-mcall-linux
For the CPU pass it the name of the target CPU. For example:
-mcpu=i386
for an Intel cpu.

Look at the target section of man gcc to find out all of the options available to describe the CPU and architecture of the target machine.

----------------------------
Steve Stites
 
Old 01-17-2005, 10:34 AM   #3
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
You may/will also need to compile libc for a Linux target, or at least get the header files onto the OS X computer, before you can compile any “real” code.
 
Old 01-17-2005, 11:23 AM   #4
zaicheke
Member
 
Registered: Apr 2004
Distribution: Slackware 10, Open BSD 3.6, Mac OS 10.3.7, Splack 10 beta
Posts: 393

Original Poster
Rep: Reputation: 30
where do i put those options. In the makefile or is there an environmental variable for gcc options.

Last edited by zaicheke; 01-17-2005 at 11:28 AM.
 
Old 01-17-2005, 01:43 PM   #5
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,528

Rep: Reputation: 178Reputation: 178
"where do i put those options. In the makefile or is there an environmental variable for gcc options."

They are parameters to the gcc command. Your gcc command is probably in a make file so create a version of your make file with the cross compile options on the gcc command.

---------------------------
Steve Stites
 
Old 01-19-2005, 05:31 PM   #6
zaicheke
Member
 
Registered: Apr 2004
Distribution: Slackware 10, Open BSD 3.6, Mac OS 10.3.7, Splack 10 beta
Posts: 393

Original Poster
Rep: Reputation: 30
-mcall-linux doesn't work and isn't in the man pages.
 
Old 01-19-2005, 07:37 PM   #7
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,528

Rep: Reputation: 178Reputation: 178
"-mcall-linux doesn't work and isn't in the man pages."

It is in my man pages with the explanation:
-mcall-linux
On System V.4 and embedded PowerPC systems compile code for the Linux-based GNU system.

Which, on reading it again, I agree probably will not work on OS-X.

------------------------
Steve Stites
 
Old 01-20-2005, 08:23 PM   #8
zaicheke
Member
 
Registered: Apr 2004
Distribution: Slackware 10, Open BSD 3.6, Mac OS 10.3.7, Splack 10 beta
Posts: 393

Original Poster
Rep: Reputation: 30
i was reading the OSX gcc man pages. That could explain it.
 
  


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
How can I cross compile the kernel? Basel Slackware 5 09-07-2005 06:23 AM
How to cross compile? jiyun0121 Linux - General 3 09-01-2005 06:15 PM
cross compile for i686 Law1213 Linux - Software 2 06-20-2005 08:36 PM
Qt Cross Compile werewolfolondon Linux - Software 2 02-25-2005 01:01 PM
How to cross-compile? karfei00 Linux - Laptop and Netbook 2 06-03-2004 09:56 AM


All times are GMT -5. The time now is 06:56 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration