Recent

Author Topic: RESOLVED : Building cross compiling environment...  (Read 6279 times)

gelinp

  • Full Member
  • ***
  • Posts: 114
RESOLVED : Building cross compiling environment...
« on: October 09, 2015, 07:00:07 am »
Hi,

I'm making 32 bit Windows cross compiling environment with FPC 2.6.4 under linux debian Lessy. I know I have to execute this script under /usr/share/fpcsrc/2.6.4 directory:

Code: Pascal  [Select][+][-]
  1. cd /usr/share/fpcsrc/2.6.4
  2. sudo make clean all OS_TARGET=win32 CPU_TARGET=i386
  3. sudo make crossinstall OS_TARGET=win32 CPU_TARGET=i386 INSTALL_PREFIX=/usr
  4. sudo ln -sf /usr/lib/fpc/3.1.1/ppcross386 /usr/bin/ppcross386

But the first line display errors :

Code: Pascal  [Select][+][-]
  1. gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386
  2. make: execvp: /usr/local/bin/pwd.exe: Permission non accordée
  3. Makefile:135: *** Compiler .exe not found. Arrêt.
  4. gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386
  5. make: execvp: /usr/local/bin/pwd.exe: Permission non accordée
  6. Makefile:135: *** Compiler .exe not found. Arrêt.

It looks like debian try to execute .exe files with execvp comand ! May be the Makefile dosn't understand I'm under Linux Debian ? What is wrong ?
« Last Edit: October 11, 2015, 07:20:56 am by gelinp »
My configuration is : Lazarus 1.6+dfsg-1 / FPC 3.0.0 / Debian Mint / x86_64-linux-gtk2

lagprogramming

  • Sr. Member
  • ****
  • Posts: 406
Re: Building cross compiling environment...
« Reply #1 on: October 09, 2015, 09:31:47 am »
Are you absolutely sure that "sudo" works fine in your system? Verify it by issuing something like "sudo dir /root/", or something like that.

You can continue by following one of:
1. Try logging as "root" and run the same commands but without "sudo " text that's in front of each text line.
2. Use fpcup
3. Use getlazarus
4. Use CT
5. Soon there will be an update to the experiment presented at:
http://forum.lazarus.freepascal.org/index.php/topic,28561.msg188800.html#msg188800

So, you have alternatives.  8)

gelinp

  • Full Member
  • ***
  • Posts: 114
Re: Building cross compiling environment...
« Reply #2 on: October 09, 2015, 10:28:31 am »
Yes, you are right, I'was asking myself it will be a problem with sudo envirnment. May be a problem with PATH variable. I tried already to login as root with su and running the comand sudo make... but it's the same problem. I will have a look this afternoom after my job and I will send you an other message.
My configuration is : Lazarus 1.6+dfsg-1 / FPC 3.0.0 / Debian Mint / x86_64-linux-gtk2

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1059
Re: Building cross compiling environment...
« Reply #3 on: October 09, 2015, 11:23:46 am »
It's may indeed be related to your PATH. The "make" utility has no built-in support for detecting whether you run on a Unix-like system or not, nor a way to request the default file extension for binaries on the current system. We have therefore implemented a heuristic in our makefiles, which assumes that we are running on a Unix-like system if the PATH contains not a single semicolon (;), as directories in the PATH are separated by ":" on Unix-like platforms and by ";" on others.

