Forum > macOS / Mac OS X

MacOS. x86_64 to aarch64

(1/2) > >>

Как мне скомпилировать на MacOS из архитектуры x86_64 в архитектуру aarch64?

Я установил кросс-компилятор aarch64-darwin. Но ни какие опции (MacOS+aarch64 / darwin+aarch64 / default+aarch64) не позволяют мне скомпилировать проект под MacOS-aarch64.
Прерывается, как я понимаю, на стадии сборки проекта.

Google translate:
How can I compile on MacOS from x86_64 architecture to aarch64 architecture?

I installed the aarch64-darwin cross compiler. But none of the options (MacOS+aarch64 / darwin+aarch64 / default+aarch64) allow me to compile the project under MacOS-aarch64.
It is interrupted, as I understand it, at the project assembly stage.

--- Quote ---Error: ld: symbol(s) not found for architecture arm64
--- End quote ---

Есть хотя бы варианты, по какой причине, я не могу собрать проект под ARM процессоры дл MacOS?
Может из-за того, что я использую High Sierra? И сборка полностью зависит от версии Xcode?

Неужели ни кто не собирает кроссплатформенные приложения на MacOS?

Google translate:
There are at least options, for what reason, I can not build a project for ARM processors for MacOS?
Maybe because I'm using High Sierra? And the build is completely dependent on the Xcode version?

Really no one collects cross-platform applications on MacOS?

Я оказался прав. ld лезет в Xcode, а XCode у меня 10-й. Для поддержки кросскомпиляции под ARM нужен Xcode >= 12.2.
Если я не прав и есть решение, просьба поправить.

Google translate:
I turned out to be right. ld climbs into Xcode, and I have XCode 10th. To support cross-compilation under ARM, Xcode >= 12.2 is required.
If I'm wrong and there is a solution, please correct me.

I always debug using the FPC compiler for the native architecture. However, for distribution I use LLVM and use `lipo` to create a universal binary that supports both aarch64 and x86:

--- Code: ---APPNAME=myApp
lazbuild -B --compiler=~/fpcllvm86/lib/fpc/3.3.1/ppcx64 --ws=cocoa  --cpu=x86_64 ${LPR_PTH}/${APPNAME}.lpi
strip ${LPR_PTH}/${APPNAME}X86

lazbuild -B --compiler=~/fpcllvm86/lib/fpc/3.3.1/ppca64 --ws=cocoa  --cpu=aarch64 ${LPR_PTH}/${APPNAME}.lpi

lipo -create -output ${LPR_PTH}/${APPNAME} ${LPR_PTH}/${APPNAME}ARM ${LPR_PTH}/${APPNAME}X86
--- End code ---

You can use the `file` command to check the architecture of your executable, with a Universal binary listing more than one, e.g.

--- Code: ---file ./MRIcroGL
./MRIcroGL: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
./MRIcroGL (for architecture x86_64): Mach-O 64-bit executable x86_64
./MRIcroGL (for architecture arm64): Mach-O 64-bit executable arm64
--- End code ---

For details on getting Lazarus projects to compile with LLVM, see

[Edited to add code tags]

@ChrisR, This forum does not use mark down formatting.

It would be nice if it did, and it is annoying (the forum is annoying) that it does not...

(This is the forum's fault, not yours...)

Please put your code in between code tags. See the # mark button in the forum post editing tool bar area. It creates the code tags for you.

The tags created are an opening and closing code tag set.

// your code goes here

Do not modify what is between[and]but you can change the pascal to some other language (such as shell or text) if applicable.

In your case @ChrisR, shell  :D


[0] Message Index

[#] Next page

Go to full version