Hi all

In the book 'Development CLFS (SVN)' for PowerPC, IV. Building the Basic Tools,
6. Constructing a Temporary System / Binutils-2.18

The compilation fails with :

/archives/meip/clfs-svn-ppc-chroot-vanilla/sources/binutils-build/libiberty/pic 
-liberty  -Wl,-soname -Wl,libbfd-2.18.0.so -o .libs/libbfd-2.18.0.so
libtool: link: (cd ".libs" && rm -f "libbfd.so" && ln -s "libbfd-2.18.0.so" "lib
bfd.so")
libtool: link: powerpc-unknown-linux-gnu-ar cru .libs/libbfd.a  archive.o archur
es.o bfd.o bfdio.o bfdwin.o cache.o coffgen.o corefile.o format.o init.o 
libbfd.o opncls.o reloc.o section.o syms.o targets.o hash.o linker.o srec.o 
binary.o tekhex.o ihex.o stabs.o stab-syms.o merge.o dwarf2.o simple.o 
elf32-ppc.o elf-vxworks.o elf32.o elf.o elflink.o elf-attrs.o elf-strtab.o 
elf-eh-frame.o dwarf1.o coff-rs6000.o xcofflink.o ppcboot.o elf32-gen.o 
cpu-rs6000.o cpu-powerpc.o
powerpc-unknown-linux-gnu-ar: error while loading shared libraries: 
/archives/meip/clfs-svn-ppc-chroot-vanilla/sources/binutils-build/./bfd/.libs/libbfd-2.18.0.so:
 ELF file data encoding not little-endian

I surmise that powerpc-unknown-linux-gnu-ar finds in its search patch a newly
built library for powerpc while searching for its own x86-library.
I don't know how to solve that search-path problem, but an easy workaround
is to have powerpc-unknown-linux-gnu-ar linked statically in the previous
phase.

Below is a patch using this workaround.

Feel free to apply.

Philippe

Index: cross-tools/common/binutils.xml
===================================================================
--- cross-tools/common/binutils.xml     (revision 3902)
+++ cross-tools/common/binutils.xml     (working copy)
@@ -54,7 +54,7 @@
 
 <screen os="bc"><userinput>AR=ar AS=as 
../binutils-&binutils-version;/configure --prefix=/cross-tools \
     --host=${CLFS_HOST} --target=${CLFS_TARGET} --with-lib-path=/tools/lib \
-    --disable-nls --enable-shared --disable-multilib</userinput></screen>
+    --disable-nls --disable-shared --disable-multilib</userinput></screen>
 
     <variablelist os="bd">
       <title>The meaning of the configure options:</title>
@@ -104,9 +104,9 @@
       </varlistentry>
 
       <varlistentry os="bd6">
-        <term><parameter>--enable-shared</parameter></term>
+        <term><parameter>--disable-shared</parameter></term>
         <listitem>
-          <para>Enable the creation of the shared libraries.</para>
+          <para>Disable the creation of the shared libraries, and hence forces 
the binutils to be linked statically against libbfd.  This avoids the following 
error when building the final binutils : powerpc-unknown-linux-gnu-ar: error 
while loading shared libraries: 
/archives/meip/clfs-svn-ppc-chroot-vanilla/sources/binutils-build/./bfd/.libs/libbfd-2.18.0.so:
 ELF file data encoding not little-endian</para>
         </listitem>
       </varlistentry>
 

_______________________________________________
Clfs-dev mailing list
[email protected]
http://lists.cross-lfs.org/listinfo.cgi/clfs-dev-cross-lfs.org

Reply via email to