[fpc-pascal] FPC cross compilation error: cannot find -lgcc
patspiper
patspiper at gmail.com
Sat May 4 21:59:14 CEST 2013
On 12/04/13 00:11, patspiper wrote:
> On 12/04/13 00:08, patspiper wrote:
>> On 11/04/13 23:25, Marco van de Voort wrote:
>>> In our previous episode, patspiper said:
>>>> Cross compilation from Ubuntu 32 bit to Win32, WIn64, and Linux 64
>>>> works
>>>> well with FPC 2.6.0.
>>>>
>>>> With FPC 2.7.1, any cross compilation yields a 'cannot find -lgcc'
>>>> error.
>>> Linking what file generates that error when crosscompiling to win32
>>> or win64?
>> Below is the relevant part of the log for Win32 with FPC2.7.1
>> (fpmake.pp):
>>
>> make -C packages smart
>> make[2]: Entering directory
>> `/home/me/Programs/fpc/fpsrc/exported/2.7.1/packages'
>> make -C fpmkunit bootstrap
>> make[3]: Entering directory
>> `/home/me/Programs/fpc/fpsrc/exported/2.7.1/packages/fpmkunit'
>> /bin/mkdir -p units_bs/i386-linux
>> /home/me/Programs/fpc/fpsrc/exported/2.7.1/compiler/ppc
>> src/fpmkunit.pp -n
>> -Fu/home/me/Programs/fpc/fpsrc/exported/2.7.1/rtl/units/i386-linux
>> -Fu/home/me/Programs/fpc/fpsrc/exported/2.7.1/packages/paszlib
>> -Fu/home/me/Programs/fpc/fpsrc/exported/2.7.1/packages/fcl-process
>> -Fu/home/me/Programs/fpc/fpsrc/exported/2.7.1/packages/hash
>> -FUunits_bs/i386-linux -Fu../paszlib/src -Fu../hash/src
>> -Fi../paszlib/src -Fi../fcl-process/src/unix -Fu../fcl-process/src
>> -Fi../fcl-process/src/linux -Fi../fcl-process/src/dummy -Xd -Xt -gl
>> make[3]: Leaving directory
>> `/home/me/Programs/fpc/fpsrc/exported/2.7.1/packages/fpmkunit'
>> /home/me/Programs/fpc/fpsrc/exported/2.7.1/compiler/ppc fpmake.pp -n
>> -Fu/home/me/Programs/fpc/fpsrc/exported/2.7.1/packages/fpmkunit/units_bs/i386-linux
>> -Fu/home/me/Programs/fpc/fpsrc/exported/2.7.1/rtl/units/i386-linux
>> -Xd -Xt -gl
>> /usr/bin/ld: warning: link.res contains output sections; did you
>> forget -T?
>> /home/me/Programs/fpc/fpsrc/exported/2.7.1/rtl/units/i386-linux/cthreads.o:
>> In function `CTHREADS_$$_init':
>> /home/me/Programs/fpc/fpsrc/exported/2.7.1/rtl/linux/../unix/cthreads.pp:1032:
>> warning: Using 'dlopen' in statically linked applications requires at
>> runtime the shared libraries from the glibc version used for linking
>> /usr/bin/ld: cannot find -lgcc
>> fpmake.pp(33,1) Error: Error while linking
>> fpmake.pp(33,1) Fatal: There were 1 errors compiling module, stopping
>> Fatal: Compilation aborted
>> make[2]: *** [fpmake] Error 1
>> make[2]: Leaving directory
>> `/home/me/Programs/fpc/fpsrc/exported/2.7.1/packages'
>> make[1]: *** [packages_smart] Error 2
>>
>> Linux 64 with FPC2.6.3 fails while linking fpdoc.pp:
>> /home/me/Programs/fpc/fpsrc/exported/2.6.3/compiler/ppcrossx64
>> -Px86_64 -XPx86_64-linux- -Xr
>> -Fl/home/me/Programs/fpc/crossbinutils/lib//x86_64-linux -Ur -Xs -O2
>> -n -S2h
>> -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.3/rtl/units/x86_64-linux
>> -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.3/packages/fcl-base/units/x86_64-linux
>> -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.3/packages/iconvenc/units/x86_64-linux
>> -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.3/packages/fcl-xml/units/x86_64-linux
>> -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.3/packages/fcl-passrc/units/x86_64-linux
>> -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.3/packages/chm/units/x86_64-linux
>> -FD/home/me/Programs/fpc/crossbinutils/bin -FE. -FUunits/x86_64-linux
>> -Cg -Flinclude -Fl/etc/ld.so.conf.d/*.conf -Xd -Xt -gl -dx86_64
>> -dRELEASE fpdoc.pp
>> /home/me/Programs/fpc/crossbinutils/bin/x86_64-linux-ld: warning:
>> ./link.res contains output sections; did you forget -T?
>> /home/me/Programs/fpc/crossbinutils/bin/x86_64-linux-ld: cannot find
>> -lgcc
>> /home/me/Programs/fpc/crossbinutils/bin/x86_64-linux-ld: cannot find -lc
>
> Just to clarify: It is the building of the cross compiler that fails.
Bump
Note: I have submitted 2 related bug reports:
http://bugs.freepascal.org/view.php?id=24262
http://bugs.freepascal.org/view.php?id=24372
Stephano
More information about the fpc-pascal
mailing list