Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > GCC4 compiling for G5 on a G4 machine?

GCC4 compiling for G5 on a G4 machine?
Thread Tools
chboss
Fresh-Faced Recruit
Join Date: May 2005
Location: Switzerland
Status: Offline
Reply With Quote
Jul 31, 2005, 12:02 PM
 
Hello all


I have a question regarding compiliation using GCC 4 that comes with the latest Xcode tools 2.1:

I use a G4 based mac running "Tiger" 10.4.2 to build a binary on the command line.
So far I have been sucessfull when using -mcpu=G4 or -mcpu=7450
Now I would like to build an optimized binary for the G5. I use the same optimization flags execpt: -mcpu=G5.

But I always get an error message during configuration that I should use --host if I want to cross compile?
I expected that compiling for a G5 processor on a G4 based hardware should be no problem since it is the same operating system....


Any help or pointer to some information how to solve this problem is appreciated.

Chris
Chris Bosshard
www.bosshard-ch.net
     
szymczyk
Fresh-Faced Recruit
Join Date: Aug 2005
Status: Offline
Reply With Quote
Aug 3, 2005, 06:51 PM
 
If you want to build a 64-bit binary for the G5, you must tell the compiler to build for the 64-bit PowerPC architecture. The command-line setting to use is ARCHS, and the value to use is ppc64.

If you just want the code to run best on a G5, you can use the -mtune setting. The -mtune setting schedules the instructions so they run fastest on the processor you specify.
Mark Szymczyk
Author, Xcode Tools Sensei
http://www.meandmark.com
     
Detrius
Professional Poster
Join Date: Apr 2001
Location: Asheville, NC
Status: Offline
Reply With Quote
Aug 6, 2005, 12:50 AM
 
Originally Posted by szymczyk
If you want to build a 64-bit binary for the G5, you must tell the compiler to build for the 64-bit PowerPC architecture. The command-line setting to use is ARCHS, and the value to use is ppc64.

If you just want the code to run best on a G5, you can use the -mtune setting. The -mtune setting schedules the instructions so they run fastest on the processor you specify.

If you are using Xcode, you would manually enter ppc and ppc64 as the platforms to compile for--instead of ppc and i386. See 'man 3 arch' for a list of the supported architectures.
ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
   
 
Forum Links
Forum 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 On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 12:50 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,