Recent

Author Topic: Cannot do instruction from "Cross compile Linux x64->x32"  (Read 7991 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2406
    • UVviewsoft
Cannot do instruction from "Cross compile Linux x64->x32"
« on: September 11, 2015, 10:18:53 am »
I followed all topics from http://wiki.lazarus.freepascal.org/Cross_compiling . I made two textfiles. set them X attribute.
I rebuild fpc. I run installation of fpc: log was ok. fpc was built.

Now I run Laz 1.5 SVN again (it has OK path to fpc), select "target Linux i386": error
>Compiler "/usr/bin/fpc" does not support target i386-linux

Need more inf in wiki
Ubuntu 14.04 x64
 
Quote

user@user-OEM:~$ /usr/bin/fpc
Free Pascal Compiler version 2.6.4 [2014/04/20] for x86_64
Copyright (c) 1993-2014 by Florian Klaempfl and others
/usr/lib/fpc/2.6.4/ppcx64 [options] <inputfile> [options]

« Last Edit: September 11, 2015, 10:21:44 am by Alextp »

lagprogramming

  • Sr. Member
  • ****
  • Posts: 406
Re: Cannot do instruction from "Cross compile Linux x64->x32"
« Reply #1 on: September 16, 2015, 10:14:12 pm »
Are you trying to build a linux-i386 executable on a linux-x86_64 platform? If the answer is yes, do you still need help with that?

AlexTP

  • Hero Member
  • *****
  • Posts: 2406
    • UVviewsoft
Re: Cannot do instruction from "Cross compile Linux x64->x32"
« Reply #2 on: September 17, 2015, 08:17:33 am »
yes.. I try it. I need help.
(Laz gives error that it cannot support i386 platform)

lagprogramming

  • Sr. Member
  • ****
  • Posts: 406
Re: Cannot do instruction from "Cross compile Linux x64->x32"
« Reply #3 on: September 18, 2015, 08:28:13 am »
Have you tried using fpcup?

AlexTP

  • Hero Member
  • *****
  • Posts: 2406
    • UVviewsoft
Re: Cannot do instruction from "Cross compile Linux x64->x32"
« Reply #4 on: September 18, 2015, 08:50:30 am »
No; how to use fpcup to do it?

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: Cannot do instruction from "Cross compile Linux x64->x32"
« Reply #5 on: September 18, 2015, 03:37:29 pm »
If I recall correctly, you can't do x64 -> x32 cross compiler due to lack of extended type in 64-bit compiler. I might be wrong, thought.

You might want to create chroot environment for 32-bit Ubuntu and install 32-bit FPC in there. Another way is to use LXC : https://linuxcontainers.org/

See your distro documentation for more info.
« Last Edit: September 18, 2015, 03:40:09 pm by Cyrax »

AlexTP

  • Hero Member
  • *****
  • Posts: 2406
    • UVviewsoft
Re: Cannot do instruction from "Cross compile Linux x64->x32"
« Reply #6 on: September 18, 2015, 04:09:41 pm »
I ll try.
Why wiki shows info which is NOT working? Part about Linux x64 to x32..

Handoko

  • Hero Member
  • *****
  • Posts: 5158
  • My goal: build my own game engine using Lazarus
Re: Cannot do instruction from "Cross compile Linux x64->x32"
« Reply #7 on: September 18, 2015, 07:27:48 pm »
Why wiki shows info which is NOT working? Part about Linux x64 to x32..

FPC/Lazarus grows fast, some wiki pages are outdated. We lack of volunteers to update the pages.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Cannot do instruction from "Cross compile Linux x64->x32"
« Reply #8 on: September 18, 2015, 08:14:04 pm »
If I recall correctly, you can't do x64 -> x32 cross compiler due to lack of extended type in 64-bit compiler. I might be wrong, thought.
Certainly, because I can ;)
This wiki entry is not wrong, but:
  • missing important information regarding library search path (I've asked this previously and eventually found it, use the forum search)
  • assume FPC source directory location (looks like the one installed from *buntu repository)
  • assume default installation folder (/usr/local, with no INSTALL_PREFIX mentioned) without symlinking ppcross386 to the correct bin folder (OP problem is likely to be this one)
I have quite a lot of experience in building FPC as a cross compiler, but I need some time to update the wiki. It's difficult to write something that can be understood by most people.

Handoko

  • Hero Member
  • *****
  • Posts: 5158
  • My goal: build my own game engine using Lazarus
Re: Cannot do instruction from "Cross compile Linux x64->x32"
« Reply #9 on: September 18, 2015, 08:25:59 pm »
I have quite a lot of experience in building FPC as a cross compiler, but I need some time to update the wiki. It's difficult to write something that can be understood by most people.

Please share the secret to us.   :)

