Welcome to MacForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How to extend Xcode gcc to cross compile - or why does gcc..

 
   Macintosh computer (Home) -> Tools RSS
Related Topics:
Xcode and Cross Platform Dev (cmake,scons) - I'll be setting up a cross plaform project soon and I was wondering if anyone knew of any tools that allowed for cross platform project On Windows, I have visual studio files, on linux I have make files and on mac I'll be..

how to compile "c" program using MPW. - hai how to compile and run program using MPW. -- Direct access to this group with

What should I use to compile Photoshop plugin? - - total newbie, so dumb it down and don't assume** I need to compile some into a photoshop plugin for CS2 on OSX. I have never compiled anything and I don't even know what tools to use. I'm not looking for someone to tell me step..

Cross compiling with intel-linux - I have a very powerfull AMD Opteron machine but only a iMacG5 for software Is it possible to compile my files with gcc 3.4 on Intel Linux ? Anybody ever tried this ?

Cross Platform Music Application - Hi, I'd like to develop a GUI suitable for running on both Mac and WinXP. In the past I've in C#, Visual C++, Python and a little Java. I'm buying a iMac this week and will be running both OS X and Win XP depending on..
Next:  Something like ZoneRanger for OSX?  
Author Message
Dr. Nikolaus Schal

External


Since: Jul 16, 2003
Posts: 5



(Msg. 1) Posted: Fri Dec 05, 2003 3:17 pm
Post subject: How to extend Xcode gcc to cross compile - or why does gcc -
Archived from groups: comp>sys>mac>programmer>tools (more info?)

Hi,
has anybody tried to install additional gcc targets into the Apple
Xcode gcc installation, i.e. to /usr/libexec/gcc?

I have tried to add some /usr/libexec/gcc/linux/arm/.... to plug in an
ARM cross compiler.

Unfortunately, the gcc driver (/usr/bin/gcc - neither gcc2, gcc3 etc.)
seems to ignore the -b option.

So, I get

$ gcc -b linux-arm -V 2.95.2 -v x.m
Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
Apple Computer, Inc. version gcc-938, based on gcc version 2.95.2
19991024 (release)
$

It accepts the -V option and I can change it to use 2.95.2 or 3.1 or
3.3 but not to change from darwin/ppc to linux/arm

Any ideas?

hns

 >> Stay informed about: How to extend Xcode gcc to cross compile - or why does gcc.. 
Back to top
Login to vote
Jim Schimpf

External


Since: Jun 28, 2003
Posts: 163



(Msg. 2) Posted: Sat Dec 06, 2003 5:49 pm
Post subject: Re: How to extend Xcode gcc to cross compile - or why does g [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

hns.RemoveThis@computer.org (Dr. Nikolaus Schaller) wrote in message news:<e5f20ec4.0312051217.4fa28a91.RemoveThis@posting.google.com>...
 > Hi,
 > has anybody tried to install additional gcc targets into the Apple
 > Xcode gcc installation, i.e. to /usr/libexec/gcc?
 >
 > I have tried to add some /usr/libexec/gcc/linux/arm/.... to plug in an
 > ARM cross compiler.
 >
 > Unfortunately, the gcc driver (/usr/bin/gcc - neither gcc2, gcc3 etc.)
 > seems to ignore the -b option.
 >
 > So, I get
 >
 > $ gcc -b linux-arm -V 2.95.2 -v x.m
 > Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
 > Apple Computer, Inc. version gcc-938, based on gcc version 2.95.2
 > 19991024 (release)
 > $
 >
 > It accepts the -V option and I can change it to use 2.95.2 or 3.1 or
 > 3.3 but not to change from darwin/ppc to linux/arm
 >
 > Any ideas?
 >
 > hns


I am very interested in this also. Did you change the target via
Rules tab of the Target <my target> Info window ? It seems to allow a
custom script to handle C source files. Haven't done anything myself
yet, waiting for someone smarter to try it :)

--jim<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: How to extend Xcode gcc to cross compile - or why does gcc.. 
Back to top
Login to vote
David Steuber

External


Since: Dec 21, 2003
Posts: 70



(Msg. 3) Posted: Sun Dec 07, 2003 11:26 am
Post subject: Re: How to extend Xcode gcc to cross compile - or why does g [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

vze35xda.DeleteThis@verizon.net (Jim Schimpf) writes:

 > I am very interested in this also. Did you change the target via
 > Rules tab of the Target <my target> Info window ? It seems to allow a
 > custom script to handle C source files. Haven't done anything myself
 > yet, waiting for someone smarter to try it :)

I come from a Linux environment and did once build GCC from source.
GCC will do cross-target compiling if the options have been compiled
in. You also need the appropriate libraries to link against, IIRC.
I only skimmed the details because I was not building a cross-compile
target at the time.

If you fetch the GCC sources from GNU, you can dig through the docs
and setup a cross compiler. You will be able to compile it with the
GCC that came with XCode. It is probably easier to do this all from
the command line.

