Sign in Join

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

Mailing lists / lazarus / 2015-02

Need suggestion about crosscompile on osx

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

FreeMan

Hello,
I get this link :
http://wiki.lazarus.freepascal.org/Cross_compiling#From_Darwin_to_Windows.2C_Linux_and_others but info is from fink port and directly intall it self. maybe not important but its install fpc 2.6.4. I'm using svn version so I need to built that my self.
I need from osx to fpc-cross-x86-64-linux, fpc-cross-i386-wince this is my fpc-cross compile for win64 command lines, no need binutil make clean all install OS_TARGET=win64 CPU_TARGET=x86_64 make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64

and this link about bin utils, How to built binutils from source http://wiki.lazarus.freepascal.org/Binutils

I need suggestion, how to combine with svn versions? Thank you

Reply by email

Schindler Karl-Michael
Show quoted text 24 lines
Message: 3 Date: Sat, 21 Feb 2015 11:32:32 +0200 From: FreeMan Subject: [Lazarus] Need suggestion about crosscompile on osx To: Lazarus mail list Message-ID: Content-Type: text/plain; charset=utf-8; format=flowed Hello, I get this link : http://wiki.lazarus.freepascal.org/Cross_compiling#From_Darwin_to_Windows.2C_Linux_and_others but info is from fink port and directly intall it self. maybe not important but its install fpc 2.6.4. I'm using svn version so I need to built that my self. I need from osx to fpc-cross-x86-64-linux, fpc-cross-i386-wince this is my fpc-cross compile for win64 command lines, no need binutil make clean all install OS_TARGET=win64 CPU_TARGET=x86_64 make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64 and this link about bin utils, How to built binutils from source http://wiki.lazarus.freepascal.org/Binutils I need suggestion, how to combine with svn versions? Thank you

I am the maintainer of the fink packages and would suggest the following:

1) Use the fink packages for the corresponding binutils. If there are problems or you need another version, I will see, what i can do.

In order to build cross compilers from the recent svn version, you have to take 3 steps.

1) Install the freepascal 32bit, version 2.6.4, either disk images or fink. You need ppc386.
2) Using this version, build the current version of ppc386 from the svn version.
3) Use the current version to build your cross compilers.

If you have difficulties with the details of the corresponding commands, ask. For interactive help i suggest the IRC channel #fpc on irc.freenode.net.

Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150221/fcdcfb9f/attachment.bin>

Reply by email

FreeMan
to Schindler Karl-Michael

Thank you Michael,
I shared before my install update svn script here. http://www.delphiturkiye.com/forum/viewtopic.php?f=6&t=33826 I need suggestion for

3) Use the current version to build your cross compilers.

this is my last test command line
FPMakeOptions="-Px86_64 -o -XPx86_64-linux- -o -Xr -o -Ur -o -Xs -o -O2 -o -n -o -Fu$prefixVolume$fpc_prefix -o -Cg -o -dx86_64 -o -dRELEASE -o -XX -o -CX"
make crossinstall all install INSTALL_PREFIX=$prefixVolume$fpc_prefix OS_TARGET=linux CPU_TARGET=x86_64 CROSSOPT=$FPMakeOptions

I made fpc (3.1.1) But not sure, is it real for fpc x86_64-lnux this is my binutil source command lines
./configure --prefix=/opt/binutils/x86_64-linux
--bindir=/opt/binutils/x86_64-linux/bin --mandir=/usr/local/share/man --infodir=/usr/local/share/info --program-prefix=x86_64-linux- --disable-werror

In lazarus, for test in new empty project's Compiler options --> Config and target-> Target OS= Linux Target CPU=x86_64
on compiling I get this error
project1.lpr(20,1) Error: Util x86_64-linux-ld not found, switching to external linking
x86_64-linux-ld not found my system, something wrong on my binutils too. I need help about for this.

Schindler Karl-Michael wrote 13 lines
I am the maintainer of the fink packages and would suggest the following: 1) Use the fink packages for the corresponding binutils. If there are problems or you need another version, I will see, what i can do. In order to build cross compilers from the recent svn version, you have to take 3 steps. 1) Install the freepascal 32bit, version 2.6.4, either disk images or fink. You need ppc386. 2) Using this version, build the current version of ppc386 from the svn version. 3) Use the current version to build your cross compilers. If you have difficulties with the details of the corresponding commands, ask. For interactive help i suggest the IRC channel #fpc on irc.freenode.net. Michael.

Reply by email

Anthony Walter
to FreeMan: I get this link : http://wiki.lazarus.freepascal.org/Cross_compiling#From_Darwin_to_Window…

The Free Pascal and Lazarus bundled here:

http://www.getlazarus.org/setup/#macintosh

Contains ready made and configured cross compilers for:

OSX i386
OSX x86_64
Linux i386
Linux x86_64
Win32 i386
Win64 x86_64

Just choose your build mode from one of the above options inside Lazarus, and press compile.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150221/73618ab6/attachment.html>

Reply by email

Anthony Walter
to FreeMan

