Recent

Author Topic: Fpcupdeluxe  (Read 819855 times)

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Fpcupdeluxe
« Reply #1725 on: December 08, 2020, 10:00:26 pm »
You can do two things:
1: copy the qt5 libs from the fpcupdeluxe zip into the Lazarus directory
2: cross-compile your app from Windows or Linux towards Haiku. Note: fpcupdeluxe itself is cross-compiled.

BlackShark

  • New Member
  • *
  • Posts: 28
    • BlackShark
Re: Fpcupdeluxe
« Reply #1726 on: December 09, 2020, 12:47:38 pm »
Hi guys!
When compiling in host system Windows for Linux I have got the next:
"Debug: C:\fpcupdeluxe\cross\bin\aarch64-linux\aarch64-linux-gnu-ld.exe: cannot find /lib/ld-linux-aarch64.so.1"
"...Export.Exel.lpr(31,0) Error: Error while linking"

Path "c:\fpcupdeluxe\cross\lib\aarch64-linux\" was set in the project settings where there is ld-linux-aarch64.so.1.
What do I need to do to make it work?

Thanks.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Fpcupdeluxe
« Reply #1727 on: December 09, 2020, 01:28:13 pm »
AFAIK, you are trying to cross-compile a library. Perhaps as part of your project.
Cross-linking a library will fail.
See: https://bugs.freepascal.org/view.php?id=36506

A path for FPC stable is available:
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/blob/master/patchfpc/fpcpatch_linux_linker.patch

On FPC trunk this error can be circumvented by adding:
{$linklib c}
into your library source.

However !
Look closely at the bug-report.
FPC devs have their advice on how to accomplish this.

MiR

  • Sr. Member
  • ****
  • Posts: 250
Re: Fpcupdeluxe
« Reply #1728 on: December 10, 2020, 01:37:06 am »
@DonAlfredo: My Macbook Air M1 arrived today, second thing I tried was running fpcupdeluxe, but it fails (1.8.2f) Is there a way I can help to make it work?

Starting it from Bundle gives a message that I do not have enough rights to start the app, direct start gives this:

Error:
./fpcupdeluxe-aarch64-darwin-cocoa.app/Contents/MacOS/fpcupdeluxe-aarch64-darwin-cocoa
zsh: killed

sudo dtruss ./fpcupdeluxe-aarch64-darwin-cocoa.app/Contents/MacOS/fpcupdeluxe-aarch64-darwin-cocoa
dtrace: system integrity protection is on, some features will not be available

dtrace: failed to execute ./fpcupdeluxe-aarch64-darwin-cocoa.app/Contents/MacOS/fpcupdeluxe-aarch64-darwin-cocoa: Malformed Mach-o file

Michael
« Last Edit: December 10, 2020, 01:40:28 am by MiR »

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2023
  • Former Delphi 1-7, 10.2 user
Re: Fpcupdeluxe
« Reply #1729 on: December 10, 2020, 03:12:01 am »
@MIR: Did you do the  CTRL-CLICK dance to bypass Gatekeeper? The fact  fpcupdeluxe-aarch64-darwin-cocoa was being killed suggests not.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Fpcupdeluxe
« Reply #1730 on: December 10, 2020, 06:19:26 am »
@MiR
A wrong binary was uploaded by me. Please download fpcupdeluxe-aarch64-darwin-cocoa again. It should work !
Please note: aarch64-darwin is still work-in-progress.

Edit:
Another upload for darwin arm64 is also available.
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/1.8.2f/fpcupdeluxe-aarch64-darwin-cocoa-cross.zip
It has been codesigned on my Windows PC. Would be interesting to know if this one also works on your system. Please test. Thanks.
« Last Edit: December 10, 2020, 06:40:16 am by DonAlfredo »

MiR

  • Sr. Member
  • ****
  • Posts: 250
Re: Fpcupdeluxe
« Reply #1731 on: December 10, 2020, 10:47:06 am »
Unfortunately both do not work. The error message is different, it now says that the file is corrupt and the only option is to delete it.

Result is the same for both new files from github.

Systemlog revealed that Gatekeeper is standing in the way (Yes, I used CTRL-Click):

10.12.2020, 10:14:56 com.apple.xpc.launchd[1]: Coalition Cache Hit: app<application.com.company.fpcupdeluxe-aarch64-darwin-cocoa.860843.860848(501)> [9961]
10.12.2020, 10:15:07 com.apple.xpc.launchd[1]: removing service since it exited with consistent failure - OS_REASON_EXEC | Gatekeeper policy blocked execution

Next step then was to declare Terminal as a Developer Tool, after this step I could actually start fpcupdeluxe from within Terminal.