I have GCC on a Debian box, so I'm not about to go to all that
trouble ;-). I'll just take my projects and rebuild them on that to
make sure the code will in fact build.

If an easier way to do this is found, let me know. I'm not using
XCode per se. I do plan to take advantage of the interface builder.
But my primary editor is Emacs and it is an IDE.

Good luck.

--
One Emacs to rule them all. One Emacs to find them,
One Emacs to take commands and to the keystrokes bind them,

All other programming languages wish they were Lisp.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to extend Xcode gcc to cross compile - or why does gcc.. 
Back to top
Login to vote
Dr. Nikolaus Schal

External


Since: Jul 16, 2003
Posts: 5



(Msg. 4) Posted: Mon Dec 08, 2003 9:39 am
Post subject: Re: How to extend Xcode gcc to cross compile - or why does g [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 >
 > I am very interested in this also. Did you change the target via
 > Rules tab of the Target <my target> Info window ? It seems to allow a
 > custom script to handle C source files. Haven't done anything myself

I have not tried but seen this. It might work.

What I did also not find yet is any Tab to set the compiler version in
Xcode. Project Builder allowed to do so. It seems to be hard-coded
into Xcode based on the compatibility SDK that is selected (OS X 10.x
needs gcc-2.95.2).

 > yet, waiting for someone smarter to try it :)

In the meantime, I have used the older scheme that was already working
in Project Builder: a makefile that is added as an additional Build
Phase to the Target. The makefile uses all the settings to start the
cross-compiler and linker after building for MacOS X in the 'build'
directory.

The result is published as Zaurus-X-gcc-2.95.3X10.3a1 (please search
at MacUpdate or VersionTracker).

hns<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to extend Xcode gcc to cross compile - or why does gcc.. 
Back to top
Login to vote
Dr. Nikolaus Schal

External


Since: Jul 16, 2003
Posts: 5



(Msg. 5) Posted: Mon Dec 08, 2003 9:44 am
Post subject: Re: How to extend Xcode gcc to cross compile - or why does g [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

David Steuber <david.steuber.DeleteThis@verizon.net> wrote in message news:<m265gtuj9l.fsf.DeleteThis@david-steuber.com>...
 >
 > GCC will do cross-target compiling if the options have been compiled
 > in. You also need the appropriate libraries to link against, IIRC.

The cross-compiler backend and the libraries are already compiled and
available (Zaurs-X-gcc). The missing link is to put it under the
control of the 'gcc' command line driver that I hope is called by
Xcode.

This brings me to an other idea: I could try it vice versa - using the
cross-compiler front-end 'gcc' to call the darwin/ppc compilers if
specified by -b.

 > If an easier way to do this is found, let me know. I'm not using
 > XCode per se. I do plan to take advantage of the interface builder.

I think Interface Builder creates NIB-files that work only with Carbon
or Cocoa frameworks - which must be available/cross-compiled as well.
So I think it can't be used without Xcode at all.

hns<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to extend Xcode gcc to cross compile - or why does gcc.. 
Back to top
Login to vote
Jim Schimpf

External


Since: Jun 28, 2003
Posts: 163



(Msg. 6) Posted: Mon Dec 08, 2003 8:06 pm
Post subject: Re: How to extend Xcode gcc to cross compile - or why does g [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

hns DeleteThis @computer.org (Dr. Nikolaus Schaller) wrote in message news:<e5f20ec4.0312080639.56c5d6c6 DeleteThis @posting.google.com>...
  > >
  > > I am very interested in this also. Did you change the target via
  > > Rules tab of the Target <my target> Info window ? It seems to allow a
  > > custom script to handle C source files. Haven't done anything myself
 >
 > I have not tried but seen this. It might work.
 >
 > What I did also not find yet is any Tab to set the compiler version in
 > Xcode. Project Builder allowed to do so. It seems to be hard-coded
 > into Xcode based on the compatibility SDK that is selected (OS X 10.x
 > needs gcc-2.95.2).

Click the disclosure triangle for the Target (XCode) then pick your
target. Pick Get Info and
you will get a Target <your target Name> Info window. Then pick Rules
and under System C Rule you can Process <type of file> using <here you
pick which type of compiler 3.3,3.1.... or custom script.

 >
  > > yet, waiting for someone smarter to try it :)
 >
 > In the meantime, I have used the older scheme that was already working
 > in Project Builder: a makefile that is added as an additional Build
 > Phase to the Target. The makefile uses all the settings to start the
 > cross-compiler and linker after building for MacOS X in the 'build'
 > directory.
 >
 > The result is published as Zaurus-X-gcc-2.95.3X10.3a1 (please search
 > at MacUpdate or VersionTracker).

Thank you I will look at this.

 >
 > hns<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to extend Xcode gcc to cross compile - or why does gcc.. 
Back to top
Login to vote
Display posts from previous:   
   Macintosh computer (Home) -> Tools All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]