Hi,
Is it possible to build cross binutils to produce win 64 bit files on a 32 bit Linux OS (Ubuntu 32 bit)?
If I set target=x86_64-cygwin, the error is:
'BFD does not support target x86_64-pc-cygwin'
Stephano

Mailing lists / fpc-pascal / 2013-04
18 messages · 9 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
Is it possible to build cross binutils to produce win 64 bit files on a 32 bit Linux OS (Ubuntu 32 bit)?
If I set target=x86_64-cygwin, the error is:
'BFD does not support target x86_64-pc-cygwin'
Stephano
Why don't you install binutils-mingw-w64 package? [Note: I don't have Ubuntu, so I don't know whether it exists for your specific version of Ubuntu]
Regards,
Sven
New fedora's also have complete binutils for 32/64 bit.
zeljko
Why don't you install binutils-mingw-w64 package? [Note: I don't have Ubuntu, so I don't…
binutils-mingw-w64 package does not exist for Ubuntu 11.04 (my OS), although it is available in Ubuntu 12.10.
In any case, I have built myself cross binutils for i386/Win32 (cygwin and mingw32), x86_64/Linux, arm/WinCE, and arm/Linux. As an exercise, I would like to do the same for Win64.
Any tips?
Stephano
The i386-win32 to x86_64-win64 cross-tools give this information:
E:\pas>x86_64-win64-as --version
GNU assembler (GNU Binutils) 2.22
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-w64-mingw32'.
So building Binutils with --target=x86_64-w64-mingw32 should work for you.
Pierre Muller
It does indeed!
As for cygwin 64 bits, it seems that a patch for cygwin 64 support was applied on 4.3.2013
(http://cygwin.cybermirror.org/64bit/x86_64-pc-cygwin-binutils-20130304.patch), but it seems it is still not included in binutils 2.23.2
Thanks!
Stephano
Anyhow, there is no cygwin target for Free Pascal, neither win32 nor win64.
It wouldn't be impossible to create...
but someone would have to volunteer!
Pierre Muller
Anyhow, there is no cygwin target for Free Pascal,
neither win32 nor win64.
Could I ask what for? Cygwin is Unix emulation layer on M$ Windows, what is it good for when you can target Windows natively?
Anyhow, there is no cygwin target for Free Pascal, neither win32 nor win64. It wouldn't…
My Linux->Win32 cross compilation uses cygwin cross binutils.
i686-cygwin-as --version:
GNU assembler (GNU Binutils) 2.23.1
Copyright 2012 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty.
This assembler was configured for a target of `i686-cygwin'.
However, I have been recently plagued with a snag when creating cross compilers (from Ubuntu 32 bits):
i386-win32 / FPC 2.6.3: success
x86_64-win64 / FPC 2.6.3: success
x86_64-linux / FPC 2.6.3: fail
arm-winCE / FPC 2.6.3: success
arm-linux / FPC 2.6.3: fail
i386-win32 / FPC 2.7.1: fail
x86_64-win64 / FPC 2.7.1: fail
x86_64-linux / FPC 2.7.1: fail
arm-winCE / FPC 2.7.1: fail
arm-linux / FPC 2.7.1: fail
The failure message is always similar to:
.../fpc/crossbinutils/bin/x86_64-linux-ld: warning: ./link.res contains output sections; did you forget -T?
.../fpc/crossbinutils/bin/x86_64-linux-ld: cannot find -lgcc .../fpc/crossbinutils/bin/x86_64-linux-ld: cannot find -lc fpdoc.pp(382,1) Error: Error while linking
I am clueless at this stage.
Stephano
The i386-win32 to x86_64-win64 cross-tools give this information: E:\pas>x86_64-win64-as…
On Windows, using FPC 2.7.1, I use:
make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64
But this not works. I always got the error:
================================================
W:/md/dev/freepascal/compiler/2.7.1/compiler/ppc.exe fpmake.pp -FuW:/md/dev/fre epascal/compiler/2.7.1/packages/fpmkunit/units_bs/i386-win32 -FuW:/md/dev/freepa scal/compiler/2.7.1/rtl/units/i386-win32
Fatal: Can't find unit process used by fpmkunit
Fatal: Compilation aborted
make[3]: *** [fpmake] Error 1
make[3]: Leaving directory `W:/md/dev/freepascal/compiler/2.7.1/packages' make[2]: *** [packages_all] Error 2
make[2]: Leaving directory `W:/md/dev/freepascal/compiler/2.7.1' make[1]: *** [build-stamp.x86_64-win64] Error 2
make[1]: Leaving directory `W:/md/dev/freepascal/compiler/2.7.1' make: *** [crossinstall] Error 2
================================================
Using FPC 2.6.2 works perfectly.
Best regards,
Marcos Douglas
As well as --program-prefix=x86_64-win64-
My complete configure command is:
./configure --target=x86_64-w64-mingw32 --prefix=/usr/local/lib/x86_64-win64 --bindir=/usr/local/bin --mandir=/usr/local/share/man --infodir=/usr/local/share/info --program-prefix=x86_64-win64- --disable-werror
The prefix and the program-prefix enable the coexistence of several crossbinutils.
On Thu, Apr 11, 2013 at 8:15 AM, Pierre Free Pascal On Windows, using FPC 2.7.1, I use:…
Starting with fpc-2.6.2 release,
this completes successfully for me:
make distclean crossinstall OS_TARGET=win64 CPU_TARGET=x86_64 PREFIX=e:/pas/fpc-2.7.1
Stating with a 2.7.1 win32 binary:
E:\pas>fpc -iVDW
2.7.1 2013/03/28 2.7.1-r1:24029M
(Meaning that I do have some local modifications, but I doubt those interfere with your problem...) I get the same success...
Did you use a distclean before the crossinstall?
win32 fpmake.exe generated for native win32 target might be a problem... I checked, and indeed, if you just do a native install followed by a crossinstall without a distclean in between, you do get
E:/pas/trunk/fpcsrc/compiler/ppc.exe src/fpmkunit.pp -FuE:/pas/trunk/fpcsrc/rtl/units/i386-win32 -FuE:/pas/trunk/fpcsrc /packages/paszlib/units/i386-win32 -FuE:/pas/trunk/fpcsrc/packages/fcl-process/units/i386-win32 -FuE:/pas/trunk/fpcsrc/p ackages/hash/units/i386-win32 -FUunits_bs/i386-win32 -Fu../paszlib/src -Fu../hash/src -Fi../paszlib/src -Fi../fcl-proce ss/src/win -Fu../fcl-process/src -Fi../fcl-process/src/win32 -Fi../fcl-process/src/dummy make[4]: Leaving directory `E:/pas/trunk/fpcsrc/packages/fpmkunit' E:/pas/trunk/fpcsrc/compiler/ppc.exe fpmake.pp -FuE:/pas/trunk/fpcsrc/packages/fpmkunit/units_bs/i386-win32 -FuE:/pas/t runk/fpcsrc/rtl/units/i386-win32
Fatal: Can't find unit process used by fpmkunit
Fatal: Compilation aborted
make[3]: *** [fpmake] Error 1
So the solution to your problem really is
to run a 'distclean' make target before the 'crossinstall' target.
Pierre Muller
neither win32 nor win64. Could I ask what for? Cygwin is Unix emulation layer on M$…
not that i use either but...
why use cygwin when mingw is available?
what is the difference between the two?
can i compile an app with either one and then run that app natively on winwhatever /without/ having to install either cygwin or mingw?
Starting with fpc-2.6.2 release, this completes successfully for me: make distclean…
Thank you very much, worked!
I used "distclean" before, but I don't remember why I remove from my script.
Do you know if 'make clean' and 'make distclean' is the same?
Regards,
Marcos Douglas
not that i use either but... why use cygwin when mingw is available? what is the…
why use cygwin when mingw is available?
Highly *nix tied programs that needs quick porting can use it (e.g.: those that use X11).
what is the difference between the two?
MinGW doesn't implement the *nix layer (Msys does, though only for the shell and small programs, not the whole system), it only consists of GCC port (with binutils and friends) linked against M$ C runtime library.
can i compile an app with either one and then run that app natively on
winwhatever /without/ having to install either cygwin or mingw?
All Cygwin binaries depend on cygwin1.dll, so you must distribute that with the program. With MinGW, there's a smaller C runtime library that must be distributed as well. I don't remember either provide statically linked version of those libraries.
On Thu, Apr 11, 2013 at 12:53 PM, Pierre Free Pascal Thank you very much, worked! I used…
Do you know if 'make clean' and 'make distclean' is the same?
http://www.freepascal.org/docs-html/prog/progse77.html
Highly *nix tied programs that needs quick porting can use it (e.g.: those that use X11).…
leledumbo wrote> why use cygwin when mingw is available? Highly *nix tied programs that needs quick porting can use it (e.g.: those that use X11).
ok...
hummm... ok...
thank you for the information... i've marked it to be saved for future reference if it comes up for my needs ;)
I believe that mingw binutils (included with our releases) do not require any additional library.
Moreover, one must distinguish compiling an aplication with cygwin port of GCC from using cygwin binutils for assembling and/or linking applications compiled with FPC (or some other compiler) - there are no direct implications regarding runtimes, etc., for the latter (equally to mingw binutils).
Tomas