Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-12

cross compile again

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

LeVA

Hello!

Beacuse no one replied, I thought that it might be useful to spend the whole night with googling, and searching the answers for this cross compiling :)
Now it somewhat clearer for me, what should I do.
I found a new howto, which explains this thing a little bit simpler. Now I realized, that lazarus need these tools (asw, dlltools etc...) to compile the project to win32. I think that those utils will be there, after I compiled my new gcc, as I read it on the web-page (am I right?). My problem is that I can not compile the new gcc(3.3.1). When typing make, it says after a while that it can not find the sys/sysctl.h header file. Well it is in my /usr/include dir, but gcc can not detect it, because of the configure parameters I've added to it before the make. I tought that I could solve this, and symlinked the /usr/include/sys dir, to the gcc-source's include dir. Now the make found the sysctl.h file, but it reported that another .h file is missing. So I linked another (/usr/include/linux) dir to the gcc's include dir, and now the make finally went thru this phase. But then it wrote some error messages which I can not understand, and I thought maybe you could help me. So, here is the make's output:

/home/leva/FreePascal/cross-compile_bin/i386-pc-mingw32/gcc-build/gcc/xgcc -B/home/leva/FreePascal/cross-compile_bin/i386-pc-mingw32/gcc-build/gcc/ -B/home/leva/FreePascal/cross-compile_bin/i386-pc-mingw32/bin/ -B/home/leva/FreePascal/cross-compile_bin/i386-pc-mingw32/lib/ -isystem /home/leva/FreePascal/cross-compile_bin/i386-pc-mingw32/include -c -DHAVE_CONFIG_H -O2 -g -O2 -I. -I../../../gcc-3.3.1/libiberty/../include -W -Wall -Wtraditional -pedantic
../../../gcc-3.3.1/libiberty/physmem.c -o physmem.o In file included from ../../../gcc-3.3.1/include/features.h:283, from ../../../gcc-3.3.1/include/unistd.h:26,
from ../../../gcc-3.3.1/libiberty/physmem.c:25:
../../../gcc-3.3.1/include/sys/cdefs.h:31:3: warning: suggest hiding #error from traditional C with an indented #
In file included from ../../../gcc-3.3.1/include/bits/types.h:143, from ../../../gcc-3.3.1/include/unistd.h:190,
from ../../../gcc-3.3.1/libiberty/physmem.c:25:
../../../gcc-3.3.1/include/bits/pthreadtypes.h:16:3: warning: suggest hiding #error from traditional C with an indented # ...
...
...
../../../gcc-3.3.1/include/bits/stdio.h:113: warning: traditional C rejects ISO C style function definitions
../../../gcc-3.3.1/include/bits/stdio.h: In function `ferror_unlocked': ...
...
...
../../../gcc-3.3.1/include/bits/sigthread.h: At top level: ../../../gcc-3.3.1/include/bits/sigthread.h:36: warning: `__thread' is not at beginning of declaration
../../../gcc-3.3.1/include/bits/sigthread.h:36: error: storage class specified for parameter `type name'
../../../gcc-3.3.1/libiberty/pexecute.c: In function `pexecute': ../../../gcc-3.3.1/libiberty/pexecute.c:391: error: `O_BINARY' undeclared (first use in this function)
../../../gcc-3.3.1/libiberty/pexecute.c:391: error: (Each undeclared identifier is reported only once
../../../gcc-3.3.1/libiberty/pexecute.c:391: error: for each function it appears in.)
../../../gcc-3.3.1/libiberty/pexecute.c:422: warning: passing arg 3 of pointer to function from incompatible pointer type ../../../gcc-3.3.1/libiberty/pexecute.c:439: warning: assignment discards qualifiers from pointer target type
../../../gcc-3.3.1/libiberty/pexecute.c:374: warning: unused variable `retries'
../../../gcc-3.3.1/libiberty/pexecute.c:374: warning: unused variable `sleep_interval'
../../../gcc-3.3.1/libiberty/pexecute.c:366: warning: unused parameter `this_pname'
../../../gcc-3.3.1/libiberty/pexecute.c:367: warning: unused parameter `temp_base'
../../../gcc-3.3.1/libiberty/pexecute.c: In function `pwait': ../../../gcc-3.3.1/libiberty/pexecute.c:457: warning: unused parameter `flags'
make[1]: *** [pexecute.o] Error 1

I hope someone can understand these error messages, and can explain me, how to compile this gcc, and then finally, I will be able to compile my project to win32.

Thanks for the help!

Daniel

LeVA

Reply by email

