Welcome, Guest
Username: Password: Remember me
CodeTyphon Linux OS Development, discussions and problems
  • Page:
  • 1

TOPIC:

misteries of cross compiling ;) 9 years 5 months ago #6087

  • Yanmei
  • Yanmei's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Hi all

I'm brand new in CodeTyphon and in cross compiling too (I had a little experience on Delphi XE7 - not mine - creating an ugly app for android based on one of my Delphi Explorer projects: it's ugly but it works, anyway).
My experience is an "hobby-like" one on Delphi Explorer (for Win32), on Lazarus 1.x.x, since I'm using Ubuntu for work and at home and on fpc from shell, creating some binaries my shell scripts invoke (I know, working wit bash it would be only bash or bash and C but I prefer Pascal to C); in these days, since I discovered CodeTyphon, I've started to cross-compile; my main goal is to produce binaries, executables, both for linux-i386 and for linux x64-86, the way to be able distributing them without the need of recompile them when changing machine.

But ... I'm totally newbie, so I'm not figuring out why, working on a AMD64 pc with Ubuntu 14.04 64, I'm able to deploy executables on 64 based linux machines but if I try to configure target OS to linux i86, I'm always getting errors like "Fatal: Cannot find unit system used by fcllaz of package FCL." (I'll be more precise tomorrow: at work I've collected any error message I've got).

So: can someone help me telling me how to build i386 linux executables from a 64 bit machine?

Thanks to all,
Yanmei

Added later: a new error while searching to compile a linux-i86 binary (x64_86 has been correctly compiled): "/usr/lib/codetyphon/fpc/bin/x86_64-linux/i386-linux-ld: skipping incompatible /usr/lib/x86_64-linux-gnu//libc.a when searching for -lc"

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

Last edit: by Yanmei.

misteries of cross compiling ;) 9 years 5 months ago #6088

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4506
  • Thank you received: 1100
Sir welcome to our Cosmos
Now

1)-Without CrossBuild

To build on the same Host OS 32 and 64 Bits executables this OS must support MultiArch (Multi-Architecture) info
This OS ability exists years now to Windows, Solaris and OpenIndiana.
On Linux and FreeBSD, MultiArch this is new OS ability, you can find for Linux here our success tests.
At this case you must use:
-32 Bits IDE (Typhon32) to Build 32bits executables for the same OS
-64 Bits IDE (Typhon64) to Build 64bits executables for the same OS

We can't build CT with MultiArch on Ubuntu and Debian until now,
but we use CT with MultiArch on Fedora 20 in our Lab

2)-With CrossBuild

Theoretical you can build any Target from any Host OS ( info )
-Build Target OS-CPU FreePascal Element, from CTCenter
-Download OS Libraries for Target OS-CPU, only if the target is UNIX like OS (Linux, FreeBSD, Android etc)
-Config you application for Target OS-CPU and Platform (Win, QT, GTK2 etc)
-Build you application

These are the first steps to Our Programming Cosmos
PilotLogic Architect and Core Programmer

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

Last edit: by Sternas Stefanos.

misteries of cross compiling ;) 9 years 5 months ago #6090

  • Yanmei
  • Yanmei's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Hello sternas and thank you for your reply (just a remark: "Sir welcome to our Cosmos" isn't so correct, better "Madam, welcome to our Cosmos", in my case :) )

In these days I'm a bit busy with Shibboleth (@ job) and with husband and 12-y.o. son (@home), so I think I'll do this way:
following your suggestion #1 I'll set up a couple of VM, both equipped with Ubuntu 14.04, respectively @64 and @32, so I'll can face the "emergency"; I'll do several tests on executables in different platforms too.
Then, next week, I'll try to follow your #2 suggestion, I'll do several tests and I'll let you know.

Have a nice weekend,
Yanmei

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

misteries of cross compiling ;) 9 years 5 months ago #6091

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4506
  • Thank you received: 1100
Sorry Madam :huh:
My respect (working mother with programming knowledge !!!)
Have a nice weekend...
PilotLogic Architect and Core Programmer

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

Last edit: by Sternas Stefanos.

misteries of cross compiling ;) 9 years 5 months ago #6112

  • Yanmei
  • Yanmei's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Ok, I'm here, sorry for being late ;)

I've tried both on Windows (8, 64) and Linux (Ubuntu 14.04, 64); last trial has been on Windows and I've done this way:

1) brand new CT installation
2) toolchains for linux (i386 and x86_64) download
3) libraries for linux (i386 and x86_64) download
4) on Typhon32 set up a small, idiot project (a sort of "hello world", for being fast)
5) compiled it and got a working exe.
6) on menu-Project set Linux - i386 - (default) as target
7) on menu-Project-Additions and Overrides added LGLWidgetType gtk e gtk2

compiled and ... got "Fatal: Cannot find unit system used by fcllaz of package FCL." :evil:

I've done the same on Typhon32 installed on a 32 bit linux box and in this case ?I've been able to get both the win32 exe and the linux 32 binary

So where am I wrong?

Thanks,
Yanmei

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

misteries of cross compiling ;) 9 years 5 months ago #6113

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4506
  • Thank you received: 1100
Did you Build i386-Linux or x86_64-Linux FPC32 elements from CTCenter ?
PilotLogic Architect and Core Programmer

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

misteries of cross compiling ;) 9 years 5 months ago #6125

  • Yanmei
  • Yanmei's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Thanks sternas!
referring to your picture, it's what I've done ... without success!
Let me better explain:

I've right now re-builded cross-elements, as you can see here



but nothing happened - while at least on linux it works, I can sees cross-elements under FPC for win32 in CodeTyphon window - as you can see here:



Sorry for bothering you and cheers!
Yanmei

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

  • Page:
  • 1