Recent

Author Topic: Lazarus and FPC on macOS Big Sur 11  (Read 3074 times)

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1406
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #30 on: December 10, 2020, 12:18:30 pm »
That is good news ! Thanks again.

I have uploaded 2 new pre-release versions of up for Darwin AMR64.
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/1.8.2g/fpcupdeluxe-aarch64-darwin-cocoa-signed.zip
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/1.8.2g/fpcupdeluxe-aarch64-darwin-cocoa.zip

If one of these work, the settings panel is enabled and the -XR option is added.

I have also uploaded an non-signed bootstrapper. Meaning: it will be found and downloaded; it will not run until signed.

Note:
The binaries are signed on my Windows PC. And that will most definitely be not enough I guess. But worth a try.

MiR

  • Full Member
  • ***
  • Posts: 188
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #31 on: December 10, 2020, 12:56:33 pm »
Starting both new builds via Finder still does not work, I still have to resort to Terminal to run fpcupdeluxe.

Also the ppca64 does not work, I had to replace it with a symlink to my own build.

But the rest is fixed, the rest worked like a charm....

One question: do you use xcrun to detect commandline tools as I wrote? Hardcoding it will not work for users that have full XCode install, for them the path is different (You can check in the 'building fpc for m1' Article mentioned above, there the path for XCode is used.)

Can you send me your steps for code-signing? Perhaps I do a lucky punch and find something.....

Thank you for your great tool,

Michael

One more thing: When you feel really bored, would it be possible to add an option to do a distclean after build of fpc and lazarus? That saves a little space and as I bought the mac with only 256GB of flash free memory fades away faster than snow in the sun....

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1406
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #32 on: December 10, 2020, 01:09:44 pm »
@MiR

Yes, xcrun is used to get the SDK path.

About codesigning and cross-building for arm64. Its not easy to cross towards this new target. Have a look here:
https://github.com/LongDirtyAnimAlf/ld64-msys
https://github.com/LongDirtyAnimAlf/libtapi-msys
I had to make and use the above two repo's to be able to compile Apple's clang12 together with libtapi, blocks, the custom linker LD64 and tools on Windows and Linux.
Inside the LD-repo there is this:
https://github.com/LongDirtyAnimAlf/ld64-msys/tree/master/ldid
Explain:
http://iphonedevwiki.net/index.php/Ldid
So, codesigning on a non-Darwin system will always be very tricky and 90% guaranteed NOT to work.
I do not have a developer-id, as being a Windows guy.

MiR

  • Full Member
  • ***
  • Posts: 188
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #33 on: December 10, 2020, 02:18:14 pm »
I may have found a partial solution:

codesign --force --deep -s - ppca64

makes the bootstrap compiler work for me, worst case fpcupdeluxe could do that step after downloading fpcbootstrap

codesign --force --deep -s - fpcupdeluxe-aarch64-darwin-cocoa.app

also works for your unsigned build, with your signed build I get an exception when starting but nevertheless the code also starts.

Question is now if it could be acceptable for you to run this codesign step from within a vm and, of course, if this adhoc signature works on all devices or only on the device where it was issued.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1406
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #34 on: December 10, 2020, 02:22:16 pm »
AFAIK, the "-s -" means (self-)signing for your machine only.
But again, I do not know that much about Mac: only a VM with OSX.
Codesigning the bootstrapper after download might be a nice trick however !

MiR

  • Full Member
  • ***
  • Posts: 188
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #35 on: December 10, 2020, 02:35:01 pm »
Also, when reading more on ldid and browsing through the source I started doubting if this tool will ever work, reason is that in this article:

http://iphonedevwiki.net/index.php/Code_Signing

they say:

jailbreaks patch the signature verification out of the kernel.

and when I read the ldid code correctly they are creating a self-signed certificate and as this is not in apple's trust chain it will likely not have any real value. (I might of course read the sources wrongly, I did not spend too much time on this).

MiR

  • Full Member
  • ***
  • Posts: 188
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #36 on: December 10, 2020, 02:36:59 pm »
Can you please codesign the compiler on github, then I can see if it works on my computer.....

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1406
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #37 on: December 10, 2020, 04:03:52 pm »
Signed:
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/bootstrappers_v1.0/fpcup-3_3_1-aarch64-darwin-ppca64

I have included a screenshot of the signing process. As you can see, this process runs well.

MiR

  • Full Member
  • ***
  • Posts: 188
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #38 on: December 10, 2020, 04:59:34 pm »
MacOS seems to disagree:

Your binary (some output of copdesign deleted):
Code: [Select]
codesign --display --verbose fpcup-3_3_1-aarch64-darwin-ppca64
fpcup-3_3_1-aarch64-darwin-ppca64: no signature
TeamIdentifier=not set

My binary, signed with adhoc cert:
Code: [Select]
Signature=adhoc
TeamIdentifier=not set

Your Binary, signed with my Developer-ID:
Code: [Select]
Signature size=8973
TeamIdentifier=4S7HMLQE4Z

I have uploaded both a signed version of the compiler and the whole package here:

http://temp.michael-ring.org/fpcup-3_3_1-aarch64-darwin-ppca64.zip
http://temp.michael-ring.org/fpcupdeluxe-aarch64-darwin-cocoa.zip

You can use my signed version for the compiler on github if you want as it will (hopefully) not need to get rebuilt often, I have also uploaded a signed version of fpcupdeluxe, perhaps some other guy can check it on his M1 system, after signing it I did not need to replace the compiler in fpcbootstrap, but this could be some caching or other strange effect on my system as I have played around a lot with signatures today.


DonAlfredo

  • Hero Member
  • *****
  • Posts: 1406
Re: Lazarus and FPC on macOS Big Sur 11
« Reply #39 on: December 10, 2020, 05:16:29 pm »
Thanks very much for your help with testing and the signed binaries. I will upload them.
Behind the screens, another user has also been very helpful reaching this target: adderthorn. I would like to thank him also.

 

TinyPortal © 2005-2018