Marc Weustink
to Marco van de Voort: You don't need gcc. You are looking at compiling C programs cross platform with gcc. You…
LeVA wrote 73 lines
Marco van de Voort �rta: >>Beacuse no one replied, I thought that it might be useful to spend the >>whole night with googling, and searching the answers for this cross >>compiling :) >>Now it somewhat clearer for me, what should I do. >>I found a new howto, which explains this thing a little bit simpler. >>Now I realized, that lazarus need these tools (asw, dlltools etc...) to >>compile the project to win32. I think that those utils will be there, >>after I compiled my new gcc, as I read it on the web-page (am I right?). >>My problem is that I can not compile the new gcc(3.3.1). > >You don't need gcc. You are looking at compiling C programs cross >platform with gcc. >You don't have C programs, you have Pascal programs (FPC). So you need a >cross pascal compiler. >However it happens that FPC can generate code for all operating systems on >an architecture using one binary. (ppc386 in this case) >What you need are cross binutils. These are on ftp (freepascal.stack.nl), >and if you need to hand build them, see the script in the fpc source >repository (fpc/install/cross) >Then you need to compile the parts of FPC that are OS specific (the >libraries) for win32. >In the same CVS dir (fpc/install/cross) there is script that does just that. Thanks for the lot of help, now I realized, that I already have those ldw, asw binaries which are needed by lazarus, because the howto told me to compile a new binutils. Then I just don't understand why it told me to compile the gcc... So I've copied those binaries to my $PATH, and set up lazarus to build to win32, and set up the LCL to win32. Please allow me to paste the lazarus's output when I try to compile my project to win32: -------------###------------- ... ... ... [TCompiler.Compile] CmdLine="/home/leva/FreePascal/bin/ppc386 -Rintel -S2cgi -CD -Ch8000000 -OG1p1 -TWin32 -gl -XD -vewnhi -l -Fu/home/leva/FreePascal/Lazarus/lcl/units/ -Fu/home/leva/FreePascal/Lazarus/lcl/units/win32/ -Fu/home/leva/FreePascal/Lazarus/packager/units/ -Fu. -o/home/leva/tmp/project1.exe -dLCL /home/leva/tmp/project1.lpr" TOutputFilter: "Hint: Start of reading config file /home/leva/.fpc.cfg" TOutputFilter: "Hint: End of reading config file /home/leva/.fpc.cfg" TOutputFilter: "Free Pascal Compiler version 1.0.10 [2003/06/26] for i386" TOutputFilter: "Copyright (c) 1993-2003 by Florian Klaempfl" TOutputFilter: "Hint: Path "/usr/lib/fpc/1.0.10/units/win32/" not found" TOutputFilter: "Hint: Path "/usr/lib/fpc/1.0.10/units/win32/rtl/" not found" TOutputFilter: "Target OS: Win32 for i386" TOutputFilter: "Compiling /home/leva/tmp/project1.lpr" TOutputFilter: "syswin32.pp(5,1) Hint: Conditional I386 was set at startup in last compilation of syswin32.pp" TOutputFilter: "math.pp(6,13) Hint: Conditional I386 was set at startup in last compilation of math.pp" TOutputFilter: "Compiling unit1.pas" TOutputFilter: "Linking /home/leva/tmp/project1.exe" TOutputFilter: "47 Lines compiled, 1.9 sec" [TCompiler.Compile] end NOTE: No debugger defined. Starting program without debugging ... EXECUTING "/home/leva/tmp/project1.exe" WorkingDir "/home/leva/tmp/" [TMainIDE.DoRunProject] END Xlib: unexpected async reply (sequence 0x1bef4)! Xlib: unexpected async reply (sequence 0x1c79a)! Gdk-WARNING **: GdkWindow 0x4a00461 unexpectedly destroyed Gdk-WARNING **: GdkWindow 0x4a00460 unexpectedly destroyed Gdk-WARNING **: GdkWindow 0x4a0045f unexpectedly destroyed Gdk-ERROR **: X connection to :0.0 broken (explicit kill or server shutdown). -------------###-------------

Ehm... do I get this right here ? Are you creating a win32 executable and running it in Linux ? That won't work.

Marc

Reply by email

Craig Chapman
to Marco van de Voort: You don't need gcc. You are looking at compiling C programs cross platform with gcc. You…

----- Original Message -----