You have to make all cross compile targets using fpc 2.6.4 as your working compiler, and fpc 3.x as your source code compiler.

First you build a fpc 3.x compiler. Assuming you want to install off your home folder somewhere, build fpc.3.x and cross compilers on osx like so:

# wherever you put the fpc.x source code
# i recommend somewhere under your home folder
BASE=$HOME/path/to/fpc.3.x

# make and install the default fpc.3.x compiler
make all
make install INSTALL_PREFIX=$BASE
# make the cross compilers
make crossinstall OS_TARGET=osx CPU_TARGET=x86_64 INSTALL_PREFIX=$BASE make crossinstall OS_TARGET=linux CPU_TARGET=x86_64 INSTALL_PREFIX=$BASE make crossinstall OS_TARGET=linux CPU_TARGET=i386 INSTALL_PREFIX=$BASE make crossinstall OS_TARGET=win32 CPU_TARGET=i386 INSTALL_PREFIX=$BASE make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=$BASE

# copy the compilers to the bin folder
cp $BASE/lib/fpc/$FPC_BUILD/* $BASE/bin

# make changes to your path
OLDPATH=$PATH
export PPC_CONFIG_PATH=$BASE/fpc/bin
export PATH=$PPC_CONFIG_PATH:$OLDPATH

# create a new fpc.cfg in the compiler folder
$PPC_CONFIG_PATH/fpcmkcfg -d basepath=$BASE/lib/fpc/\$FPCVERSION -o $PPC_CONFIG_PATH/fpc.cfg

# test the compiler path and configuration
cd $HOME
fpc -iv

You should see 3.0.1 if using svn fixes_3_0 branch.

Next you need to find the cross compiler tools and place them in the fpc bin folder which is:

$BASE/bin

They are named like fpc.3.x/bin/i386-linux-as or
fpc.3.x/bin/x86_64-linux-ld. You need about 30 of these tools for all platforms in total.

After that then you need to find the cross compiler libs, and place them in: $BASE/lib/$CPUTARGET_$OSTARGET

These are files like fpc.3.x/lib/x86_64-linux/libcairo.so or fpc.3.x/lib/i386-win32/user32.dll. There's probably 200 or so of these files you'll need.

I can't tell you where to get these files, but if you're desperate you can pull them out of my bundle.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150222/d5f19e2d/attachment.html>

Reply by email

FreeMan
to Anthony Walter
Anthony Walter wrote 6 lines
# make and install the default fpc.3.x compiler make all make install INSTALL_PREFIX=$BASE # make the cross compilers make crossinstall OS_TARGET=osx CPU_TARGET=x86_64 INSTALL_PREFIX=$BASE make crossinstall OS_TARGET=linux CPU_TARGET=x86_64 INSTALL_PREFIX=$BASE

Thank you so much for sharing Anthony
If I'm not wrong OS_TARGET=osx has to be OS_TARGET=darwin

They are named like fpc.3.x/bin/i386-linux-as or fpc.3.x/bin/x86_64-linux-ld. You need about 30 of these tools for all platforms in total.

I have that. I created them from binutils source.
We talked this with Michael, I don't like copy everything to bin or x folder. 'cos there ar be like a trash can. Later can forget file name and version problem, conflict files etc. problem. My solution is, I found this working on linux, make symbolic link. ls command show thats in list, lint attribute and target folder. If copied file I have to remember it name.
Just notice for binutil: When I working, I made link to /usr/local/bin folder for ld file, compiler not found it, when I moved link's target to/bin folder, its compile now.

Show quoted text 5 lines
These are files like fpc.3.x/lib/x86_64-linux/libcairo.so or fpc.3.x/lib/i386-win32/user32.dll. There's probably 200 or so of these files you'll need. I can't tell you where to get these files, but if you're desperate you can pull them out of my bundle.

My plan for testing, Install other os in virtualbox, I can find in there what I need library. But no need to loose time for looking for, you did thats. Thank you for this.

this is my bimutils configure for linux x64, don't forget make & make install
./configure \
--target=x86_64-linux \
--prefix=/opt/binutils/x86_64-linux \
--bindir=/opt/binutils/x86_64-linux/bin --mandir=/usr/local/share/man --infodir=/usr/local/share/info \
--program-prefix=x86_64-linux- \
--disable-werror

this is my i386-wince configure for bin util, but I get error ./configure \
--target=i386-wince \
--prefix=/opt/binutils/i386-wince \
--bindir=/opt/binutils/i386-wince/bin --mandir=/usr/local/share/man --infodir=/usr/local/share/info \
--program-prefix=i386-wince- \
--disable-werror

in result,
checking for version 0.12 of ISL... no
rm: conftest.dSYM: is a directory --> here is a error but I couldn't find yet maybe some one help this
checking for default BUILD_CONFIG...

and this is make error
checking linker --as-needed support... no
*** BFD does not support target i386-pc-wince.
*** Look in bfd/config.bfd for supported targets.
make[1]: *** [configure-bfd] Error 1
make: *** [all] Error 2

Reply by email