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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-17-2005, 12:02 AM
|
#1
|
|
Member
Registered: Apr 2004
Distribution: Slackware 10, Open BSD 3.6, Mac OS 10.3.7, Splack 10 beta
Posts: 393
Rep:
|
cross compile
how would i cross compile something on OS X for linux?
|
|
|
|
01-17-2005, 10:31 AM
|
#2
|
|
Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Squeeze, Fedora 14
Posts: 7,268
Rep:
|
"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
|
|
|
|
01-17-2005, 10:34 AM
|
#3
|
|
Senior Member
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990
Rep:
|
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.
|
|
|
|
01-17-2005, 11:23 AM
|
#4
|
|
Member
Registered: Apr 2004
Distribution: Slackware 10, Open BSD 3.6, Mac OS 10.3.7, Splack 10 beta
Posts: 393
Original Poster
Rep:
|
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.
|
|
|
|
01-17-2005, 01:43 PM
|
#5
|
|
Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Squeeze, Fedora 14
Posts: 7,268
Rep:
|
"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
|
|
|
|
01-19-2005, 05:31 PM
|
#6
|
|
Member
Registered: Apr 2004
Distribution: Slackware 10, Open BSD 3.6, Mac OS 10.3.7, Splack 10 beta
Posts: 393
Original Poster
Rep:
|
-mcall-linux doesn't work and isn't in the man pages.
|
|
|
|
01-19-2005, 07:37 PM
|
#7
|
|
Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Squeeze, Fedora 14
Posts: 7,268
Rep:
|
"-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
|
|
|
|
01-20-2005, 08:23 PM
|
#8
|
|
Member
Registered: Apr 2004
Distribution: Slackware 10, Open BSD 3.6, Mac OS 10.3.7, Splack 10 beta
Posts: 393
Original Poster
Rep:
|
i was reading the OSX gcc man pages. That could explain it.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:51 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|