Sign in Join

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

Mailing lists / fpc-pascal / 2012-10

Failed cross compilation

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

patspiper

Hi,

I am able to compile FPC 2.6.1 (rev 22778) under Ubuntu 11.04 32 bits. However cross compiling to win32 fails with the error: /usr/bin/ld: cannot find -lgcc

I was able to cross compile successfully about 2 weeks ago.

The relevant part of the log:
make -C fastcgi smart
make[3]: Entering directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fastcgi' /home/me/Programs/fpc/fpsrc/exported/2.6.1/compiler/ppc fpmake.pp -n -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/units/i386-linux -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/hash -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/paszlib -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fcl-process -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fpmkunit/units_bs/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.6.1/rtl/units/i386-linux/cthreads.o: In function `LOADPTHREADS':
/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/linux/pthread.inc:261: 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(34,1) Error: Error while linking
fpmake.pp(34,1) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
make[3]: *** [fpmake] Error 1
make[3]: Leaving directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fastcgi' make[2]: *** [fastcgi_smart] Error 2
make[2]: Leaving directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages' make[1]: *** [packages_smart] Error 2
make[1]: Leaving directory `/home/me/Programs/fpc/fpsrc/exported/2.6.1' make: *** [build-stamp.i386-win32] Error 2

What could have gone wrong?

Stephano

Marco van de Voort
to patspiper

In our previous episode, patspiper said:

Show quoted text 38 lines
I am able to compile FPC 2.6.1 (rev 22778) under Ubuntu 11.04 32 bits. However cross compiling to win32 fails with the error: /usr/bin/ld: cannot find -lgcc I was able to cross compile successfully about 2 weeks ago. The relevant part of the log: make -C fastcgi smart make[3]: Entering directory `/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fastcgi' /home/me/Programs/fpc/fpsrc/exported/2.6.1/compiler/ppc fpmake.pp -n -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/units/i386-linux -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/hash -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/paszlib -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fcl-process -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fpmkunit/units_bs/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.6.1/rtl/units/i386-linux/cthreads.o: In function `LOADPTHREADS': /home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/linux/pthread.inc:261: 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(34,1) Error: Error while linking fpmake.pp(34,1) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted make[3]: *** [fpmake] Error 1 make[3]: Leaving directory `/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fastcgi' make[2]: *** [fastcgi_smart] Error 2 make[2]: Leaving directory `/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages' make[1]: *** [packages_smart] Error 2 make[1]: Leaving directory `/home/me/Programs/fpc/fpsrc/exported/2.6.1' make: *** [build-stamp.i386-win32] Error 2 What could have gone wrong?

There were changes merged. I wonder however how a crosscompile to win32 can reach "fastcgi" still being target linux.

Could you post your build cmdline please?

patspiper
to Marco van de Voort
Marco van de Voort wrote 43 lines
In our previous episode, patspiper said: > I am able to compile FPC 2.6.1 (rev 22778) under Ubuntu 11.04 32 bits. > However cross compiling to win32 fails with the error: /usr/bin/ld: > cannot find -lgcc > > I was able to cross compile successfully about 2 weeks ago. > > The relevant part of the log: > make -C fastcgi smart > make[3]: Entering directory > `/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fastcgi' > /home/me/Programs/fpc/fpsrc/exported/2.6.1/compiler/ppc fpmake.pp -n > -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/units/i386-linux > -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/hash > -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/paszlib > -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fcl-process > -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fpmkunit/units_bs/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.6.1/rtl/units/i386-linux/cthreads.o: > In function `LOADPTHREADS': > /home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/linux/pthread.inc:261: > 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(34,1) Error: Error while linking > fpmake.pp(34,1) Fatal: There were 1 errors compiling module, stopping > Fatal: Compilation aborted > make[3]: *** [fpmake] Error 1 > make[3]: Leaving directory > `/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fastcgi' > make[2]: *** [fastcgi_smart] Error 2 > make[2]: Leaving directory > `/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages' > make[1]: *** [packages_smart] Error 2 > make[1]: Leaving directory `/home/me/Programs/fpc/fpsrc/exported/2.6.1' > make: *** [build-stamp.i386-win32] Error 2 > > What could have gone wrong? There were changes merged. I wonder however how a crosscompile to win32 can reach "fastcgi" still being target linux. Could you post your build cmdline please?

The build command line (part of a script) is:
${MAKE} clean all LIBDIR=${BASELIBDIR}/${MCPU}-${MOS} CROSSBINDIR=${CROSSTOOLSROOT}bin OS_TARGET=${OS} CPU_TARGET=${CPU} BINUTILSPREFIX=${MCPU}-${MOS}- OPT="-Xd -Xt ${EXTRAOPT}"

Upon closer inspection of the log (relevant portions in bold):
- Some make code is seeping into the command line
- fastcgi is being compiled using ppc and not ppcross386.

I can attach the whole log if needed.

