On Fri, 2008-02-22 at 00:42 +0200, Paul Sokolovsky wrote:
> Hello,
> 
> On Thu, 21 Feb 2008 22:23:20 +0100
> "Kees Jongenburger" <[EMAIL PROTECTED]> wrote:
> 
> > Hello Casey,
> > 
> > I played with getting mamona to compile "native" on my amd64 machine
> > (I was quite far but gave up at one point). Here a some notes that
> > might or might not be helpfull
> > they where certainly not checked against somebody with positive OE
> > karma. but who knows
> 
> Thanks for the patches below, but for full use from them they'd rather
> be submitted to bugtracker where they have more chance to improve
> situation.
> 

I've made a little progress.

Getting a multilib build looks extremely difficult -- GCC does helpful
things like not looking in lib64 for 64-bit libraries, but *also* does
helpful things like installing stuff into lib64, even with
--disable-multilib. Compiling GCC would be funny if it wasn't so tragic.

I have managed to get up to a full install of gcc-cross, with the
attached patches (these aren't yet for wider consumption, they're just
my hacks as of today -- if this works for building more I'll clean them
up and post them properly). The key change here is to patch GCC to fake
"../lib" to be both the 64-bit and 32-bit library locations -- that
seems to be the ultimate way to convince GCC to avoid using the lib64
abomination.

