[oe] building uClinux using OE

Sergey 'Jin' Bostandzhyan jin at mediatomb.cc
Fri Feb 22 18:32:06 UTC 2008


Hi Koen,
   
On Thu, Feb 14, 2008 at 05:47:07PM +0100, Koen Kooi wrote:
> That should happen automagically, we just need to stage some more
> binutils-cross headers for elf2flt to build

OK... I am not sure if I got the idea, so please correct me if I am wrong:
elf2flt needs to be told what target arch it will be used for, but it
should be compiled using native libiberty.a and libbfd.a?

At least running ./elf2flt without any options prints me
"Compiled for arm architecture" at the end of the usage summary.

I am not yet sure if it produces any meaningful output or how I could test it
to be sure (it asks for some relocation info files), so any hints would be
greatly appreciated.

And also... how would this "automagically" part work, what do I do next?

> I had a go at this a while ago, but I had to halt working on it since
> the uboot on the blackfin site refuses to load the uImage on the
> blackfin site, leaving me without a good testing target.
> I think forcing static linking would be the fastest way to get an image
> built, we can work on details (flat, shared-flat, fdpic, etc) after that.

I found your elf2flt_svn.bb recipe and used it as a starting point.

I had to apply the patch from here in order to compile binutils with uclibc:
http://bugs.openembedded.org/show_bug.cgi?id=3178

I attached my diffs.

Kind regards,
Jin

> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (Darwin)
> 
> iD8DBQFHtHCLMkyGM64RGpERAl7KAJ4sD85YqG+OrTVUx+eLuCb9js4TvQCffI35
> 7wUmhJZu6YpoBfu6e4kbEg0=
> =Ez6i
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
-------------- next part --------------
--- ../../../../org.openembedded.dev/packages/uclibc/elf2flt_svn.bb	2008-02-20 16:11:45.000000000 +0100
+++ elf2flt_svn.bb	2008-02-22 18:51:13.000000000 +0100
@@ -9,7 +9,8 @@
 
 S = "${WORKDIR}/${PN}"
 
-EXTRA_OECONF = " --with-libbfd=${STAGING_DIR}/${TARGET_SYS}/lib/libbfd.a \
-                 --with-libiberty=${STAGING_DIR}/${TARGET_SYS}/lib/libiberty.a \
+EXTRA_OECONF = " --with-libbfd=${STAGING_LIBDIR_NATIVE}/libbfd.a \
+                 --with-libiberty=${STAGING_LIBDIR_NATIVE}/libiberty.a \
                  --with-bfd-include-dir=${STAGING_DIR}/${TARGET_SYS}/include \
                "
+
-------------- next part --------------
diff -Naur ../../../../org.openembedded.dev/packages/binutils/binutils-2.18/binutils-uclibc-configure-add-libm.patch ./binutils-2.18/binutils-uclibc-configure-add-libm.patch
--- ../../../../org.openembedded.dev/packages/binutils/binutils-2.18/binutils-uclibc-configure-add-libm.patch	1970-01-01 01:00:00.000000000 +0100
+++ ./binutils-2.18/binutils-uclibc-configure-add-libm.patch	2008-02-22 15:07:54.000000000 +0100
@@ -0,0 +1,12 @@
+*** binutils-2.18/gas/configure.orig	2007-11-08 10:44:45.000000000 +0100
+--- binutils-2.18/gas/configure	2007-11-08 10:43:50.000000000 +0100
+*************** _ACEOF
+*** 12855,12860 ****
+--- 12855,12861 ----
+  fi
+  done
+  
++ need_libm=yes
+  # do we need the math library?
+  case "${need_libm}" in
+  yes)
--- ../../../../org.openembedded.dev/packages/binutils/binutils.inc	2008-02-20 16:11:36.000000000 +0100
+++ ./binutils.inc	2008-02-22 19:07:04.000000000 +0100
@@ -84,9 +84,14 @@
 	install -m 0644 ${S}/include/dis-asm.h ${STAGING_INCDIR}/
 	install -m 0644 ${S}/include/symcat.h ${STAGING_INCDIR}/
 	install -m 0644 ${S}/include/libiberty.h ${STAGING_INCDIR}/
+	install -m 0644 ${S}/include/filenames.h ${STAGING_INCDIR}/
 	install -m 0644 ${S}/include/ansidecl.h ${STAGING_INCDIR}/
 	install -m 0644 ${S}/include/bfdlink.h ${STAGING_INCDIR}/
 	install -m 0644 bfd/bfd.h ${STAGING_INCDIR}/
+    
+    mkdir -p ${STAGING_INCDIR}/elf
+	install -m 0644 ${S}/include/elf/arm.h ${STAGING_INCDIR}/elf
+	install -m 0644 ${S}/include/elf/reloc-macros.h ${STAGING_INCDIR}/elf
 }
 
 do_install () {
--- ../../../../org.openembedded.dev/packages/binutils/binutils-cross.inc	2008-02-20 16:11:36.000000000 +0100
+++ ./binutils-cross.inc	2008-02-22 18:20:14.000000000 +0100
@@ -10,6 +10,9 @@
 
 do_stage () {
 	oe_runmake install
+   
+    oe_libinstall -a -C ${B}/libiberty libiberty ${STAGING_LIBDIR_NATIVE}/
+    oe_libinstall -a -C ${B}/bfd libbfd ${STAGING_LIBDIR_NATIVE}/
 
 	# We don't really need these, so we'll remove them...
 	rm -rf ${CROSS_DIR}/lib/ldscripts
--- ../../../../org.openembedded.dev/packages/binutils/binutils_2.18.bb	2008-02-20 16:11:36.000000000 +0100
+++ ./binutils_2.18.bb	2008-02-22 15:11:38.000000000 +0100
@@ -11,6 +11,7 @@
      file://binutils-uclibc-300-001_ld_makefile_patch.patch;patch=1 \
      file://binutils-uclibc-300-006_better_file_error.patch;patch=1 \
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
+     file://binutils-uclibc-configure-add-libm.patch;patch=1 \
      "
 
 # powerpc patches


More information about the Openembedded-devel mailing list