[solved] Purpose of file fpc lazarus / 1-Linux ---------------------------------------------------------------------- Ocye · 2010-01-19 15:13 In /usr/local/bin are some freepascal related files including fpc. As far as I can see it is equivalent to /usr/local/lib/fpc//ppc but not a symlink. Reason for my question is crosscompiling: I'm running fpc from svn on a 64bit system and created the 32bit crosscompiler with "make all CPU_TARGET=i386". That results in ppc386 and a changed fpc. Hereafter the standard compiler is 32bit and not 64bit. Running "make all CPU_TARGET=x86_64" produces a ppcrossx64 and not ppcx64. I managed this by removing fpc and creating a symlink from the former ppcx64. After recompiling fpc is 64bit again. I'd like to understand if there is a difference between fpc and ppc. Perhaps a copy is needed since symlinks don't exits under Windows. ---------------------------------------------------------------------- Leledumbo · 2010-01-22 08:28 QuoteRunning "make all CPU_TARGET=x86_64" produces a ppcrossx64 and not ppcx64My guess: Your base fpc are 32bit. All cross compilers have 'cross' before the target architecture. That means, if calling make with certain CPU_TARGET generates ppcXXX instead of ppccrossXXX, the compiler used to build it targets CPU_TARGET already, and isn't a cross compiler. QuoteI'd like to understand if there is a difference between fpc and ppcfpc acts as a driver for ppcXXX. It decides which ppcXXX to call based on the chosen target architecture. ---------------------------------------------------------------------- marcov · 2010-01-22 12:05 Look in http://www.stack.nl/~marcov/buildfaq.pdf paragraph 1.2.5, most notably the second half ---------------------------------------------------------------------- Ocye · 2010-01-22 12:30 My system is 64bit and I cross compile to 32bit. I don't understand the "decides which ppcXXX to call" argument since it calls either ppc386 or ppcx64 depending on my last make procedure. Actually, I think my cross compilation procedure lacks on a "cross" switch. But it runs well and I shouldn't touch it. ---------------------------------------------------------------------- Leledumbo · 2010-01-22 12:41 QuoteI don't understand the "decides which ppcXXX to call" argument since it calls either ppc386 or ppcx64 depending on my last make procedureI think that's because of your last fpc, too. If fpc was compiled as 32bit, then a call to fpc -Px86_64 will call ppccrossx64. But if it's 64bit, then it will call ppcx64 instead. ---------------------------------------------------------------------- marcov · 2010-01-22 13:31 Biarchs, systems with two architectures (typically 32 and 64-bit) are always a pain, since only one can be default. At the moment this is usually the 32-bit, but it depends on built-in preference of the "fpc" binary. IIRC using the default makefile you can "fix" this by also explicitely declare what target the host is. Try passing CPU_SOURCE=x86_64, this probably passes a -P to the fpc binary which then in turn executes ppcx64 I use this when I also have a 64-bit compiler installed to force everything 64-bit (setting both CPU_SOURCE and CPU_TARGET to x86_64) (well, actually I set it all to powerpc64, but the issue is the same) ---------------------------------------------------------------------- Ocye · 2010-01-23 11:04 At this point I was wondering why fpc isn't a symbolic link. Actually, it can be replaced by "ln -s ppcxxx". ---------------------------------------------------------------------- marcov · 2010-01-24 00:17 Quote from: Ocye on January 23, 2010, 12:04:28 pmAt this point I was wondering why fpc isn't a symbolic link. Actually, it can be replaced by "ln -s ppcxxx". Not entirely.  The -P and the -V parameters support more than can be done with a single symlink.