Recent

Author Topic: Cross compiling question intel and powerpc  (Read 26872 times)

freddynerk

  • Jr. Member
  • **
  • Posts: 96
Cross compiling question intel and powerpc
« on: August 09, 2009, 01:29:15 pm »
I am trying to cross - compile an on an itel mac to powerpc.
I wrote a simple 'Hello World'
In The Compiler options I selected
Target Darwin
CPU powerpc
processor as Default.

After compiling the app it works on the intel machine.
Is this correct or did I compile this as an Intel program?

Thanks

Tom

laguna

  • Sr. Member
  • ****
  • Posts: 323
Re: Cross compiling question intel and powerpc
« Reply #1 on: August 09, 2009, 02:02:50 pm »
   
I do not know, but we can do a test, send me an application in private testing, the cause and you do know.

by

freddynerk

  • Jr. Member
  • **
  • Posts: 96
Re: Cross compiling question intel and powerpc
« Reply #2 on: August 09, 2009, 02:25:30 pm »
HI Laguna,
Send me an email to tduncan@connexus.net.au

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Cross compiling question intel and powerpc
« Reply #3 on: August 09, 2009, 03:16:33 pm »
After compiling the app it works on the intel machine.
Is this correct or did I compile this as an Intel program?
It's normal. Apple's special tool to user PowerPC applications on Intel machines.
http://en.wikipedia.org/wiki/Rosetta_(binary_translation_software)

"the most amazing software you'll never see"


If you're unsure about application arch, you can use 'otool' or 'lipo' tools to learn it, i.e.

lipo -info applicaiton_name

freddynerk

  • Jr. Member
  • **
  • Posts: 96
Re: Cross compiling question intel and powerpc
« Reply #4 on: August 09, 2009, 03:31:28 pm »
Tried lipo and it came up with i386.
Need to look more into how to set the Compiler options
Darwin
powerpc
Default

Is this all I need to do?

Tom

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Cross compiling question intel and powerpc
« Reply #5 on: August 09, 2009, 03:32:57 pm »
yes. it's enough.

though you don't need to specify 'darwin' as it's used by default.

freddynerk

  • Jr. Member
  • **
  • Posts: 96
Re: Cross compiling question intel and powerpc
« Reply #6 on: August 09, 2009, 03:42:38 pm »
Any ideas what I should do next.
All the application has is a form with a label.
After a run/Build All then test with lipo result is i386 still.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Cross compiling question intel and powerpc
« Reply #7 on: August 09, 2009, 03:50:19 pm »
Remove the binary manually and rebuild again.
Maybe this will help.

freddynerk

  • Jr. Member
  • **
  • Posts: 96
Re: Cross compiling question intel and powerpc
« Reply #8 on: August 09, 2009, 03:55:46 pm »
No go.
Deleted all Hello files.
Rebuilt and still got i386.

This cross-compiling idea seemed to be an easy one till I tested it out.
Also with my main program that I really want to compile comes up with an error with Printer4lazarus only when I select PowerPC.

Tom

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Cross compiling question intel and powerpc
« Reply #9 on: August 09, 2009, 03:59:03 pm »
what is the error?
may be you need to recompile LCL and packages for powerpc target?

freddynerk

  • Jr. Member
  • **
  • Posts: 96
Re: Cross compiling question intel and powerpc
« Reply #10 on: August 09, 2009, 04:03:55 pm »
had an error.
failed to create application bundle symlink to /powerpc//lazarus

I am new to both the mac and to lazarus.
Most of my work has been with Delphi 7 on XP

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com

Sylvain M

  • New Member
  • *
  • Posts: 12
Re: Cross compiling question intel and powerpc
« Reply #12 on: August 13, 2009, 08:59:42 am »
Hi everybody,

I'm entering this discussion here because I have almost the same problem as freddynerk.
I wanted to cross compile my project to make it work too on another computer using a powerpc. Mine is using an Intel.
I changed the Compiler options->code settings, with (empty), PowerPc and Default, and I still have an Intel file (tested with lipo).
Then I read this page
Please check out this page: http://wiki.lazarus.freepascal.org/Carbon_Interface#Cross-compiling_Intel_to_PowerPC
and tried to rebuild LCL units (even if I installed Lazarus and FPC from .dmg), and nothing changes, still i386.

In the Compiler->code settings, when I click the Test button, I first have a warning telling me that there is a ppu file older than the Compiler itself : usr/local/lib/fpc2.2.2/units/i386-darwin/rtl/system.ppu

then if I ignore it, I have 14 warnings telling me that many   ppu exists twice.
Could it be the origin of my problem ?

And finally, can someone tell me if there is any compatibility between 10.3 and 10.4 ?
I mean, is there any chance that the program I wrote on os 10.4.11 works on a computer using 10.3.9 ?
« Last Edit: August 13, 2009, 09:12:06 am by Sylvain M »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Cross compiling question intel and powerpc
« Reply #13 on: August 18, 2009, 10:06:36 pm »
And finally, can someone tell me if there is any compatibility between 10.3 and 10.4 ?
I mean, is there any chance that the program I wrote on os 10.4.11 works on a computer using 10.3.9 ?
It's possible, there're some people, who already compiled for 10.3.9 OS X.
But this would require changes in MacOSAll unit, and LCL units as well.

These changes cannot be accepted by both teams, so officially there would be no support for 10.3 OSX.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Cross compiling question intel and powerpc
« Reply #14 on: August 18, 2009, 10:10:47 pm »
about ppc compiling:
* remove the application binary first
* remove project's .o and .ppu files
* make sure you have powerpc specified as CPU target
* compile

 

TinyPortal © 2005-2018