Recent

Author Topic: Cross compilation problem  (Read 3540 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2261
    • Lazarus and Free Pascal italian community
Cross compilation problem
« on: March 02, 2019, 03:18:59 pm »
Hi guys, i have a problem. I install the 32 bit trunk version of lazarus/fpc on my pc. Run perfectly, but when use darwin cocoa cross compilation return this:

Code: Pascal  [Select][+][-]
  1. C:\lazarus\installazioni\20190302\fpc\bin\i386-win32\fpc.exe -Tdarwin -Px86_64 -MObjFPC -Scghi -O1 -gw -gl -k-framework -kCocoa -l -vewnhibq -FiC:\Users\francesco\Desktop\Francesco\test\lib\x86_64-darwin -FuC:\lazarus\installazioni\20190302\pacchetti_extra\zeosdbo-7.2.4-stable\packages\lazarus\lib\zcomponent\x86_64-darwin -FuC:\lazarus\installazioni\20190302\pacchetti_extra\zeosdbo-7.2.4-stable\packages\lazarus\lib\zdbc\x86_64-darwin -FuC:\lazarus\installazioni\20190302\pacchetti_extra\zeosdbo-7.2.4-stable\packages\lazarus\lib\zplain\x86_64-darwin -FuC:\lazarus\installazioni\20190302\pacchetti_extra\zeosdbo-7.2.4-stable\packages\lazarus\lib\zparsesql\x86_64-darwin -FuC:\lazarus\installazioni\20190302\lazarus\components\ideintf\units\x86_64-darwin\cocoa -FuC:\lazarus\installazioni\20190302\pacchetti_extra\zeosdbo-7.2.4-stable\packages\lazarus\lib\zcore\x86_64-darwin -FuC:\lazarus\installazioni\20190302\lazarus\components\lazcontrols\lib\x86_64-darwin\cocoa -FuC:\lazarus\installazioni\20190302\lazarus\lcl\units\x86_64-darwin\cocoa -FuC:\lazarus\installazioni\20190302\lazarus\lcl\units\x86_64-darwin -FuC:\lazarus\installazioni\20190302\lazarus\components\lazutils\lib\x86_64-darwin -FuC:\lazarus\installazioni\20190302\lazarus\packager\units\x86_64-darwin -FuC:\Users\francesco\Desktop\Francesco\test\ -FUC:\Users\francesco\Desktop\Francesco\test\lib\x86_64-darwin\ -FEC:\Users\francesco\Desktop\Francesco\test\bin\x86_64-darwin\ -oC:\Users\francesco\Desktop\Francesco\test\bin\x86_64-darwin\project1.d -dLCL -dLCLcocoa project1.lpr
  2. Hint: (11030) Start of reading config file C:\lazarus\installazioni\20190302\fpc\bin\i386-win32\fpc.cfg
  3. Warning: (11047) Option "-Xr" is ignored for the current target platform.
  4. Hint: (11031) End of reading config file C:\lazarus\installazioni\20190302\fpc\bin\i386-win32\fpc.cfg
  5. Free Pascal Compiler version 3.3.1-r41547 [2019/03/02] for x86_64
  6. Copyright (c) 1993-2018 by Florian Klaempfl and others
  7. (1002) Target OS: Darwin for x86_64
  8. (3104) Compiling project1.lpr
  9. (9009) Assembling project1
  10. clang-4.0: warning: argument unused during compilation: '-mlinker-version=274.2' [-Wunused-command-line-argument]
  11. clang-4.0: warning: argument unused during compilation: '-isystem /cygdrive/C//lazarus/installazioni/20190302/cross/bin/x86-darwin/include/clang/4.0.1/include' [-Wunused-command-line-argument]
  12. clang-4.0: warning: argument unused during compilation: '-cxx-isystem /cygdrive/C//lazarus/installazioni/20190302/cross/bin/x86-darwin/../../lib/x86-darwin/MacOSX10.11.sdk/usr/include/c++/4.2.1' [-Wunused-command-line-argument]
  13. clang-4.0: warning: argument unused during compilation: '-cxx-isystem /cygdrive/C//lazarus/installazioni/20190302/cross/bin/x86-darwin/../../lib/x86-darwin/MacOSX10.11.sdk/usr/include/c++/4.2.1/x86_64-apple-darwin15' [-Wunused-command-line-argument]
  14. clang-4.0: warning: argument unused during compilation: '-cxx-isystem /cygdrive/C//lazarus/installazioni/20190302/cross/bin/x86-darwin/../../lib/x86-darwin/MacOSX10.11.sdk/usr/include/c++/4.2.1/backward' [-Wunused-command-line-argument]
  15. (9022) Compiling resource C:\Users\francesco\Desktop\Francesco\test\lib\x86_64-darwin\project1.or
  16. (9015) Linking C:\Users\francesco\Desktop\Francesco\test\bin\x86_64-darwin\project1.d
  17. ld: framework not found Cooa
  18. An error occurred while linking
  19. (1008) 22 lines compiled, 2.6 sec
  20. (1021) 1 warning(s) issued
  21. (1022) 2 hint(s) issued

Why?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

jamie

  • Hero Member
  • *****
  • Posts: 7610
Re: Cross compilation problem
« Reply #1 on: March 02, 2019, 03:28:09 pm »
I don't do Mac but, I do know you need all the library files on your compiling PC for the target. It wants to link in  file that you
don't have in your paths, mainly the cocoa libraries I would say..

 By looking at it, it seems that you are using the "/" slashes where as in windows it's "\". I am not sure if the compiler is
smart enough to switch those for you ? But in any case, it looks like it maybe ignoring those files.

 Cross compiling is such a pain in many cases for many reasons..., oh well.

The only true wisdom is knowing you know nothing


xinyiman

  • Hero Member
  • *****
  • Posts: 2261
    • Lazarus and Free Pascal italian community
Re: Cross compilation problem
« Reply #3 on: March 02, 2019, 03:55:09 pm »
See:
http://forum.lazarus.freepascal.org/index.php/topic,34645.msg311836.html#msg311836

This?

This is a limitation of the FPC unzipper: your install-path is too long for the Darwin library to unpack.

But fpcupdeluxe not return error.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2261
    • Lazarus and Free Pascal italian community
Re: Cross compilation problem
« Reply #4 on: March 04, 2019, 09:31:38 pm »
no suggestion?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Soner

  • Sr. Member
  • ****
  • Posts: 328
Re: Cross compilation problem
« Reply #5 on: March 04, 2019, 09:47:24 pm »
Linker says it can't found cocoa framework:
ld: framework not found Cooa

I think, your cygwin environment doesn't contain cocoa and other apple frameworks.

Why don't you use macos in virtualbox?
Macos devolopment is stupid enough on native mac and you will get only errors with your cygwin environment.

xinyiman

  • Hero Member
  • *****
  • Posts: 2261
    • Lazarus and Free Pascal italian community
Re: Cross compilation problem
« Reply #6 on: March 05, 2019, 08:12:42 am »
In fact I'm trying to do the cross compilation from windows. If I install the 64-bit version of lazarus the cross compiler works, but there is a bug in the timestamptomsecs function. If I install the 32-bit version the cross compiler does not work.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: Cross compilation problem
« Reply #7 on: March 05, 2019, 12:09:53 pm »
To get  the timestamptomsecs function to work properly, you need to build native 64-bit compiler and its whole compiler suite.  Cross compiling from 64-bit to 32-bit will never work.

xinyiman

  • Hero Member
  • *****
  • Posts: 2261
    • Lazarus and Free Pascal italian community
Re: Cross compilation problem
« Reply #8 on: March 05, 2019, 01:34:34 pm »
Look, I installed the cross compilers with fpcupdeluxe. And anyway the cross compilation from win64 to darwin64 (cocoa) does not work either. While from darwin64 to win64 or win32 it works properly.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018