Earlier message 94 lines
From: "Marc Weustink" To: Sent: Sunday, December 14, 2003 1:25 PM Subject: Re: [lazarus] cross compile again At 09:30 14-12-2003, LeVA wrote: >Marco van de Voort �rta: >>>Beacuse no one replied, I thought that it might be useful to spend the >>>whole night with googling, and searching the answers for this cross >>>compiling :) >>>Now it somewhat clearer for me, what should I do. >>>I found a new howto, which explains this thing a little bit simpler. >>>Now I realized, that lazarus need these tools (asw, dlltools etc...) to >>>compile the project to win32. I think that those utils will be there, >>>after I compiled my new gcc, as I read it on the web-page (am I right?). >>>My problem is that I can not compile the new gcc(3.3.1). >> >>You don't need gcc. You are looking at compiling C programs cross >>platform with gcc. >>You don't have C programs, you have Pascal programs (FPC). So you need a >>cross pascal compiler. >>However it happens that FPC can generate code for all operating systems on >>an architecture using one binary. (ppc386 in this case) >>What you need are cross binutils. These are on ftp (freepascal.stack.nl), >>and if you need to hand build them, see the script in the fpc source >>repository (fpc/install/cross) >>Then you need to compile the parts of FPC that are OS specific (the >>libraries) for win32. >>In the same CVS dir (fpc/install/cross) there is script that does just that. > >Thanks for the lot of help, now I realized, that I already have those ldw, >asw binaries which are needed by lazarus, because the howto told me to >compile a new binutils. Then I just don't understand why it told me to >compile the gcc... So I've copied those binaries to my $PATH, and set up >lazarus to build to win32, and set up the LCL to win32. >Please allow me to paste the lazarus's output when I try to compile my >project to win32: > >-------------###------------- >... >... >... >[TCompiler.Compile] CmdLine="/home/leva/FreePascal/bin/ppc386 -Rintel >-S2cgi -CD -Ch8000000 -OG1p1 -TWin32 -gl -XD -vewnhi -l >-Fu/home/leva/FreePascal/Lazarus/lcl/units/ >-Fu/home/leva/FreePascal/Lazarus/lcl/units/win32/ >-Fu/home/leva/FreePascal/Lazarus/packager/units/ -Fu. >-o/home/leva/tmp/project1.exe -dLCL /home/leva/tmp/project1.lpr" >TOutputFilter: "Hint: Start of reading config file /home/leva/.fpc.cfg" >TOutputFilter: "Hint: End of reading config file /home/leva/.fpc.cfg" >TOutputFilter: "Free Pascal Compiler version 1.0.10 [2003/06/26] for i386" >TOutputFilter: "Copyright (c) 1993-2003 by Florian Klaempfl" >TOutputFilter: "Hint: Path "/usr/lib/fpc/1.0.10/units/win32/" not found" >TOutputFilter: "Hint: Path "/usr/lib/fpc/1.0.10/units/win32/rtl/" not found" >TOutputFilter: "Target OS: Win32 for i386" >TOutputFilter: "Compiling /home/leva/tmp/project1.lpr" >TOutputFilter: "syswin32.pp(5,1) Hint: Conditional I386 was set at startup >in last compilation of syswin32.pp" >TOutputFilter: "math.pp(6,13) Hint: Conditional I386 was set at startup in >last compilation of math.pp" >TOutputFilter: "Compiling unit1.pas" >TOutputFilter: "Linking /home/leva/tmp/project1.exe" >TOutputFilter: "47 Lines compiled, 1.9 sec" >[TCompiler.Compile] end >NOTE: No debugger defined. Starting program without debugging ... > EXECUTING "/home/leva/tmp/project1.exe" > WorkingDir "/home/leva/tmp/" >[TMainIDE.DoRunProject] END >Xlib: unexpected async reply (sequence 0x1bef4)! >Xlib: unexpected async reply (sequence 0x1c79a)! > >Gdk-WARNING **: GdkWindow 0x4a00461 unexpectedly destroyed > >Gdk-WARNING **: GdkWindow 0x4a00460 unexpectedly destroyed > >Gdk-WARNING **: GdkWindow 0x4a0045f unexpectedly destroyed >Gdk-ERROR **: X connection to :0.0 broken (explicit kill or server shutdown). > >-------------###------------- Ehm... do I get this right here ? Are you creating a win32 executable and running it in Linux ? That won't work. Marc _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

LeVA
to Marco van de Voort: You don't need gcc. You are looking at compiling C programs cross platform with gcc. You…

Marco van de Voort �rta:

