[fpc-pascal] crosscompiling from win32 to i386-linux and libc linking
Dominique Leducq
dleducq at magellan-ing.fr
Mon Jul 31 08:24:44 CEST 2006
Marco van de Voort a écrit :
>>> _______________________________________________
>>> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
>>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>> Thank you for your prompt answer.
>> I tried to set the dynamic linker whith the -FL option too, but it
>> didn't help. Anyway, it seems to be a runtime hint, as you give a target
>> path as an argument, and I don't get the chance to reach this step, as
>> I can't produce any executable.
>>
>> I read your doc, and didn't see anything else that could improve the
>> matters.
>
> Also note step 8 it is very treacherous.
>
Did not change anything... What are precisely the respective purposes of
cprt0.o & cprt21.o ?
> The 10th step can nowdays (all versions after medium july) be done by
> passing -XLAc=c,dl and -XLAgtk=gmodule,gtk or so. Same for step 12.
>
> Note that in the 10th step I do three things, IIRC
> - The -FL sets the place where the loader on the target should look for the
> dnyamic linker.
> - The -Xr causes it to also search /usr/lib for anything it needs.
OK, that has runtime effect, it won't break linking, then.
> - The -Fl points to the directory where I stored the copies of the libs.
> Note that I sometimes renamed the copied libs a bit to match the names it
> searches.
>
I did that already, and the linker seems to find anything it searches for.
> Also note this remark:
>
> ----
> Making mistakes with renaming is not that bad, there will be chances to fix
> it. Make sure all crt* and a file "libc.so" are available, otherwise
> generating link.res will go wrong. (Yes, Peter, that was my fault :-)
> ----
>
> In case you added parameter by parameter, clean, and try to build again with
> all relevant parameters. The compiler on Linux makes some decisions based on
> the existance of some of these files.
>
>
I tried all this, unsuccessfully, alas.
Clearly all symbols that ld claims are undefined are defined in
ld-linux.so.2 (ld-2.3.6.so), but somehow ld doesn't find them....
But it does on Linux ! It is a priori the same, except this one is from
the cross-binutils (Well, indeed on linux I have ld 2.16.91 20060413
Debian Gnu/Linux; perhaps I should try to compile this one as cross-tool...)
Here is the link.res, if you can see some strange things from it.
SEARCH_DIR(C:\FPC\2.0.2\lib\i386-linux\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\rtl\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\zvt\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\zlib\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\x11\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\uuid\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\utmp\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\unzip\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\unixutil\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\tcl\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\syslog\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\svgalib\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\sqlite\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\regexpr\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\pthreads\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\postgres\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\paszlib\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\pasjpeg\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\oracle\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\opengl\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\odbc\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\newt\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\netdb\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\ncurses\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\mysql\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\md5\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\libpng\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\libgd\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\libc\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\libasync\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\imlib\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\ibase\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\gtk2\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\gtk\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\gnome\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\ggi\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\gdbm\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\gdbint\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\gconf\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\fv\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\fpgtk\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\forms\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\fcl\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\cdrom\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\bfd\)
SEARCH_DIR(C:\FPC\2.0.2\units\i386-linux\)
SEARCH_DIR(C:\FPC\2.0.2\bin\i386-Win32\)
INPUT(
C:\FPC\2.0.2\units\i386-linux\rtl\cprt21.o
C:\FPC\2.0.2\lib\i386-linux\crtbegin.o
C:\FPC\2.0.2\lib\i386-linux\crti.o
testthreads.o
C:\FPC\2.0.2\units\i386-linux\rtl\system.o
C:\FPC\2.0.2\units\i386-linux\rtl\objpas.o
C:\FPC\2.0.2\units\i386-linux\rtl\sysutils.o
C:\FPC\2.0.2\units\i386-linux\rtl\initc.o
C:\FPC\2.0.2\units\i386-linux\rtl\cthreads.o
C:\FPC\2.0.2\units\i386-linux\rtl\unix.o
C:\FPC\2.0.2\units\i386-linux\rtl\errors.o
C:\FPC\2.0.2\units\i386-linux\rtl\sysconst.o
C:\FPC\2.0.2\units\i386-linux\rtl\unixtype.o
C:\FPC\2.0.2\units\i386-linux\rtl\baseunix.o
C:\FPC\2.0.2\units\i386-linux\rtl\unixutil.o
C:\FPC\2.0.2\units\i386-linux\rtl\strings.o
C:\FPC\2.0.2\units\i386-linux\rtl\syscall.o
C:\FPC\2.0.2\units\i386-linux\rtl\dl.o
)
INPUT(
-ldl
-lc
)
INPUT(
C:\FPC\2.0.2\lib\i386-linux\crtend.o
C:\FPC\2.0.2\lib\i386-linux\crtn.o
)
More information about the fpc-pascal
mailing list