For this build I'm forcing GCC version 4.2.2, glibc version 2.5, and
kernel 2.6.23.
#
# old_revision [985da843108cf6ed11892842f921418171e3d429]
#
# add_file "conf/machine/x86_64.conf"
#  content [a6c94ffd9f13b26ff68eed80317070402d522e2f]
# 
# add_file "packages/gcc/gcc-4.2.2/multilib-os-dirnames-x86_64.patch"
#  content [b15a4aac9b7f5dc1cfee82ec6469662bff4237ad]
# 
# patch "classes/kernel-arch.bbclass"
#  from [7a67a2539558d6a43df7cee45504ba16291c3509]
#    to [bc087fcf76549ca28fef463566ac9a3f46a3d703]
# 
# patch "packages/gcc/gcc-cross_4.2.2.bb"
#  from [638f8a17318b6c935909d7b7f11cc6506e57d6af]
#    to [cb919517dfdb87a56a96374e0dbc78cf9abd4014]
# 
# patch "packages/gcc/gcc-package-cross.inc"
#  from [74d7c12ed4f23d683bd26cd00ec7023f4a4e79cf]
#    to [587feea107fc118580242c8f6454344a25a1ddfb]
# 
# patch "packages/gcc/gcc3-build-cross.inc"
#  from [f5b8eae287025914fe8384905949c0372af6d9d0]
#    to [bbaeafdda0a67501ad7c9ccb97ffcbdeee2e84d9]
# 
# patch "packages/gcc/gcc_4.2.2.bb"
#  from [e3cc18f11ea8954870f79c7a095814c2a298871d]
#    to [7aa5a1e3fd522f63a2df005ca55b8b08182f87b2]
# 
# patch "packages/linux-libc-headers/linux-libc-headers_2.6.23.bb"
#  from [66ed33603a1599bc68718e22c5e7fe1d81ff51cc]
#    to [f9238ad8cf4f3bbe0baf67a461ca5fc02cddd63c]
#
============================================================
--- conf/machine/x86_64.conf	a6c94ffd9f13b26ff68eed80317070402d522e2f
+++ conf/machine/x86_64.conf	a6c94ffd9f13b26ff68eed80317070402d522e2f
@@ -0,0 +1,20 @@
+# x86-64.conf -- OpenEmbedded config for x86-64
+# Copyright (C) 2008  Pacific Biosciences, Inc.
[EMAIL PROTECTED]: Machine
[EMAIL PROTECTED]: X86-64
[EMAIL PROTECTED]: Machine configuration for Linux/x86-64
+
+TARGET_ARCH = "x86_64"
+PACKAGE_EXTRA_ARCHS = "x86_64"
+
+PREFERRED_PROVIDER_virtual/kernel = "linux"
+
+KERNEL_IMAGETYPE = "bzImage"
+
+MACHINE_EXTRA_RECOMMENDS = " kernel-modules"
+MACHINE_FEATURES = "kernel26 pci usbhost ext2 screen x86"
+
+udevdir = "/dev"
+OLDEST_KERNEL = "2.6.20"
+GLIBC_ADDONS = "nptl"
+GLIBC_EXTRA_OECONF = "--with-tls"
============================================================
--- packages/gcc/gcc-4.2.2/multilib-os-dirnames-x86_64.patch	b15a4aac9b7f5dc1cfee82ec6469662bff4237ad
+++ packages/gcc/gcc-4.2.2/multilib-os-dirnames-x86_64.patch	b15a4aac9b7f5dc1cfee82ec6469662bff4237ad
@@ -0,0 +1,11 @@
+--- gcc-4.2.2/gcc/config/i386/t-linux64.orig	2008-02-22 17:03:22.000000000 -0800
++++ gcc-4.2.2/gcc/config/i386/t-linux64	2008-02-22 17:03:29.000000000 -0800
+@@ -6,7 +6,7 @@
+ 
+ MULTILIB_OPTIONS = m64/m32
+ MULTILIB_DIRNAMES = 64 32 
+-MULTILIB_OSDIRNAMES = ../lib64 ../lib
++MULTILIB_OSDIRNAMES = ../lib ../lib
+ 
+ LIBGCC = stmp-multilib
+ INSTALL_LIBGCC = install-multilib
============================================================
--- classes/kernel-arch.bbclass	7a67a2539558d6a43df7cee45504ba16291c3509
+++ classes/kernel-arch.bbclass	bc087fcf76549ca28fef463566ac9a3f46a3d703
@@ -5,7 +5,7 @@ valid_archs = "alpha cris ia64 \
 #
 
 valid_archs = "alpha cris ia64 \
-               x86_64,i386 x86 \
+               x86_64 i386 x86 \
                m68knommu m68k ppc powerpc ppc64  \
 	       sparc sparc64 \
                arm  arm26 \
============================================================
--- packages/gcc/gcc-cross_4.2.2.bb	638f8a17318b6c935909d7b7f11cc6506e57d6af
+++ packages/gcc/gcc-cross_4.2.2.bb	cb919517dfdb87a56a96374e0dbc78cf9abd4014
@@ -5,7 +5,7 @@ FILESDIR = "[EMAIL PROTECTED](bb.data.g
 FILESDIR = "[EMAIL PROTECTED](bb.data.getVar('FILE',d,1))}/gcc-${PV}"
 # NOTE: split PR.  If the main .oe changes something that affects its *build*
 # remember to increment this one too.
-PR = "r3"
+PR = "r4"
 
 DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc gmp-native mpfr-native"
 PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
@@ -14,9 +14,10 @@ require gcc-package-cross.inc
 require gcc3-build-cross.inc
 # cross packaging
 require gcc-package-cross.inc
-SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1 "
+SRC_URI_append_fail-fast = " file://zecke-no-host-includes.patch;patch=1"
 # Do not build libssp libmudflap and libgomp
 # We might need them for some beefy targets 
 EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \
 		--disable-libgomp --disable-libmudflap \