Show quoted text 24 lines
>Beacuse no one replied, I thought that it might be useful to spend the >whole night with googling, and searching the answers for this cross >compiling :) >Now it somewhat clearer for me, what should I do. >I found a new howto, which explains this thing a little bit simpler. >Now I realized, that lazarus need these tools (asw, dlltools etc...) to >compile the project to win32. I think that those utils will be there, >after I compiled my new gcc, as I read it on the web-page (am I right?). >My problem is that I can not compile the new gcc(3.3.1). You don't need gcc. You are looking at compiling C programs cross platform with gcc. You don't have C programs, you have Pascal programs (FPC). So you need a cross pascal compiler. However it happens that FPC can generate code for all operating systems on an architecture using one binary. (ppc386 in this case) What you need are cross binutils. These are on ftp (freepascal.stack.nl), and if you need to hand build them, see the script in the fpc source repository (fpc/install/cross) Then you need to compile the parts of FPC that are OS specific (the libraries) for win32. In the same CVS dir (fpc/install/cross) there is script that does just that.

Thanks for the lot of help, now I realized, that I already have those ldw, asw binaries which are needed by lazarus, because the howto told me to compile a new binutils. Then I just don't understand why it told me to compile the gcc... So I've copied those binaries to my $PATH, and set up lazarus to build to win32, and set up the LCL to win32. Please allow me to paste the lazarus's output when I try to compile my project to win32:

-------------###-------------
...
...
...
[TCompiler.Compile] CmdLine="/home/leva/FreePascal/bin/ppc386 -Rintel -S2cgi -CD -Ch8000000 -OG1p1 -TWin32 -gl -XD -vewnhi -l -Fu/home/leva/FreePascal/Lazarus/lcl/units/
-Fu/home/leva/FreePascal/Lazarus/lcl/units/win32/
-Fu/home/leva/FreePascal/Lazarus/packager/units/ -Fu. -o/home/leva/tmp/project1.exe -dLCL /home/leva/tmp/project1.lpr" TOutputFilter: "Hint: Start of reading config file /home/leva/.fpc.cfg" TOutputFilter: "Hint: End of reading config file /home/leva/.fpc.cfg" TOutputFilter: "Free Pascal Compiler version 1.0.10 [2003/06/26] for i386" TOutputFilter: "Copyright (c) 1993-2003 by Florian Klaempfl" TOutputFilter: "Hint: Path "/usr/lib/fpc/1.0.10/units/win32/" not found" TOutputFilter: "Hint: Path "/usr/lib/fpc/1.0.10/units/win32/rtl/" not found" TOutputFilter: "Target OS: Win32 for i386"
TOutputFilter: "Compiling /home/leva/tmp/project1.lpr" TOutputFilter: "syswin32.pp(5,1) Hint: Conditional I386 was set at startup in last compilation of syswin32.pp"
TOutputFilter: "math.pp(6,13) Hint: Conditional I386 was set at startup in last compilation of math.pp"
TOutputFilter: "Compiling unit1.pas"
TOutputFilter: "Linking /home/leva/tmp/project1.exe" TOutputFilter: "47 Lines compiled, 1.9 sec"
[TCompiler.Compile] end
NOTE: No debugger defined. Starting program without debugging ... EXECUTING "/home/leva/tmp/project1.exe"
WorkingDir "/home/leva/tmp/"
[TMainIDE.DoRunProject] END
Xlib: unexpected async reply (sequence 0x1bef4)!
Xlib: unexpected async reply (sequence 0x1c79a)!

Gdk-WARNING **: GdkWindow 0x4a00461 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4a00460 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4a0045f unexpectedly destroyed Gdk-ERROR **: X connection to :0.0 broken (explicit kill or server shutdown).

-------------###-------------

As you can see, my lazarus has been closed. After I clicked the Run button, I could read the messages window, and it told me that, the "Project "project1" Succesfully built :)". But, right after that, all of the lazarus's windows closed. I have compiled lazarus by hand, but I'm using the precompiled version of fpc(ppc386) v1.0.10.

I think I can ignore these lines:
TOutputFilter: "Hint: Path "/usr/lib/fpc/1.0.10/units/win32/" not found" TOutputFilter: "Hint: Path "/usr/lib/fpc/1.0.10/units/win32/rtl/" not found"

because I have installed those libs to an other directory, and I specified this in my .fcp.cfg:

-Fu/home/leva/FreePascal/lib/fpc/1.0.10/units/$target -Fu/home/leva/FreePascal/lib/fpc/1.0.10/units/$target/* -Fu/home/leva/FreePascal/lib/fpc/1.0.10/units/$target/rtl

So I think lazarus found the win32 libs, after searching in these pathes.

But to take no risk, I have symlinked that win32 dir to /usr/lib/.... directory, and tried to Run the project again, and the same happened: lazarus has been terminated.
The error messages are not the same every time, so I paste some other messages as well:

-------------------###-------------------
TOutputFilter: "Linking /home/leva/tmp/project1.exe" TOutputFilter: "47 Lines compiled, 1.8 sec"
[TCompiler.Compile] end
NOTE: No debugger defined. Starting program without debugging ... EXECUTING "/home/leva/tmp/project1.exe"
WorkingDir "/home/leva/tmp/"
[TMainIDE.DoRunProject] END
Xlib: unexpected async reply (sequence 0xac4e)!
Xlib: unexpected async reply (sequence 0xcb23)!

Gdk-WARNING **: GdkWindow 0x4a00461 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4a00460 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4a0045f unexpectedly destroyed

Gtk-CRITICAL **: file gtkobject.c: line 1080 (gtk_object_get_data): assertion `GTK_IS_OBJECT (object)' failed.
Gdk-ERROR **: X connection to :0.0 broken (explicit kill or server shutdown).
-------------------###-------------------

and another:

-------------------###-------------------
TOutputFilter: "Compiling /home/leva/tmp/project1.lpr" TOutputFilter: "syswin32.pp(5,1) Hint: Conditional I386 was set at startup in last compilation of syswin32.pp"
TOutputFilter: "math.pp(6,13) Hint: Conditional I386 was set at startup in last compilation of math.pp"
TOutputFilter: "Compiling unit1.pas"
TOutputFilter: "Linking /home/leva/tmp/project1.exe" TOutputFilter: "47 Lines compiled, 1.9 sec"
[TCompiler.Compile] end
NOTE: No debugger defined. Starting program without debugging ... EXECUTING "/home/leva/tmp/project1.exe"
WorkingDir "/home/leva/tmp/"
[TMainIDE.DoRunProject] END
Xlib: unexpected async reply (sequence 0xbf22)!

Gdk-WARNING **: GdkWindow 0x4e0161b unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e01605 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e01602 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e01540 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e0153f unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e0153e unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e0153d unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e01548 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e01546 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e01547 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e01545 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e01544 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e01542 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e01543 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e01541 unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e0153c unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e0153b unexpectedly destroyed

Gdk-WARNING **: GdkWindow 0x4e0153a unexpectedly destroyed

Gtk-CRITICAL **: file gtkobject.c: line 1080 (gtk_object_get_data): assertion `GTK_IS_OBJECT (object)' failed.
-------------------###-------------------

I'm running Debian/woody, with glibc_2.2.5-11.5, and: libgtk1.2 1.2.10-11
libgtk2.0-0 2.0.2-5woody1

libglib1.2 1.2.10-4
libglib2.0-0 2.0.1-2

ppc386_1.0.10
lazarus 0.9.0

The binutils that I've compiled to get that asw, and other binaries, is 2.14.

If I'm using the "Run / Build" menu only, then lazarus builds my project, and I can run the output binary under windows. Is it normal that the output binary is very big? I mean, there is nothing in my project, but a plain form, and the windows binary is 3mb ( and under xp, an ms-dos window pops up with the project, I don't know if this is normal...).
The bigger problem is, that lazarus terminates when I click Run. Or is this because Lazarus can not run windows executables, and somewhere in the options, I must specify i.e. a wine binary?
Is this some kind of bug in lazarus, or this is squarely my fault, or my system's fault?

Thanks a lot!

Daniel

LeVA

Reply by email

Marco van de Voort
to LeVA: Hello! Beacuse no one replied, I thought that it might be useful to spend the whole night…
Show quoted text 9 lines
Beacuse no one replied, I thought that it might be useful to spend the whole night with googling, and searching the answers for this cross compiling :) Now it somewhat clearer for me, what should I do. I found a new howto, which explains this thing a little bit simpler. Now I realized, that lazarus need these tools (asw, dlltools etc...) to compile the project to win32. I think that those utils will be there, after I compiled my new gcc, as I read it on the web-page (am I right?). My problem is that I can not compile the new gcc(3.3.1).

You don't need gcc. You are looking at compiling C programs cross platform with gcc.

You don't have C programs, you have Pascal programs (FPC). So you need a cross pascal compiler.

However it happens that FPC can generate code for all operating systems on an architecture using one binary. (ppc386 in this case)

What you need are cross binutils. These are on ftp (freepascal.stack.nl), and if you need to hand build them, see the script in the fpc source repository (fpc/install/cross)

Then you need to compile the parts of FPC that are OS specific (the libraries) for win32. In the same CVS dir (fpc/install/cross) there is script that does just that.

Reply by email