<snip>
make -C fcl-web distclean
make[2]: Entering directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fcl-web' { ./fpmake distclean --localunitdir=../.. --globalunitdir=.. --os=win32 --cpu=i386 -o -Twin32 -o -XPi686-cygwin- -o -Xr -o -Fl/home/me/Programs/fpc/crossbinutils/lib//i686-cygwin -o -Ur -o -Xs -o -O2 -o -n -o -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl -o -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/hash -o -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/paszlib -o -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fcl-process -o -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fpmkunit -o -FD/home/me/Programs/fpc/crossbinutils/bin -o -FE. -o -FUunits/i386-win32 -o -Xd -o -Xt -o -gl -o -di386 -o -dRELEASE --compiler=/home/me/Programs/fpc/2.6.1/lib/fpc/2.6.1/ppc386; *if [ $? != "0" ]; then { echo Something wrong with fpmake exectable. Remove the executable and call make recursively to recover**.; /bin/rm -f ./fpmake; make fpc_cleanall; }; fi; }*
Clean of package fcl-web completed
/bin/rm -f ./fpmake
make[2]: Leaving directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fcl-web' make -C fastcgi distclean
make[2]: Entering directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fastcgi' { ./fpmake distclean --localunitdir=../.. --globalunitdir=.. --os=win32 --cpu=i386 -o -Twin32 -o -XPi686-cygwin- -o -Xr -o -Fl/home/me/Programs/fpc/crossbinutils/lib//i686-cygwin -o -Ur -o -Xs -o -O2 -o -n -o -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl -o -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/hash -o -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/paszlib -o -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fcl-process -o -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fpmkunit -o -FD/home/me/Programs/fpc/crossbinutils/bin -o -FE. -o -FUunits/i386-win32 -o -Xd -o -Xt -o -gl -o -di386 -o -dRELEASE --compiler=/home/me/Programs/fpc/2.6.1/lib/fpc/2.6.1/ppc386; *if [ $? != "0" ]; then { echo Something wrong with fpmake exectable. Remove the executable and call make recursively to recover.; /bin/rm -f ./fpmake; make fpc_cleanall; }; fi; }*
Clean of package fastcgi completed
<snip>

