Page 1 of 1
Is it possible to build a universal binary using exported C code?
Posted: Wed Dec 01, 2021 8:33 pm
by mrbungle
For the Mac, is it possible to use the C output and actually import it into XCode and build it as a Universal binary or does there need to be additional work?
Thank you in advance.
Re: Is it possible to build a universal binary using exported C code?
Posted: Thu Dec 02, 2021 9:38 am
by Fred
You should be able to create universal binary using 2 different executables, I don't think you will need XCode
Re: Is it possible to build a universal binary using exported C code?
Posted: Thu Dec 02, 2021 1:56 pm
by mrbungle
I see, so you are saying the ARM version of the Mac PB compiler will do this for you.
Re: Is it possible to build a universal binary using exported C code?
Posted: Thu Dec 02, 2021 2:23 pm
by mk-soft
I don't have a Mac with M1, so I can't compile programmes for M1.
To compile Universal programs, the Purebasic libraries would have to be compiled for Universal as well.
It would be nice to have the option for macOS to compile for Intel, M1 or Universal.
But for this, the Purebasic libraries would also have to be available in Intel, M1 and Universal.
Re: Is it possible to build a universal binary using exported C code?
Posted: Thu Dec 02, 2021 2:40 pm
by mrbungle
Thank you for clarifying. Happy to see that PB 6 is in beta for the M1. I don't have an M1 either but I am due for a computer upgrade later next year.
Re: Is it possible to build a universal binary using exported C code?
Posted: Thu Dec 02, 2021 5:27 pm
by mk-soft
mrbungle wrote: Thu Dec 02, 2021 2:40 pm
Thank you for clarifying. Happy to see that PB 6 is in beta for the M1. I don't have an M1 either but I am due for a computer upgrade later next year.
There will be no upgrade for the time being, as I still need Intel. Virtualisation of Windows and Linux via Parallels.
My Mac Mini 2018 will have to stay with me for a very long time.
Info:
If you have a Mac with M1, you can install both PB v6.00 versions and compile them for Intel and M1.
Re: Is it possible to build a universal binary using exported C code?
Posted: Thu Dec 02, 2021 6:37 pm
by Bitblazer
Does anybody have experience with one of the virtual M1 server offers already? See for example
https://www.computerworld.com/article/3 ... -hour.html
Re: Is it possible to build a universal binary using exported C code?
Posted: Fri Dec 03, 2021 10:13 am
by Fred
I didn't tried yet, but according to this article, you should be able to create an universal binary with the lipo tool:
https://developer.apple.com/documentati ... cos-binary
Code: Select all
lipo -create -output universal_app x86_app arm_app
Re: Is it possible to build a universal binary using exported C code?
Posted: Sun Dec 05, 2021 8:50 am
by fsw
If you have a Mac with M1, you can install both PB v6.00 versions and compile them for Intel and M1.
Would be nice to have 1 PB install but a compiler switch for all 3 binaries (Intel/AppleARM/Universal).
Re: Is it possible to build a universal binary using exported C code?
Posted: Sun Dec 05, 2021 8:37 pm
by deseven
mk-soft wrote: Thu Dec 02, 2021 5:27 pmThere will be no upgrade for the time being, as I still need Intel. Virtualisation of Windows and Linux via Parallels.
My Mac Mini 2018 will have to stay with me for a very long time.
Well, Parallels 16 and 17 fully support M1 and you can install both Windows and Linux with it. ARM versions only, of course, but ARM version of Windows can run x86 executables just fine, some people even manage to game that way with a pretty decent experience, even on the slowest MacBook Air (for example
check out this). I'd say you should be able to safely migrate to the new architecture in a couple of years without losing anything important.
(sorry for the off-topic)