Now, this heuristic fails
a) on Windows if there is only one directory in the PATH (since there won't be any ";" in that case)
b) on Unix-like systems if you have a directory containing "';" in its name in your PATH (although that's extremely rare)

Or maybe you simply accidentally used a semicolon instead of a colon as separator when adding a directory to your PATH?

gelinp

  • Full Member
  • ***
  • Posts: 114
Re: Building cross compiling environment...
« Reply #4 on: October 09, 2015, 02:31:55 pm »
OK, I understand. But I can't find any semicolon into my PATH, into my system... I'm looking for again... Could you please tell me what path I have to watch in detail for this test ?

So the first error make displayed  was with /usr/local/bin/pwd.exe file. This .exe and a lot of other (so there is .exe files into my system, Debian is a little crasy !) were all with my name as user, so I set root.stuff proprietary as others files into this directory, and no one with execution flag... I don't know if they need execution flag because they are use as parameter into execvp program, but I tested. The result is worst :

Code: Pascal  [Select][+][-]
  1. gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386
  2. [sudo] password for gelinp:
  3. make: execvp: /usr/local/bin/pwd.exe: Permission non accordée
  4. Makefile:135: *** Compiler .exe not found. Arrêt.
  5. gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386
  6. /usr/local/bin/pwd.exe: 1: /usr/local/bin/pwd.exe: MZ����@���: not found
  7. /usr/local/bin/pwd.exe: 2: /usr/local/bin/pwd.exe: $�a�����������D�����������Rich���PEL��g5�
  8.                                                                                             : not found
  9. /usr/local/bin/pwd.exe: 3: /usr/local/bin/pwd.exe: Syntax error: "(" unexpected
  10. Makefile:135: *** Compiler .exe not found. Arrêt.

The file .bashrc is the very similar for me as normal user and for root user. Because I used mine to edit the root user .bashrc file.
My configuration is : Lazarus 1.6+dfsg-1 / FPC 3.0.0 / Debian Mint / x86_64-linux-gtk2

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1059
Re: Building cross compiling environment...
« Reply #5 on: October 09, 2015, 02:40:35 pm »
So the first error make displayed  was with /usr/local/bin/pwd.exe file. This .exe and a lot of other (so there is .exe files into my system, Debian is a little crasy !)
All files under /usr/local are files that you installed yourself. Official Debian packages will never put anything there.

Quote
were all with my name as user, so I set root.stuff proprietary as others files into this directory, and no one with execution flag... I don't know if they need execution flag because they are use as parameter into execvp program, but I tested. The result is worst :

Code: Pascal  [Select][+][-]
  1. gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386
  2. [sudo] password for gelinp:
  3. make: execvp: /usr/local/bin/pwd.exe: Permission non accordée
  4. Makefile:135: *** Compiler .exe not found. Arrêt.
  5. gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386
  6. /usr/local/bin/pwd.exe: 1: /usr/local/bin/pwd.exe: MZ����@���: not found
  7. /usr/local/bin/pwd.exe: 2: /usr/local/bin/pwd.exe: $�a�����������D�����������Rich���PEL��g5�
  8.                                                                                             : not found
  9. /usr/local/bin/pwd.exe: 3: /usr/local/bin/pwd.exe: Syntax error: "(" unexpected
  10. Makefile:135: *** Compiler .exe not found. Arrêt.
Those errors mean that they are DOS/Windows executables, and that the Linux kernel doesn't know how to execute DOS/Windows executables.

Try removing /usr/local/bin from your/root's PATH before building again.

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Building cross compiling environment...
« Reply #6 on: October 09, 2015, 02:47:45 pm »
Hi gelinp. I suggest you to use VirtualBox, so you can test build the cross compiler on Ubuntu virtual machine. If it works, then you may copy the result files to your 'real' OS.

Note: On the code I gave you, there was a 'fpc/3.1.1' on line no. 4. That because I tried to combine Lazarus with FPC 3.1.1. Sorry, I forgot to change it back to 2.6.4.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Building cross compiling environment...
« Reply #7 on: October 09, 2015, 07:08:06 pm »
Try removing /usr/local/bin from your/root's PATH before building again.
Or remove those .exes, your Linux system shouldn't need it. Probably it's installed by accident somehow.

gelinp

  • Full Member
  • ***
  • Posts: 114
Re: Building cross compiling environment...
« Reply #8 on: October 09, 2015, 07:30:35 pm »
OK, I moved all /usr/local/bin*.exe, all *.dll and all files not executable into a subfolder. Then I executed comands below :

Code: Pascal  [Select][+][-]
  1. gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo fpcmake
  2. Processing Makefile.fpc
  3.  i386-linux requires:
  4.  Writing Makefile
  5. gelinp@inspiron:/usr/share/fpcsrc/2.6.4$ sudo make clean all OS_TARGET=win32 CPU_TARGET=i386
  6. Makefile:215: *** The Makefile doesn't support target i386-win32, please run fpcmake first. Arrêt.
  7.  

What do you think about this ? I would like to try with 3.1.1 version but I have to download a version with /sur/share/fpcsrc/3.1.1/Makefile !
« Last Edit: October 09, 2015, 07:37:50 pm by gelinp »
My configuration is : Lazarus 1.6+dfsg-1 / FPC 3.0.0 / Debian Mint / x86_64-linux-gtk2

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1059
Re: Building cross compiling environment...
« Reply #9 on: October 09, 2015, 07:33:51 pm »
Why did you run fpcmake? fpcmake regenerates the Makefile from Makefile.fpc, and if you don't give any parameters, the generated Makefile only supports your host platform. Run "sudo fpcmake -Tall" to restore support for all targets to your Makefile.

gelinp

  • Full Member
  • ***
  • Posts: 114
Re: Building cross compiling environment...
« Reply #10 on: October 09, 2015, 08:23:36 pm »
R  E  S  O  L  V  E  D !    Thank you very much !

So the problem was :

  • *.exe files, installed by mistake into /usr/local/bin directory.
  • I have to rebuild Makefile with sudo fpcmake -Tall comand

Thank you very much again for all your so helpfull messages !
« Last Edit: October 09, 2015, 08:26:06 pm by gelinp »
My configuration is : Lazarus 1.6+dfsg-1 / FPC 3.0.0 / Debian Mint / x86_64-linux-gtk2

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1059
Re: Building cross compiling environment...
« Reply #11 on: October 09, 2015, 08:25:41 pm »
  • ...
  • I have to rebuild Makefile with sudo fpcmake tall comand
Well, no: the original Makefile contained support for all targets. You only had to rebuild it because you first overwrote it with "sudo fpcmake" (without -Tall)

gelinp

  • Full Member
  • ***
  • Posts: 114
Re: Building cross compiling environment...
« Reply #12 on: October 09, 2015, 09:31:21 pm »
Oui effectivement ! Je laisse quand même mon message avec fpcmake car d'autres ferons peut être la même erreur...

Je viens de compiler mon premier programme windows avec Lazarus sous Debian. Je l'ai testé simplement avec wine, et il fonctionne très bien.

Merci pour votre aide précieuse !
My configuration is : Lazarus 1.6+dfsg-1 / FPC 3.0.0 / Debian Mint / x86_64-linux-gtk2

 

TinyPortal © 2005-2018