<snip>
make -C hermes smart
make[3]: Entering directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/hermes' make all LINKSMART=1 CREATESMART=1
make[4]: Entering directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/hermes' /bin/mkdir -p units/i386-win32
/home/me/Programs/fpc/fpsrc/exported/2.6.1/compiler/ppcross386 -Twin32 -XPi686-cygwin- -Xr
-Fl/home/me/Programs/fpc/crossbinutils/lib//i686-cygwin -XX -CX -Ur -Xs -O2 -n -dI386_ASSEMBLER
-Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/units/i386-win32 -Fisrc -FD/home/me/Programs/fpc/crossbinutils/bin -FE. -FUunits/i386-win32 -Xd -Xt -gl -di386 -dRELEASE src/hermes.pp make[4]: Leaving directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/hermes' make[3]: Leaving directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/hermes' make -C httpd22 smart
make[3]: Entering directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/httpd22' make all LINKSMART=1 CREATESMART=1
make[4]: Entering directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/httpd22' /bin/mkdir -p units/i386-win32
/home/me/Programs/fpc/fpsrc/exported/2.6.1/compiler/ppcross386 -Twin32 -XPi686-cygwin- -Xr
-Fl/home/me/Programs/fpc/crossbinutils/lib//i686-cygwin -XX -CX -Ur -Xs -O2 -n
-Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/units/i386-win32 -Fisrc -Fisrc/apr -Fisrc/apriconv -Fisrc/aprutil
-FD/home/me/Programs/fpc/crossbinutils/bin -FE. -FUunits/i386-win32 -Flinclude -Fl/etc/ld.so.conf.d/*.conf -Xd -Xt -gl -di386 -dRELEASE src/apr/apr.pas
/home/me/Programs/fpc/fpsrc/exported/2.6.1/compiler/ppcross386 -Twin32 -XPi686-cygwin- -Xr
-Fl/home/me/Programs/fpc/crossbinutils/lib//i686-cygwin -XX -CX -Ur -Xs -O2 -n
-Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/units/i386-win32 -Fisrc -Fisrc/apr -Fisrc/apriconv -Fisrc/aprutil
-FD/home/me/Programs/fpc/crossbinutils/bin -FE. -FUunits/i386-win32 -Flinclude -Fl/etc/ld.so.conf.d/*.conf -Xd -Xt -gl -di386 -dRELEASE src/apriconv/apriconv.pas
/home/me/Programs/fpc/fpsrc/exported/2.6.1/compiler/*ppcross386* -Twin32 -XPi686-cygwin- -Xr
-Fl/home/me/Programs/fpc/crossbinutils/lib//i686-cygwin -XX -CX -Ur -Xs -O2 -n
-Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/units/i386-win32 -Fisrc -Fisrc/apr -Fisrc/apriconv -Fisrc/aprutil
-FD/home/me/Programs/fpc/crossbinutils/bin -FE. -FUunits/i386-win32 -Flinclude -Fl/etc/ld.so.conf.d/*.conf -Xd -Xt -gl -di386 -dRELEASE src/aprutil/aprutil.pas
/home/me/Programs/fpc/fpsrc/exported/2.6.1/compiler/ppcross386 -Twin32 -XPi686-cygwin- -Xr
-Fl/home/me/Programs/fpc/crossbinutils/lib//i686-cygwin -XX -CX -Ur -Xs -O2 -n
-Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/units/i386-win32 -Fisrc -Fisrc/apr -Fisrc/apriconv -Fisrc/aprutil
-FD/home/me/Programs/fpc/crossbinutils/bin -FE. -FUunits/i386-win32 -Flinclude -Fl/etc/ld.so.conf.d/*.conf -Xd -Xt -gl -di386 -dRELEASE src/httpd.pas
make[4]: Leaving directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/httpd22' make[3]: Leaving directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/httpd22' make -C fastcgi smart
make[3]: Entering directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fastcgi' /home/me/Programs/fpc/fpsrc/exported/2.6.1/compiler/*ppc* fpmake.pp -n -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/units/i386-linux -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/hash -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/paszlib -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fcl-process -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fpmkunit/units_bs/*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.6.1/rtl/units/i386-linux/cthreads.o: In function `LOADPTHREADS':
/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/linux/pthread.inc:261: 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(34,1) Error: Error while linking
fpmake.pp(34,1) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
make[3]: *** [fpmake] Error 1
make[3]: Leaving directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fastcgi' make[2]: *** [fastcgi_smart] Error 2
make[2]: Leaving directory
`/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages' make[1]: *** [packages_smart] Error 2
make[1]: Leaving directory `/home/me/Programs/fpc/fpsrc/exported/2.6.1' make: *** [build-stamp.i386-win32] Error 2

Stephano

patspiper
to Marco van de Voort: In our previous episode, patspiper said: There were changes merged. I wonder however how…
Marco van de Voort wrote 43 lines
In our previous episode, patspiper said: > I am able to compile FPC 2.6.1 (rev 22778) under Ubuntu 11.04 32 bits. > However cross compiling to win32 fails with the error: /usr/bin/ld: > cannot find -lgcc > > I was able to cross compile successfully about 2 weeks ago. > > The relevant part of the log: > make -C fastcgi smart > make[3]: Entering directory > `/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fastcgi' > /home/me/Programs/fpc/fpsrc/exported/2.6.1/compiler/ppc fpmake.pp -n > -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/units/i386-linux > -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/hash > -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/paszlib > -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fcl-process > -Fu/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fpmkunit/units_bs/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.6.1/rtl/units/i386-linux/cthreads.o: > In function `LOADPTHREADS': > /home/me/Programs/fpc/fpsrc/exported/2.6.1/rtl/linux/pthread.inc:261: > 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(34,1) Error: Error while linking > fpmake.pp(34,1) Fatal: There were 1 errors compiling module, stopping > Fatal: Compilation aborted > make[3]: *** [fpmake] Error 1 > make[3]: Leaving directory > `/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages/fastcgi' > make[2]: *** [fastcgi_smart] Error 2 > make[2]: Leaving directory > `/home/me/Programs/fpc/fpsrc/exported/2.6.1/packages' > make[1]: *** [packages_smart] Error 2 > make[1]: Leaving directory `/home/me/Programs/fpc/fpsrc/exported/2.6.1' > make: *** [build-stamp.i386-win32] Error 2 > > What could have gone wrong? There were changes merged. I wonder however how a crosscompile to win32 can reach "fastcgi" still being target linux. Could you post your build cmdline please?

revision 22761 cross-compiles fine, and hence 22765 is the culprit.

Stephano

Marco van de Voort
to patspiper

In our previous episode, patspiper said:

Show quoted text 7 lines
>> >> What could have gone wrong? > There were changes merged. I wonder however how a crosscompile to win32 can > reach "fastcgi" still being target linux. > > Could you post your build cmdline please? revision 22761 cross-compiles fine, and hence 22765 is the culprit.

I reverted that change in fixes (not the release branch yet).

On the forum, problems with cleaning due to other revisions were also reported, and Tomas confirmed that.

patspiper
to Marco van de Voort
Marco van de Voort wrote 11 lines
In our previous episode, patspiper said: >>> What could have gone wrong? >> There were changes merged. I wonder however how a crosscompile to win32 can >> reach "fastcgi" still being target linux. >> >> Could you post your build cmdline please? > revision 22761 cross-compiles fine, and hence 22765 is the culprit. I reverted that change in fixes (not the release branch yet). On the forum, problems with cleaning due to other revisions were also reported, and Tomas confirmed that.

Thanks