Forum > macOS / Mac OS X

Cross compiling from OSX 10.11 El Capitan / x86_64 to other CPU driven OSX-es

(1/3) > >>

TCH:
I would like to know, how can i cross-compile for ARM64, i386, PowerPC and PowerPC64. Currently:

- AMD64: Works perfectly.
- ARM64: Seems to work, the executable is created, but of course i cannot run it. Any ideas how to test, if that worked?
- i386: Error: ld: framework not found Cocoa Does it need a 32-bit version of Cocoa? Or maybe for i386, Carbon is the choice? If i set the widgetset to Carbon, then: Error: ld: framework not found Carbon Any idea what to do?
- PowerPC / PowerPC64: An error dialog saying fpc does not suppot powerpc-darwin / powerpc64-darwin. This is where FPC Deluxe comes into the picture? How? Any tutorials, tops on that?

Thanks in advance.

Jonas Maebe:

--- Quote from: TCH on October 10, 2023, 09:12:26 pm ---I would like to know, how can i cross-compile for ARM64, i386, PowerPC and PowerPC64. Currently:

- AMD64: Works perfectly.
- ARM64: Seems to work, the executable is created, but of course i cannot run it. Any ideas how to test, if that worked?

--- End quote ---
Only by running the binary on an ARM64 Mac. I'm not sure how you are compiling for ARM64 on a standard install of OS X 10.11/El Capitan though. It does not come with an SDK for macOS/ARM64. Maybe you meant macOS 11.0 instead?


--- Quote ---- i386: Error: ld: framework not found Cocoa Does it need a 32-bit version of Cocoa? Or maybe for i386, Carbon is the choice? If i set the widgetset to Carbon, then: Error: ld: framework not found Carbon Any idea what to do?

--- End quote ---
If you are using macOS 11.0: that OS no longer comes with 32 bit libraries since it doesn't support 32 bit binaries. Install an SDK for macOS 10.14 or earlier from https://github.com/phracker/MacOSX-SDKs/releases and point FPC to it using the -XR command line parameter when compiling for i386
If you are using OS X 10.11: this suggests you did not install the command line tools as instructed in the "Getting Started" document shipped with the FPC installer and as mentioned on the download pages for FPC (e.g. https://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/3.2.2/ ). After installing them, reinstall FPC.


--- Quote ---- PowerPC / PowerPC64: An error dialog saying fpc does not suppot powerpc-darwin / powerpc64-darwin. This is where FPC Deluxe comes into the picture? How? Any tutorials, tops on that?

--- End quote ---
There are official FPC cross-compilers for those targets on the download pages. Additionally, you will need an SDK that still supports those architectures (e.g. the 10.4u or 10.5 SDKs from https://github.com/phracker/MacOSX-SDKs/releases ), and you will need Xcode command line tools that support those architectures (and then tell FPC where to find them with the -FD command line parameter). I don't know where you can still find those. They used to be distributed in packages called "cctools-old".

TCH:

--- Quote from: Jonas Maebe on October 10, 2023, 09:32:24 pm ---Only by running the binary on an ARM64 Mac. I'm not sure how you are compiling for ARM64 on a standard install of OS X 10.11/El Capitan though. It does not come with an SDK for macOS/ARM64. Maybe you meant macOS 11.0 instead?
--- End quote ---
I meant OSX 10.11. I do not know, how the ARM64 binary was built, but it was built. I do not know if it is OK, or not.
--- Quote from: Jonas Maebe on October 10, 2023, 09:32:24 pm ---If you are using OS X 10.11: this suggests you did not install the command line tools as instructed in the "Getting Started" document shipped with the FPC installer and as mentioned on the download pages for FPC (e.g. https://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/3.2.2/ ). After installing them, reinstall FPC.
--- End quote ---
I did install the command line tools via xcode-select --install and it installed them, they are in Library/Developer/CommandLineTools. I tried to do sudo xcodebuild -license accept too, but it gave me back the error message of:
--- Code: ---xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
--- End code ---
If that was not the way it should be done, then i am open to suggestion how to properly install XCode 8.2.1. I cannot make an Apple ID, because it requires a phone number. Red flag.

But nowhere else i could find it. I've only found one torrent file, but no one seeds that.
--- Quote from: Jonas Maebe on October 10, 2023, 09:32:24 pm ---There are official FPC cross-compilers for those targets on the download pages. Additionally, you will need an SDK that still supports those architectures (e.g. the 10.4u or 10.5 SDKs from https://github.com/phracker/MacOSX-SDKs/releases ), and you will need Xcode command line tools that support those architectures (and then tell FPC where to find them with the -FD command line parameter). I don't know where you can still find those. They used to be distributed in packages called "cctools-old".
--- End quote ---
Thanks, i'll look into this deeper.

TCH:
Okay, i retract this and apologise. It seems that somehow my machine updated itself to 11.0 Big Sur... The guy who gave me this laptop installed El Capitan on it. Great. Now i have to downgrade somehow.

dbannon:

--- Quote from: TCH on October 10, 2023, 10:33:09 pm ---Okay, i retract this and apologise. It seems that somehow my machine updated itself to 11.0 Big Sur... The guy who gave me this laptop installed El Capitan on it. Great. Now i have to downgrade somehow.

--- End quote ---
If you downgrade to El Capitan, then you will no be able to build the Arm64 Apple Silicon binary. While I don't know what you are doing, I'd suggest the Apple Silicon binary is a lot more useful to you that the PowerPC or the i386 ones. But of course, you may have your reasons to think otherwise.

If you really need to support those old OS (Apple most certainly does not) then it sounds like a case for Virtual Machines on your Big Sur. You can get the Install kits from Apple Support (anything from 5G to 15G each), convert them to ISO files and use them to install VMs. The i386 one will run on your Mac under Virtual Box but I suggest you will need QEMU to run the PowerPC.  I have run PowerEL QEMU VMs on my reasonably gutsy Linux PC, not sure how you will go on your hardware. You do only need the command line to build but testing is another issue....

Maybe the early Intel OS had support for PowerPC ? It could run PowerPC binaries through an emulator. Be heaps easier if you could run Intel code in Virtual Box.

David

Navigation

[0] Message Index

[#] Next page

Go to full version