This is what i make
cp /media/1b1f83d3-c5f0-44b0-ae17-21b401cd081b/lib/* /home/warlock/lazarus/fpc/libcross/
cp /media/1b1f83d3-c5f0-44b0-ae17-21b401cd081b/usr/lib/* /home/warlock/lazarus/fpc/libcross/
but i get the same error
/home/warlock/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libX11.so when searching for -lX11
/home/warlock/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libX11.a when searching for -lX11
/home/warlock/lazarus/fpc/binutils/ld: cannot find -lX11
In my crosscompiling snapshot I have:
#ifdef cpuarm
-XR/libraryimages/sheevaplug
#-CfSOFT
-dFPC_ARMEL
-Cparmv5
#-k"-mabi=apcs-gnu"
#-k"-mfpu=fpa"
#-CaEABI
-dusecthreads
-Fl/libraryimages/sheevaplug/lib
-Fl/libraryimages/sheevaplug/usr/lib
#endif
the important one here is the -XR which together with the --prefix of compiling the binutils (see below) prevented NOT searching libraries in normal dirs, and DO search dirs in the copied dirs. The -Fl's might be redundant, just like the many commented commands.
moreover, depending on what I am compiling for I had to set the eabi version for the assembler. I suspect the "default" eabi might work depending on which target
you used to compile your binutils (gnu-eabi is eabi 5 afaik, arm-elf is 0. I need 4 :-)
For that, on *nix (freebsd) I rename the assembler to arm-linux-as2, and make a shellscript arm-linux-as containing:
#/usr/bin/env bash
arm-linux-as2 -meabi 4 $*
For windows I use this pascal wrapper program:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/install/cross/aswrapper.pas?view=markup&revision=824&root=fpcbuildmy snapshot is then compiled with
----------------------------------
#!/usr/bin/env bash
PATH=/home/marcov/armelfbinutils:$PATH
export PATH
cd fpc
make crosszipinstall CPU_TARGET=arm OS_TARGET=linux OPT="-dFPC_ARMEL" CROSSOPT="-XR/libarm -dFPC_ARMEL -CfSOFT -Cparmv5" FPC=~/ppcrel
-----------
and the binutils were made using:
--------------------------------------------
#!/usr/bin/env bash
# 1. extract the binutils 2.20 .tar.bz2
# tar xvjf binutils-2.20.tar.bz2 in the dir where it is residing now
# 2. apply the as.h.diff patch to <extractedbinutils>/gas/as.h
# 3. run this shell script
# 4. some additional renaming of the arm,as,ld (or *-new) might be necessary
# setting static
LD_FLAGS="${LD_FLAGS} -static"
LDFLAGS="${LD_FLAGS} -s"
CFLAGS="${CFLAGS} -static"
CPPFLAGS="${CPPFLAGS} -static"
CXXFLAGS="${CXXFLAGS} -static"
# configure binutils
../binutils-2.20/configure --disable-nls --disable-shared --target=arm-elf --prefix /usr/cross/
# build binutils
make
# collect binaries
TARGETDIR=/home/jerome/armelfbinutils/
mkdir -p $TARGETDIR
find . -perm /u+x -type f |grep -v status |xargs -Ireplfilename cp replfilename $TARGETDIR
--------------------
Note that the prefix is important since it seems to stop the resulting binutils from searching the normal dirs.
Sometimes compiling binutils doesn't work, (a common problem gcc version related afaik), and then I use this patch:
===================================================================
RCS file: /cvs/src/src/gas/as.h,v
retrieving revision 1.64
retrieving revision 1.64.2.1
diff -u -r1.64 -r1.64.2.1
--- src/gas/as.h 2009/09/03 12:54:21 1.64
+++ src/gas/as.h 2009/12/03 10:40:25 1.64.2.1
@@ -238,7 +238,7 @@
#define know(p) gas_assert(p) /* Verify our assumptions! */
#endif /* not yet defined */
#else
-#define know(p) /* know() checks are no-op.ed */
+#define know(p) do {} while (0) /* know() checks are no-op.ed */
#endif
/* input_scrub.c */