Recent

Author Topic: Cross compiling  (Read 1465 times)

robsean

  • New Member
  • *
  • Posts: 12
Cross compiling
« on: April 29, 2021, 05:25:51 am »
Hello everyone:

I've been working on cross compiling recently .

Now I have some problems. Can you help me solve them?

The first question is:From win32 to win64
Refer to:
https://wiki.freepascal.org/Cross_compiling#From_win32_to_win64
https://www.freepascal.org/docs-html/current/prog/progsu220.html#x333-349000F.3.2
I typed in the command line:
make all OS_TARGET=win64 CPU_TARGET=x86_64
then,I got a mistake

The second question is:From win32 to linux
Refer to:
http://www.stack.nl/~marcov/buildfaq.pdf
https://www.freepascal.org/docs-html/current/prog/progsu220.html#x333-349000F.3.2
I typed in the command line:
make all OS_TARGET=linux CPU_TARGET=x86_64
then,I got a mistake

I typed in the command line:
make OS_TARGET=linux all
then,I got a mistake

PascalDragon

  • Hero Member
  • *****
  • Posts: 3059
  • Compiler Developer
Re: Cross compiling
« Reply #1 on: April 29, 2021, 09:24:08 am »
Now I have some problems. Can you help me solve them?

You need to execute the make all in the top level directory (in your case the fpc-3.2.0 one), not the compiler one.

ccrause

  • Sr. Member
  • ****
  • Posts: 389
Re: Cross compiling
« Reply #2 on: April 29, 2021, 09:43:54 am »
Now I have some problems. Can you help me solve them?

You need to execute the make all in the top level directory (in your case the fpc-3.2.0 one), not the compiler one.
That means Appendix F.3.2 of the programmers guide needs to be updated. The instructions start with cd compiler.

Edit: Bug report: https://bugs.freepascal.org/view.php?id=38822
« Last Edit: April 29, 2021, 10:07:43 am by ccrause »

robsean

  • New Member
  • *
  • Posts: 12
Re: Cross compiling
« Reply #3 on: April 29, 2021, 02:23:33 pm »
Now I have some problems. Can you help me solve them?

You need to execute the make all in the top level directory (in your case the fpc-3.2.0 one), not the compiler one.
Thank you.
Now,From win32 to win64 has been successful.

But,There are still some problems From win32 to linux

I typed in the command line:
make all OS_TARGET=linux CPU_TARGET=x86_64
then,I got a mistake


I typed in the command line:
make all OS_TARGET=linux
then,I got a mistake

ccrause

  • Sr. Member
  • ****
  • Posts: 389
Re: Cross compiling
« Reply #4 on: April 29, 2021, 04:55:06 pm »
Now I have some problems. Can you help me solve them?

You need to execute the make all in the top level directory (in your case the fpc-3.2.0 one), not the compiler one.
That means Appendix F.3.2 of the programmers guide needs to be updated. The instructions start with cd compiler.

Edit: Bug report: https://bugs.freepascal.org/view.php?id=38822
Feedback from Marco in the bug report:
Quote
The example for cross-compile in the manual is "make cycle"

So the OP should be able to build the compiler in the compiler folder by using the command make cycle ..., if the other problems are also fixed of course.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9336
  • FPC developer.
Re: Cross compiling
« Reply #5 on: April 29, 2021, 05:30:19 pm »
make cycle in the compiler/ 

or

make all at toplevel (which runs cycle in compiler/)

See buildfaq :-)

Robsean's recent failures are probably binutils problems. (32-bit linker not recognizing link.res due to age or crlf issues?, and not installed 64-bit binutils)
« Last Edit: April 29, 2021, 05:34:18 pm by marcov »

robsean

  • New Member
  • *
  • Posts: 12
Re: Cross compiling
« Reply #6 on: April 30, 2021, 04:12:12 am »
make cycle in the compiler/ 

or

make cycle at toplevel (which runs cycle in compiler/)

See buildfaq :-)

Robsean's recent failures are probably binutils problems. (32-bit linker not recognizing link.res due to age or crlf issues?, and not installed 64-bit binutils)

Thank you
Now, I know the difference between make cycle and make cycle. From win32 to win64, They are both work well.
And at the beginning, I  have noticed the difference between  make cycle and make cycle,but I didn't know their specific usage.

the wiki,the programmers guide ,and the buildfaq.pdf,I have read them carefully many times and even translated some contents into Chinese.

From win32 to linux :

the win32-binutils come from the bwin32  ftp://ftp.freepascal.org/pub/fpc/dist/3.2.0/source/fpcbuild-3.2.0.zip ,the bootstrap comes from the  ppc386.exe ftp://ftp.freepascal.org/pub/fpc/dist/3.2.0/bootstrap/i386-win32-ppc386.zip,the cross binutils come from the binutils-2.15-win32-i386-linux.zip ftp://ftp.freepascal.org/pub/fpc/contrib/cross/mingw/binutils-2.15-win32-i386-linux.zip

but they can not work

From win64 to linux :
the win64-binutils come from the bwin64  ftp://ftp.freepascal.org/pub/fpc/dist/3.2.0/source/fpcbuild-3.2.0.zip ,the bootstrap comes from the  ppc386.exe ftp://ftp.freepascal.org/pub/fpc/dist/3.2.0/bootstrap/i386-win32-ppc386.zip,the cross binutils come from the win32crossbinutils2005.zip of the x86_64-linux ftp://ftp.freepascal.org/pub/fpc/contrib/cross/mingw/win32crossbinutils2005.zip

but they can not work too

PS:CPU--intel 64bit OS--windows 7 32bit &64bit

 

TinyPortal © 2005-2018