Perhaps, you can build a simple tool that can automatic generate a batch file based on user input information (target OS, library path, FPC source, etc). I saw CodeTyphon cross compile tool, wow that's really an awesome idea. Unfortunate CT is not suitable for me.

lagprogramming

  • Sr. Member
  • ****
  • Posts: 406
Re: Cannot do instruction from "Cross compile Linux x64->x32"
« Reply #10 on: September 18, 2015, 08:53:39 pm »
   @Alextp
   If you do your best and you still can't solve your problem, then you might be interested in being part of my experiment. Part of the experiment consists in trying to offer the community a different approach to crossbuilding. This process is something that you fail to do, for now. Unfortunately for you, the experiment is in a very early development status. Also, I estimate that you would have to wait about a week until I reach a new milestone, at the moment I'm half-way done.

   @Others
   I have an unanswered post regarding this subject. You might want to read the bottom link found in that post, too. It's a chain I'm trying to break >:D .
   http://forum.lazarus.freepascal.org/index.php/topic,29523.msg187804.html#msg187804

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Cannot do instruction from "Cross compile Linux x64->x32"
« Reply #11 on: September 18, 2015, 09:22:56 pm »
There are some instructions on how to use fpcup on this new wiki page: http://wiki.freepascal.org/Small_Virtual_Machines
Regards,
Paul Breneman
www.ControlPascal.com

AlexTP

  • Hero Member
  • *****
  • Posts: 2406
    • UVviewsoft
d
« Reply #12 on: September 18, 2015, 09:38:45 pm »
Part of experiment? You sound like a psychological guy.. I don't like it.

I want to test a tool
Not an experiment..

@leledumbo
I welcome ur wiki info

lagprogramming

  • Sr. Member
  • ****
  • Posts: 406
Re: d
« Reply #13 on: September 19, 2015, 12:04:23 am »
Part of experiment? You sound like a psychological guy.. I don't like it.

I want to test a tool
Not an experiment..

@leledumbo
I welcome ur wiki info

   I've offered you the possibility to be involved in an experiment because I know I've faced the same problems you have to face now. I've already proven this in the unanswered posts linked to my previous message. This means that I "might have had" access to the same platform as you do now. Your answer makes me think that you either failed to understand that your situation might be considered complicated, either you didn't read the texts at all. No matter what, I have manual command lines for the situation you're facing, so you wouldn't have depended on external tools.
   You say you want to test a tool instead of an experiment!? It's like asking to test a hammer instead of testing the lead engineer. The tool you would have had access to, is competing with vacuum cleaners, is getting close to washing your dishes and laundry, bringing home money, cooking and giving you a bl0wj0b...all of them at the same time...at least. I overreact a little bit... but not too much. As I've said, within a week the experiment might have given you more than that.  :o
    Leledumbo is a valuable forum user, but if you read his texts like you did with mine he won't be very helpful to you either.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Cannot do instruction from "Cross compile Linux x64->x32"
« Reply #14 on: September 19, 2015, 10:02:44 am »
I have quite a lot of experience in building FPC as a cross compiler, but I need some time to update the wiki. It's difficult to write something that can be understood by most people.

Please share the secret to us.   :)

Perhaps, you can build a simple tool that can automatic generate a batch file based on user input information (target OS, library path, FPC source, etc). I saw CodeTyphon cross compile tool, wow that's really an awesome idea. Unfortunate CT is not suitable for me.
Only these two attached bash script (run the 2nd after the 1st to check for build errors), simply (de)activate by (un)commenting the respective targets_opt and targets_[cross]opt lines. The secret lies in  "ready for cross compiling" environment. That means binutils (accessible from PATH) and fpc.cfg (esp. -Fl) are properly set up. These are mine:
Code: [Select]
#ifdef cpui386
-Fl/usr/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/32
#endif
#ifdef cpux86_64
-Fl/usr/lib/gcc/x86_64-unknown-linux-gnu/5.1.0
#endif

#ifdef cpui386
-Fl/usr/lib32
#endif
#ifdef cpux86_64
-Fl/usr/lib
#endif

#ifdef cpuarm
#ifdef linux
-Fl/opt/x-tools/arm-linux-gnueabihf-raspi/lib/gcc/arm-linux-gnueabihf/4.8.3/
-Fl/opt/x-tools/arm-linux-gnueabihf-raspi/arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/
-Fl/mnt/Data/rpi/lib/
-Fl/mnt/Data/rpi/usr/lib/
#endif
#endif
That's all. The explanation is another thing, though.

 

TinyPortal © 2005-2018