Forum
× CodeTyphon Cross-Build Development, discussions and problems

Question Cross-compile from MacOs to Win64/Linux64?

  • Premysl Beran
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
2 months 2 weeks ago #14272 by Premysl Beran
Cross-compile from MacOs to Win64/Linux64? was created by Premysl Beran
Hi Sternas,

I used to cross-compile my project from Win to Linux without any issue. Lately, I also had to deal with Mac. So I installed CT on Mac and compiled my project for Mac. All works quite fine.

I wanted to test if I can compile on Mac the executable for Win64 to not need to switch to Windows all the time. As there is no toolchain for this, I wanted to create one using ToolChainBuilder. I selected CPU-OS target as x86_64-win64. But the build finished with error (see below). What I'm doing wrong? Thanks for the help.

The toolchain for X86_64-linux was created correctly. But when I tried to build cross elements for that I got a message (below). It says that "gmake[2]: x86_64-linux-as: Not found". But I found it in the CT/binTollchains/mac64-x86_64-linux directory. What can be wrong in this procedure of cross-compiling? Thanks for the help.

With best regards

Premek

Windows toolchain build error
----------------------------------------------
   GNU Cross toolschains Engine settings
-----------------------------------------------
   
mac64
x86_64-darwin
xxxx
x86_64
win64
xxxx
x86_64-win64
xxxx
   
-------- configure -----------
checking build system type... 
checking build system type... x86_64-apple-darwin18.7.0
checking host system type... x86_64-apple-darwin18.7.0
checking target system type... Invalid configuration `x86_64-win64': system `win64' not recognized
configure: error: /bin/sh ./config.sub x86_64-win64 failed

Linux cross element build error
INFO]: !!! Cross compiler Executable ppcrossx64, Build OK. !!!
   
   
------------------------------------------------
       Stage 2: Build All Units and Packages
------------------------------------------------
/usr/local/bin/gmake -C rtl all
gmake[1]: Vstupuje se do adresáře „/usr/local/codetyphon/fpcsrc/rtl“
/usr/local/bin/gmake -C linux all
gmake[2]: Vstupuje se do adresáře „/usr/local/codetyphon/fpcsrc/rtl/linux“
/bin/mkdir -p /usr/local/codetyphon/fpcsrc/rtl/units/x86_64-linux
/usr/local/bin/gmake /usr/local/codetyphon/fpcsrc/rtl/units/x86_64-linux
gmake[3]: Vstupuje se do adresáře „/usr/local/codetyphon/fpcsrc/rtl/linux“
gmake[3]: „/usr/local/codetyphon/fpcsrc/rtl/units/x86_64-linux“ je aktuální.
gmake[3]: Opouští se adresář „/usr/local/codetyphon/fpcsrc/rtl/linux“
x86_64-linux-as --64 -o /usr/local/codetyphon/fpcsrc/rtl/units/x86_64-linux/prt0.o x86_64/prt0.as
gmake[2]: x86_64-linux-as: Příkaz nenalezen
gmake[2]: *** [Makefile:3918: prt0.o] Chyba 127
gmake[2]: Opouští se adresář „/usr/local/codetyphon/fpcsrc/rtl/linux“
gmake[1]: *** [Makefile:2073: linux_all] Chyba 2
gmake[1]: Opouští se adresář „/usr/local/codetyphon/fpcsrc/rtl“
gmake: *** [Makefile:2685: rtl] Chyba 2

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
2 months 2 weeks ago - 2 months 2 weeks ago #14273 by Sternas Stefanos
Replied by Sternas Stefanos on topic Cross-compile from MacOs to Win64/Linux64?
Cross-build Toolchains are from GNU C/C++ programming galaxy
For MacOS x86_64-win64 Toolchain NOT Exists

For GNU binutils version 2.33.1 (CT 7.00) and Apple clang version 11.0.0 (clang-1100.0.33.16) MacOS Catalina
Exists
x86_64-w64-mingw32
i686-w32-mingw32

So for MacOS64 to Win64 you must
a) Build x86_64-w64-mingw32 toolchain
b) Rename x86_64-w64-mingw32 folder to x86_64-win64
b) Rename ALL executables to x86_64-win64-xxx

For MacOS64 to Win32 you must
a) Build i686-w32-mingw32 toolchain
b) Rename i686-w32-mingw32 folder to i386-win32
b) Rename ALL executables to i386-win32-xxx

We upload win32 and win64 Toolchains for MacOS64 to our
Toolchains Server

and we build more now...
with GNU binutils version 2.33.1 (CT 7.00) and
Apple clang version 11.0.0 (clang-1100.0.33.16) on MacOS 10.15.2 Catalina


PS: CodeTyphon Toolchain Building System is unique on planet Earth ... :woohoo:

PilotLogic Architect and Core Programmer
Last edit: 2 months 2 weeks ago by Sternas Stefanos.

Please Log in or Create an account to join the conversation.

  • Premysl Beran
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
2 months 2 weeks ago #14274 by Premysl Beran
Replied by Premysl Beran on topic Cross-compile from MacOs to Win64/Linux64?
Sir,

Thank you for the info. After I update to Catalina, I will definitely try. You are right that Cross-tool chains are something really unique and very very helpful. Thanks for your nice work and support.

And any comment to MacOS to Linux error? The compiler complaining that executable doesn't exist, but it is there. Some link problem, or so?

With best regards

Premek

Please Log in or Create an account to join the conversation.