But build failed:
Code: [Select]
fpcupdeluxe: Executing: /usr/bin/git log -n 1 --grep=^git-svn-id: (working dir: /Users/ring/fpcupdeluxe/fpcsrc)
fpcupdeluxe: info: FPCNativeInstaller (GetModule: FPC): FPC was at revision: 45643
fpcupdeluxe: info: FPCNativeInstaller (GetModule: FPC): FPC is now at revision: 45643
fpcupdeluxe: info: FPCNativeInstaller (GetModule: FPC): No FPC patches defined.
fpcupdeluxe: info: FPCNativeInstaller (BuildModule: FPC): Building module FPC...
fpcupdeluxe: info: FPC native builder: Detected source version FPC (source): 3.2.0
fpcupdeluxe: info: FPCNativeInstaller (BuildModule: FPC): To compile this FPC, we need (required) a compiler with version 3.2.0 or 3.2.0
fpcupdeluxe: info: FPCNativeInstaller (CheckAndGetTools): Looking for a bootstrap compiler from official FPC bootstrap binaries.
fpcupdeluxe: info: FPCNativeInstaller (CheckAndGetTools): Looking for official FPC bootstrapper with version 3.2.0
fpcupdeluxe: info: FPCNativeInstaller (CheckAndGetTools): Now looking for a better [version] bootstrap compiler from Github FPCUP(deluxe) releases.
fpcupdeluxe: info: FPCNativeInstaller (CheckAndGetTools): Looking online for a FPCUP(deluxe) bootstrapper with name: fpcup-3_2_0-aarch64-darwin-ppca64
fpcupdeluxe: ERROR: FPCNativeInstaller (CheckAndGetTools): No bootstrapper local and online. Fatal. Stopping.
Found valid make application.
fpcupdeluxe: ERROR: FPCNativeInstaller (BuildModuleCustom: FPC): FPC bootstrap version error: 0.0.0 ! Should never happen: expect many errors !!
fpcupdeluxe: info: FPCNativeInstaller (BuildModuleCustom: FPC): Running CleanModule once more before building FPC from sources, due to previous CleanModule failure.
fpcupdeluxe: info: FPCNativeInstaller (CleanModule: FPC): Running  distclean failed: could not find cleanup compiler. Will try again later
fpcupdeluxe: info: FPCNativeInstaller (CleanModule: FPC): Now building FPC revision 45643
fpcupdeluxe: Executing: /usr/bin/make --jobs=8 FPMAKEOPT=--threads=8 PP=/Users/ring/fpcupdeluxe/fpcbootstrap/ppca64 FPCMAKE=/Users/ring/fpcupdeluxe/fpc/bin/aarch64-darwin/fpcmake PPUMOVE=/Users/ring/fpcupdeluxe/fpc/bin/aarch64-darwin/ppumove PREFIX=/Users/ring/fpcupdeluxe/fpc INSTALL_PREFIX=/Users/ring/fpcupdeluxe/fpc FPCDIR=/Users/ring/fpcupdeluxe/fpcsrc INSTALL_BINDIR=/Users/ring/fpcupdeluxe/fpc/bin/aarch64-darwin OS_SOURCE=darwin CPU_SOURCE=aarch64 OS_TARGET=darwin CPU_TARGET=aarch64 OVERRIDEVERSIONCHECK=1 REVSTR=45643 REVINC=force OPT=-Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -WM10.8 -Sg -vw-n-h-l-d-u-t-p-c- --directory=/Users/ring/fpcupdeluxe/fpcsrc all install (working dir: /Users/ring/fpcupdeluxe/fpcsrc)
Makefile:135: *** Compiler /Users/ring/fpcupdeluxe/fpcbootstrap/ppca64 not found.  Stop.

fpcupdeluxe: ERROR: FPCNativeInstaller (CleanModule: FPC): Error running /usr/bin/make for FPC failed with exit code 512
. Details:


ERROR: Fpcupdeluxe fatal error !

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2023
  • Former Delphi 1-7, 10.2 user
Re: Fpcupdeluxe
« Reply #1732 on: December 10, 2020, 11:18:10 am »
@MIR: You can compile both FPC + Lazarus from source - see the Wiki article ARM64/AArch64/Apple Silicon Support. This works for me on the base M1 Mac mini.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Fpcupdeluxe
« Reply #1733 on: December 10, 2020, 11:22:04 am »
@MiR
Thanks for this feedback ! Very useful.
As said, arm64-darwin is still a moving target for fpcupdeluxe: I am also very interested to know if you are able to get the cross-app running (a bit).
Will look into a suitable bootstrapper for FPC.


MiR

  • Sr. Member
  • ****
  • Posts: 250
Re: Fpcupdeluxe
« Reply #1734 on: December 10, 2020, 11:29:01 am »
Thinking about the error message, it makes a lot of sense.

We only have trunk compiler on aarch64 so the search for stable fpc must fail. I tried to build both stable.git and trunk.git for fpc, same result for both.

@DonAlfredo: Can I override this check in some way? I looked through settings+ but the right side of the dialog is greyed out for me.

@trev: Thank you, I already did that yesterday, my point is that I would like to help DonAlfredo to make fpcupdeluxe work on M1 chipssets so others have a smoother transition.


DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Fpcupdeluxe
« Reply #1735 on: December 10, 2020, 11:32:56 am »
This message includes a screenshot on how to override the compiler in Setup+.
You need to select the target os and cpu first !

MiR

  • Sr. Member
  • ****
  • Posts: 250
Re: Fpcupdeluxe
« Reply #1736 on: December 10, 2020, 11:39:00 am »
I would love to change those settings but.....  :'(

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Fpcupdeluxe
« Reply #1737 on: December 10, 2020, 11:44:31 am »
That is a good one ...  ;)
Will build new up-binaries. Stay tuned !
 :D

MiR

  • Sr. Member
  • ****
  • Posts: 250
Re: Fpcupdeluxe
« Reply #1738 on: December 10, 2020, 11:53:56 am »
Success.....

I created a symlink to my local build of fpc-trunk in fpcbootstrap directory and tweaked fpc options to include path to my commandlinetools:

-FD/Library/Developer/CommandLineTools/usr/bin -XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

and I have a native lazarus built with fpcupdeluxe on my mac.....

To automate the setting of -FD and -XR I'd propose to use this command:

xcrun --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

and then later include both -FD and -XR in you custom fpc.cfg

This last step is also valid for builds of x64_64, I had to do those tweaks a while ago to make lazarus compile on my 'old' x86_64 mac.

« Last Edit: December 10, 2020, 11:57:22 am by MiR »

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Fpcupdeluxe
« Reply #1739 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.

 

TinyPortal © 2005-2018