+		--with-mpfr=${STAGING_DIR_NATIVE}${layout_exec_prefix} \
+        --disable-multilib"
-		--with-mpfr=${STAGING_DIR_NATIVE}${layout_exec_prefix}"
============================================================
--- packages/gcc/gcc-package-cross.inc	74d7c12ed4f23d683bd26cd00ec7023f4a4e79cf
+++ packages/gcc/gcc-package-cross.inc	587feea107fc118580242c8f6454344a25a1ddfb
@@ -48,7 +48,7 @@ do_install () {
         elif [  -f ${D}${prefix}/*/lib/nof/libgcc_s.so.? ]; then
                 mv -f ${D}${prefix}/*/lib/nof/libgcc_s.so* ${D}${target_base_libdir}
         else
-                mv -f ${D}${prefix}/*/lib/libgcc_s.so* ${D}${target_base_libdir} || true 
+                mv -f ${D}${prefix}/*/lib*/libgcc_s.so* ${D}${target_base_libdir} || true 
         fi
 
 
@@ -63,9 +63,9 @@ do_install () {
            mv -f ${D}${prefix}/*/lib/nof/libgfortran*.so* ${D}${target_libdir} || true
 
         else
-           mv -f ${D}${prefix}/*/lib/libstdc++.so* ${D}${target_libdir} || true
-           mv -f ${D}${prefix}/*/lib/libg2c.so* ${D}${target_libdir} || true
-           mv -f ${D}${prefix}/*/lib/libgfortran*.so* ${D}${target_libdir} || true
+           mv -f ${D}${prefix}/*/lib*/libstdc++.so* ${D}${target_libdir} || true
+           mv -f ${D}${prefix}/*/lib*/libg2c.so* ${D}${target_libdir} || true
+           mv -f ${D}${prefix}/*/lib*/libgfortran*.so* ${D}${target_libdir} || true
         fi
 
 
============================================================
--- packages/gcc/gcc3-build-cross.inc	f5b8eae287025914fe8384905949c0372af6d9d0
+++ packages/gcc/gcc3-build-cross.inc	bbaeafdda0a67501ad7c9ccb97ffcbdeee2e84d9
@@ -16,6 +16,11 @@ do_compile_prepend () {
 	export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc ${TARGET_CC_ARCH}"
 }
 
+do_stage_prepend () {
+    # GCC 4.2.x gets a little dumb over lib64, even with --disable-multilib
+    ln -sf lib ${CROSS_DIR}/${TARGET_SYS}/lib64
+}
+
 do_stage_append () {
 	for d in info man share/doc share/locale ; do
 		rm -rf ${CROSS_DIR}/$d
============================================================
--- packages/gcc/gcc_4.2.2.bb	e3cc18f11ea8954870f79c7a095814c2a298871d
+++ packages/gcc/gcc_4.2.2.bb	7aa5a1e3fd522f63a2df005ca55b8b08182f87b2
@@ -1,4 +1,4 @@
-PR = "r3"
+PR = "r4"
 DESCRIPTION = "The GNU cc and gcc C compilers."
 HOMEPAGE = "http://www.gnu.org/software/gcc/";
 SECTION = "devel"
@@ -43,6 +43,7 @@ SRC_URI = "ftp://ftp.gnu.org/pub/gnu/gcc
         file://gcc-4.0.2-e300c2c3.patch;patch=1 \
         file://pr34130.patch;patch=1 \
         file://fortran-static-linking.patch;patch=1 \
+        file://multilib-os-dirnames-x86_64.patch;patch=1 \
 "
 
 SRC_URI_append_ep93xx = " \
============================================================
--- packages/linux-libc-headers/linux-libc-headers_2.6.23.bb	66ed33603a1599bc68718e22c5e7fe1d81ff51cc
+++ packages/linux-libc-headers/linux-libc-headers_2.6.23.bb	f9238ad8cf4f3bbe0baf67a461ca5fc02cddd63c
@@ -63,4 +63,8 @@ do_stage () {
 	cp -pfLR ${STAGE_TEMP}${includedir}/linux ${STAGING_INCDIR}/
 	cp -pfLR ${STAGE_TEMP}${includedir}/asm ${STAGING_INCDIR}/
 	cp -pfLR ${STAGE_TEMP}${includedir}/asm-generic ${STAGING_INCDIR}/
+    if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
+        cp -pfLR ${STAGE_TEMP}${includedir}/asm-i386 ${STAGING_INCDIR}/asm-i386
+        cp -pfLR ${STAGE_TEMP}${includedir}/asm-x86_64 ${STAGING_INCDIR}/asm-x86_64
+    fi
 }
_______________________________________________
Openembedded-users mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-users

Reply via email to