Skip to contentSkip to conversation

AMD64 and multilib support

RFC In review Roman I Khimov 4 participants 42 messages Apr 15, 2009 – Apr 28, 2009

lore
Share & tools
lore
#0 lore raw

Hello all.

This patch series (will follow in replies) tries to bring in AMD64/x86_64 support into OE. This required some intrusive toolchain fixes that I want to post here for review and feedback as I think (or rather know ;)) I might have broken something along the way.

I've tried to generalize my approach so that later we could add some more 64-bit goodies. So I've added 'multilib' OVERRIDE that I think we can set in future in bitbake.conf by intersection of MACHINE_FEATURES and DISTRO_FEATURES (now you can just add it to OVERRIDES in distro or local.conf). Well, from what I see this FEATURES/OVERRIDES games can be controversial but then please tell me how to do it better for toolchain.

What I've also tried to achieve is ability to build non-multilib toolchain, although from what I see that will require passing "--disable-multilib" by default for gcc-cross and that is a bit scary for now.

Then there is some directory naming things like 'lib' vs 'lib64' Given that we have some places assuming 'lib' to be 'lib' that is solved in Debian style (actually, stolen patches from Debian) where there is 'lib' for 64-bit arch and 'lib32' for 32-bit arch.

Next thing is 'libexec' dir. I propose to set it to point to libdir and be done with that (again, Debian does exactly this). For now, I've done that just for glibc-multilib.

Well, that's it in general, please see patches for details and feel free to bash it.

#1 lore raw

PATCH 1/11 Add x86_64-generic machine

---
 conf/machine/include/tune-x86_64.conf |    7 +++++++
 conf/machine/x86_64-generic.conf      |   14 ++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
 create mode 100644 conf/machine/include/tune-x86_64.conf
 create mode 100644 conf/machine/x86_64-generic.conf
conf/machine/include/tune-x86_64.conf new file +7 -0
new file mode 100644
index 0000000..528d1b1
@@ -0,0 +1,7 @@
+ARCH_MULTILIB = "i686"
+LIB_MULTILIB = "lib32"
+CFLAGS_MULTILIB = "-march=i686 -m32"
+TARGET_SYS_MULTILIB = "${ARCH_MULTILIB}${TARGET_VENDOR}-${TARGET_OS}"
+
+base_multilibdir = "${layout_base_prefix}/${LIB_MULTILIB}"
+multilibdir = "${layout_exec_prefix}/${LIB_MULTILIB}"
conf/machine/x86_64-generic.conf new file +14 -0
new file mode 100644
index 0000000..2e2bbf5
@@ -0,0 +1,14 @@
+#@TYPE: Machine
+#@NAME: x86_64-generic
+#@DESCRIPTION: Machine configuration for a Linux running on x86_64 compatible machines
+
+TARGET_ARCH = "x86_64"
+# reuse .bb for "normal" x86
+PREFERRED_PROVIDER_virtual/kernel = "linux-x86"
+
+udevdir = "/dev"
+OLDEST_KERNEL = "2.6.17"
+GLIBC_ADDONS = "nptl"
+GLIBC_EXTRA_OECONF = "--with-tls"
+MACHINE_FEATURES = "kernel26 screen keyboard pci usbhost acpi ext2 multilib"
+require conf/machine/include/tune-x86_64.conf
Signature · 7 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#2 lore raw

PATCH 2/11 binutils: add binutils-x86_64_i386_biarch.patch

---
 .../binutils-x86_64_i386_biarch.patch              |   25 ++++++++++++++++++++
 recipes/binutils/binutils_2.18.bb                  |    2 +-
 2 files changed, 26 insertions(+), 1 deletions(-)
 create mode 100644 recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch
recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils_2.18.bb +1 -1
index 9367196..562c8ba 100644
@@ -12,8 +12,8 @@ SRC_URI = "\
      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-gas-needs-libm.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
 SRC_URI += "file://binutils-2.16.1-e300c2c3.patch;patch=1"
-
Signature · 7 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#3 lore raw

PATCH 3/11 linux-libc-headers 2.6.23: fix amd64 headers

Taken from http://bugs.openembedded.net/show_bug.cgi?id=1728

---
 .../linux-libc-headers_2.6.23.bb                   |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
recipes/linux-libc-headers/linux-libc-headers_2.6.23.bb +12 -0
index 13579f9..db13a45 100644
@@ -63,4 +63,16 @@ 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}" == "x86_64" ]; then
+		cp -pfLR ${STAGE_TEMP}${includedir}/asm-x86_64 ${STAGING_INCDIR}/
+		cp -pfLR ${STAGE_TEMP}${includedir}/asm-i386 ${STAGING_INCDIR}/
+	fi
+}
+
+do_stage_append_multilib () {
+	mkdir ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}
+	ln -s ../linux ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}/linux
+	ln -s ../asm ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}/asm
+	ln -s ../asm-generic ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}/asm-generic
+	ln -s ../asm-i386 ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}/asm-i386
 }
Signature · 7 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#4 lore raw

PATCH 4/11 gcc 4.2.4: add gcc-multilib64dir.patch

---
 recipes/gcc/files/gcc-multilib64dir.patch |   43 +++++++++++++++++++++++++++++
 recipes/gcc/gcc-4.2.4.inc                 |    1 +
 2 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100644 recipes/gcc/files/gcc-multilib64dir.patch
recipes/gcc/files/gcc-multilib64dir.patch new file +43 -0
new file mode 100644
index 0000000..301e596
@@ -0,0 +1,43 @@
+#! /bin/sh -e
+
+# DP: Use lib instead of lib64 as multilibdir on amd64 and ppc64.
+#
+# Taken from Debian, fixed to apply with quilt
+
+Index: gcc/config/i386/t-linux64
+===================================================================
+--- gcc/config/i386/t-linux64	(revision 130706)
++++ gcc/config/i386/t-linux64	(working copy)
+@@ -13,7 +13,7 @@
+ 
+ MULTILIB_OPTIONS = m64/m32
+ MULTILIB_DIRNAMES = 64 32 
+-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
++MULTILIB_OSDIRNAMES = ../lib $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
+ 
+ LIBGCC = stmp-multilib
+ INSTALL_LIBGCC = install-multilib
+Index: gcc/config/rs6000/t-linux64
+===================================================================
+--- gcc/config/rs6000/t-linux64	(revision 130706)
++++ gcc/config/rs6000/t-linux64	(working copy)
+@@ -14,13 +14,13 @@
+ # it doesn't tell anything about the 32bit libraries on those systems.  Set
+ # MULTILIB_OSDIRNAMES according to what is found on the target.
+ 
+-MULTILIB_OPTIONS        = m64/m32 msoft-float
+-MULTILIB_DIRNAMES       = 64 32 nof
++MULTILIB_OPTIONS        = m64/m32
++MULTILIB_DIRNAMES       = 64 32
+ MULTILIB_EXTRA_OPTS     = fPIC mstrict-align
+-MULTILIB_EXCEPTIONS     = m64/msoft-float
+-MULTILIB_EXCLUSIONS     = m64/!m32/msoft-float
+-MULTILIB_OSDIRNAMES	= ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) nof
+-MULTILIB_MATCHES        = $(MULTILIB_MATCHES_FLOAT)
++MULTILIB_EXCEPTIONS     =
++MULTILIB_EXCLUSIONS     =
++MULTILIB_OSDIRNAMES	= ../lib $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
++MULTILIB_MATCHES        =
+ 
+ softfp_wrap_start := '\#ifndef __powerpc64__'
+ softfp_wrap_end := '\#endif'
recipes/gcc/gcc-4.2.4.inc +1 -0
index 085f241..20bdfef 100644
@@ -37,6 +37,7 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
 	file://gcc-4.0.2-e300c2c3.patch;patch=1 \
 	file://fortran-static-linking.patch;patch=1 \
 	file://intermask-bigendian.patch;patch=1 \
+	file://gcc-multilib64dir.patch;patch=1;pnum=0 \
 "
 
 SRC_URI_append_ep93xx = " \
Signature · 7 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#5 lore raw

PATCH 5/11 gcc-cross-initial: add multilib overrides

---
 recipes/gcc/gcc-cross-initial.inc |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
recipes/gcc/gcc-cross-initial.inc +8 -0
index 15e5fa6..ffe55c3 100644
@@ -1,5 +1,7 @@
 DEPENDS = "virtual/${TARGET_PREFIX}binutils"
+DEPENDS_multilib = "virtual/${TARGET_PREFIX}binutils"
 PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial"
+PROVIDES_multilib = "virtual/${TARGET_PREFIX}gcc-initial virtual/${TARGET_SYS_MULTILIB}-gcc-initial"
 PACKAGES = ""
 
 # This is intended to be a -very- basic config
@@ -18,6 +20,12 @@ EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${layout_prefix} \
 		--with-build-sysroot=${STAGING_DIR_TARGET} \
 		${@get_gcc_fpu_setting(bb, d)}"
 
+EXTRA_OECONF_append_multilib = " --enable-multilib"
+
 do_install () {
 	:
 }
+
+do_install_multilib () {
+	:
+}
Signature · 7 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#6 lore raw

PATCH 6/11 gcc-cross-intermediate: add multilib overrides

---
 recipes/gcc/gcc-cross-intermediate.inc |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
recipes/gcc/gcc-cross-intermediate.inc +8 -0
index 4746140..5d8ac98 100644
@@ -1,6 +1,8 @@
 DEPENDS = "virtual/${TARGET_PREFIX}binutils"
 DEPENDS += "virtual/${TARGET_PREFIX}libc-initial"
+DEPENDS_multilib = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-initial virtual/${TARGET_SYS_MULTILIB}-libc-initial"
 PROVIDES = "virtual/${TARGET_PREFIX}gcc-intermediate"
+PROVIDES_multilib = "virtual/${TARGET_PREFIX}gcc-intermediate virtual/${TARGET_SYS_MULTILIB}-gcc-intermediate"
 PACKAGES = ""
 
 # This is intended to be a -very- basic config
@@ -16,6 +18,8 @@ EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${layout_prefix} \
 		--with-build-sysroot=${STAGING_DIR_TARGET} \
 		${@get_gcc_fpu_setting(bb, d)}"
 
+EXTRA_OECONF_append_multilib = " --enable-multilib"
+
 do_stage_append () {
 	# get rid of dummy libc.so
 	if [ -z "`file ${STAGING_DIR_TARGET}${layout_libdir}/libc.so | grep "ASCII C program text"`" ]; then
@@ -26,3 +30,7 @@ do_stage_append () {
 do_install () {
 	:
 }
+
+do_install_multilib () {
+	:
+}
Signature · 7 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#7 lore raw

PATCH 7/11 gcc-cross: add multilib overrides

---
 recipes/gcc/gcc-cross.inc         |    2 ++
 recipes/gcc/gcc-package-cross.inc |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 0 deletions(-)
recipes/gcc/gcc-cross.inc +2 -0
index 3fa6f61..3c8438b 100644
@@ -9,4 +9,6 @@ target_base_libdir := "${base_libdir}"
 inherit cross
 
 DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc"
+DEPENDS_multilib = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc virtual/${TARGET_SYS_MULTILIB}-libc-for-gcc"
 PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
+PROVIDES_multilib = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ virtual/${TARGET_SYS_MULTILIB}gcc virtual/${TARGET_SYS_MULTILIB}g++"
recipes/gcc/gcc-package-cross.inc +35 -0
index 77da3fe..5ae1894 100644
@@ -15,6 +15,13 @@ FILES_libgcc = "${target_base_libdir}/libgcc_s.so.1"
 
 FILES_libstdc++ = "${target_libdir}/libstdc++.so.*"
 
+PACKAGES_append_multilib = " libgcc-${ARCH_MULTILIB} libssp-${ARCH_MULTILIB} libstdc++-${ARCH_MULTILIB} libg2c-${ARCH_MULTILIB} libgfortran-${ARCH_MULTILIB}"
+FILES_libgcc-${ARCH_MULTILIB} = "${layout_base_prefix}/${LIB_MULTILIB}/libgcc_s.so.1"
+FILES_libssp-${ARCH_MULTILIB} = "${layout_exec_prefix}/${LIB_MULTILIB}/libssp.so.*"
+FILES_libstdc++-${ARCH_MULTILIB} = "${layout_exec_prefix}/${LIB_MULTILIB}/libstdc++.so.*"
+FILES_libg2c-${ARCH_MULTILIB} = "${layout_exec_prefix}/${LIB_MULTILIB}/libg2c.so.*"
+FILES_libgfortran-${ARCH_MULTILIB} = "${layout_exec_prefix}/${LIB_MULTILIB}/libgfortran.so.*"
+
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
 
@@ -73,3 +80,31 @@ do_install () {
               cd $currdir
        fi
 }
+
+do_install_append_multilib () {
+	mkdir -p ${D}${base_multilibdir}
+        if [ -f ${D}${base_multilibdir}/libgcc_s.so.? ]; then
+                # Already in the right location
+                :
+        elif [ -f ${D}${prefix}/${LIB_MULTILIB}/libgcc_s.so.? ]; then
+                mv -f ${D}${prefix}/${LIB_MULTILIB}/libgcc_s.so* ${D}${base_multilibdir} || true
+        else
+                mv -f ${D}${prefix}/*/${LIB_MULTILIB}/libgcc_s.so* ${D}${base_multilibdir} || true 
+        fi
+
+        mkdir -p ${D}${multilibdir}
+
+        mv -f ${D}${prefix}/*/${LIB_MULTILIB}/libstdc++.so* ${D}${multilibdir} || true
+        mv -f ${D}${prefix}/*/${LIB_MULTILIB}/libg2c.so* ${D}${multilibdir} || true
+        mv -f ${D}${prefix}/*/${LIB_MULTILIB}/libgfortran*.so* ${D}${multilibdir} || true
+        mv -f ${D}${prefix}/*/${LIB_MULTILIB}/libssp*.so* ${D}${multilibdir} || true
+
+        # Manually run the target stripper since we won't get it run by
+        # the packaging.
+        if [ "x${OLD_INHIBIT_PACKAGE_STRIP}" != "x1" ]; then
+                ${TARGET_PREFIX}strip ${D}${multilibdir}/libstdc++.so.*
+                ${TARGET_PREFIX}strip ${D}${multilibdir}/libg2c.so.* || true
+                ${TARGET_PREFIX}strip ${D}${base_multilibdir}/libgcc_s.so.* || true
+                ${TARGET_PREFIX}strip ${D}${multilibdir}/libgfortran*.so* || true
+	fi
+}
Signature · 7 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#8 lore raw

PATCH 8/11 glibc: move get_glibc_fpu_setting to glibc.inc

---
 recipes/glibc/glibc-package.bbclass |    5 -----
 recipes/glibc/glibc.inc             |    5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)
recipes/glibc/glibc-package.bbclass +0 -5
index 89fbd1c..1690a30 100644
@@ -58,11 +58,6 @@ DESCRIPTION_ldd = "glibc: print shared library dependencies"
 DESCRIPTION_localedef = "glibc: compile locale definition files"
 DESCRIPTION_glibc-utils = "glibc: misc utilities like iconf, local, gencat, tzselect, rpcinfo, ..."
 
-def get_glibc_fpu_setting(bb, d):
-    if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
-        return "--without-fp"
-    return ""
-
 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
 
 OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
recipes/glibc/glibc.inc +5 -0
index c2ee531..1bdd62b 100644
@@ -17,6 +17,11 @@ LEAD_SONAME = "libc.so"
 GLIBC_EXTRA_OECONF ?= ""
 INHIBIT_DEFAULT_DEPS = "1"
 
+def get_glibc_fpu_setting(bb, d):
+	if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
+		return "--without-fp"
+	return ""
+
 ARM_INSTRUCTION_SET = "arm"
 
 PACKAGES = "glibc catchsegv sln nscd ldd localedef glibc-utils glibc-dev glibc-doc glibc-locale libsegfault glibc-extra-nss glibc-thread-db glibc-pcprofile"
Signature · 7 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#9 lore raw

PATCH 9/11 glibc: add initial-multilib

---
 recipes/glibc/glibc-initial-multilib_2.6.1.bb |    7 +++++++
 recipes/glibc/glibc-initial.inc               |    6 ++++--
 recipes/glibc/glibc-multilib.inc              |    9 +++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)
 create mode 100644 recipes/glibc/glibc-initial-multilib_2.6.1.bb
 create mode 100644 recipes/glibc/glibc-multilib.inc
recipes/glibc/glibc-initial-multilib_2.6.1.bb new file +7 -0
new file mode 100644
index 0000000..bd09fdb
@@ -0,0 +1,7 @@
+require glibc_${PV}.bb
+require glibc-initial.inc
+require glibc-multilib.inc
+
+do_configure_prepend () {
+	unset CFLAGS
+}
recipes/glibc/glibc-initial.inc +4 -2
index 5528cf8..306e0a0 100644
@@ -1,6 +1,7 @@
 SECTION = "libs"
-DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial linux-libc-headers"
-PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
+GLIBC_PREFIX ?= "${TARGET_PREFIX}"
+DEPENDS = "virtual/${GLIBC_PREFIX}gcc-initial linux-libc-headers"
+PROVIDES = "virtual/${GLIBC_PREFIX}libc-initial"
 FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/glibc-2.4', '${FILE_DIRNAME}/glibc-${PV}', '${FILE_DIRNAME}/glibc', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
 
 PACKAGES = ""
@@ -33,6 +34,7 @@ do_compile () {
 do_stage () {
 	oe_runmake cross-compiling=yes install_root=${STAGING_DIR_HOST} \
 	includedir='${layout_includedir}' prefix='${layout_prefix}' \
+	libdir='${layout_libdir}' slibdir='${layout_base_libdir}' \
 	install-bootstrap-headers=yes install-headers
 
 	oe_runmake csu/subdir_lib
recipes/glibc/glibc-multilib.inc new file +9 -0
new file mode 100644
index 0000000..910e9ee
@@ -0,0 +1,9 @@
+CC += "${CFLAGS_MULTILIB}"
+TARGET_SYS = "${TARGET_SYS_MULTILIB}"
+HOST_SYS = "${TARGET_SYS_MULTILIB}"
+TARGET_PREFIX = "${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}-"
+GLIBC_PREFIX = "${TARGET_SYS_MULTILIB}-"
+layout_libdir="${layout_exec_prefix}/${LIB_MULTILIB}"
+layout_includedir="${layout_exec_prefix}/include/${TARGET_SYS_MULTILIB}"
+layout_base_libdir="${layout_base_prefix}/${LIB_MULTILIB}"
+layout_libexecdir="${layout_libdir}"
Signature · 7 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#10 lore raw

PATCH 10/11 glibc: add multilib glibc

---
 recipes/glibc/glibc-multilib_2.6.1.bb        |  165 ++++++++++++++++++++++++++
 recipes/glibc/glibc-package-multilib.bbclass |   79 ++++++++++++
 recipes/glibc/glibc.inc                      |    5 +-
 recipes/glibc/glibc_2.6.1.bb                 |    2 +
 4 files changed, 249 insertions(+), 2 deletions(-)
 create mode 100644 recipes/glibc/glibc-multilib_2.6.1.bb
 create mode 100644 recipes/glibc/glibc-package-multilib.bbclass
recipes/glibc/glibc-multilib_2.6.1.bb new file +165 -0
new file mode 100644
index 0000000..0f36339
@@ -0,0 +1,165 @@
+require glibc.inc
+require glibc-multilib.inc
+
+PROVIDES = "virtual/${GLIBC_PREFIX}libc-for-gcc"
+PACKAGES_DYNAMIC = "libc6-${ARCH_MULTILIB}*"
+RPROVIDES_${PN}-dev = "libc6-${ARCH_MULTILIB}-dev virtual-libc-${ARCH_MULTILIB}-dev"
+
+# the -isystem in bitbake.conf screws up glibc do_stage
+BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${layout_includedir}"
+
+FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-2.4"
+
+GLIBC_ADDONS ?= "ports,nptl,libidn"
+
+GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN"
+
+#
+# For now, we will skip building of a gcc package if it is a uclibc one
+# and our build is not a uclibc one, and we skip a glibc one if our build
+# is a uclibc build.
+#
+# See the note in gcc/gcc_3.4.0.oe
+#
+
+python __anonymous () {
+    import bb, re
+    uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
+    if uc_os:
+	raise bb.parse.SkipPackage("incompatible with target %s" %
+				   bb.data.getVar('TARGET_OS', d, 1))
+}
+
+RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
+
+SRC_URI = "\
+  ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2 \
+  ftp://ftp.gnu.org/pub/gnu/glibc/glibc-ports-${PV}.tar.bz2 \
+  ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-${PV}.tar.bz2 \
+  file://arm-memcpy.patch;patch=1 \
+  file://arm-longlong.patch;patch=1 \
+  file://fhs-linux-paths.patch;patch=1 \
+  file://dl-cache-libcmp.patch;patch=1 \
+  file://ldsocache-varrun.patch;patch=1 \
+  file://nptl-crosscompile.patch;patch=1 \
+  file://glibc-2.5-local-dynamic-resolvconf.patch;patch=1;pnum=0 \
+  file://glibc-check_pf.patch;patch=1;pnum=0 \
+  file://zecke-sane-readelf.patch;patch=1 \
+  file://ldd-unbash.patch;patch=1 \
+  file://generic-bits_select.h \
+  file://generic-bits_types.h \
+  file://generic-bits_typesizes.h \
+  file://generic-bits_time.h \
+  file://etc/ld.so.conf \
+  file://generate-supported.mk \
+  file://glibc-2.6.1-RTLD_SINGLE_THREAD_P-1.patch;patch=1 \
+  file://glibc-2.6.1-use-short-for-fnstsw.patch;patch=1 \
+  file://glibc-use-isystem-include-fixed.patch;patch=1 \
+  file://glibc-arm-no-asm-page.patch;patch=1 \
+  file://armv4t-interworking.patch;patch=1 \
+  file://march-i686.patch;patch=1;pnum=0 \
+"
+
+# Build fails on sh3 and sh4 without additional patches
+SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1"
+SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1"
+
+# PowerPC Patches to add support for soft-float
+SRC_URI_append_powerpc = "\
+  file://powerpc-sqrt-hack.diff;patch=1 \
+  file://glibc-2.6.1-powerpc-nofpu.patch;patch=1 \
+"
+
+S = "${WORKDIR}/glibc-${PV}"
+B = "${WORKDIR}/build-${TARGET_SYS}"
+
+EXTRA_OECONF = "\
+  --enable-kernel=${OLDEST_KERNEL} \
+  --without-cvs --disable-profile --disable-debug --without-gd \
+  --enable-clocale=gnu \
+  --enable-add-ons=${GLIBC_ADDONS} \
+  --with-headers=${STAGING_INCDIR} \
+  --without-selinux \
+  ${GLIBC_EXTRA_OECONF} \
+"
+
+EXTRA_OEMAKE += "asm-CPPFLAGS="${CFLAGS_MULTILIB}""
+
+EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
+
+do_munge() {
+	# Integrate ports and libidn into tree
+	mv ${WORKDIR}/glibc-ports-${PV} ${S}/ports
+	mv ${WORKDIR}/glibc-libidn-${PV} ${S}/libidn
+
+	# Ports isn't really working... Fix it
+	# Some of this is rather dirty, but it seems to be the only
+	# quick way to get this cruft to compile
+	rm -rf ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
+	ln -s nptl ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
+	cp ${S}/nptl/sysdeps/pthread/bits/sigthread.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
+	cp ${S}/sysdeps/unix/sysv/linux/i386/bits/wchar.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
+	cp ${S}/sysdeps/wordsize-32/bits/wordsize.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
+	cp ${WORKDIR}/generic-bits_select.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/select.h
+	cp ${WORKDIR}/generic-bits_types.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/types.h
+	cp ${WORKDIR}/generic-bits_typesizes.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/typesizes.h
+	cp ${WORKDIR}/generic-bits_time.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/time.h
+	# Copy in generic stuff for not yet implemented headers
+	for i in ${S}/bits/*.h; do
+		F=`basename $i`
+		[ "$F" = "local_lim.h" ] && continue
+		[ "$F" = "errno.h" ] && continue
+		test -e ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/$F || test -e ${S}/ports/sysdeps/arm/bits/$F || test -e ${S}/sysdeps/unix/sysv/linux/bits/$F || test -e ${S}/sysdeps/ieee754/bits/$F || cp $i ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
+	done
+	# This is harmful; we need to get the one from nptl/sysdeps/pthreads
+	rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/libc-lock.h
+	# Obsoleted by sysdeps/arm/{fpu,eabi}/bits/fenv.h
+	rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/fenv.h
+	# Obsoleted by sysdeps/gnu/bits/utmp.h
+	rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/utmp.h
+}
+
+addtask munge before do_patch after do_unpack
+
+
+do_configure () {
+# override this function to avoid the autoconf/automake/aclocal/autoheader
+# calls for now
+# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
+# version check and doesn't really help with anything
+	if [ -z "`which rpcgen`" ]; then
+		echo "rpcgen not found.  Install glibc-devel."
+		exit 1
+	fi
+	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+	export libc_cv_slibdir=${layout_base_libdir}
+	export libc_cv_forced_unwind=yes
+	export libc_cv_c_cleanup=yes
+	export libc_cv_gnu99_inline=yes
+	CPPFLAGS="" oe_runconf
+}
+
+rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
+	  yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
+	  rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
+
+do_compile () {
+	# -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
+	unset LDFLAGS
+	export libc_cv_slibdir=${layout_base_libdir}
+	export libc_cv_forced_unwind=yes
+	export libc_cv_c_cleanup=yes
+	export libc_cv_gnu99_inline=yes
+	base_do_compile
+	(
+		cd ${S}/sunrpc/rpcsvc
+		for r in ${rpcsvc}; do
+			h=`echo $r|sed -e's,\.x$,.h,'`
+			rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
+		done
+	)
+}
+
+require glibc-stage.inc
+require glibc-package-multilib.bbclass
recipes/glibc/glibc-package-multilib.bbclass new file +79 -0

79 lines not on this page · raw message

recipes/glibc/glibc.inc +3 -2
index 1bdd62b..ab19f0a 100644
@@ -3,11 +3,12 @@ HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
 SECTION = "libs"
 PRIORITY = "required"
 LICENSE = "LGPL"
+GLIBC_PREFIX ?= "${TARGET_PREFIX}"
 # nptl needs unwind support in gcc, which can't be built without glibc.
-DEPENDS = "virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers"
+DEPENDS = "virtual/${GLIBC_PREFIX}gcc-intermediate linux-libc-headers"
 #this leads to circular deps, so lets not add it yet
 #RDEPENDS_ldd += " bash"
-PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
+PROVIDES = "virtual/libc virtual/${GLIBC_PREFIX}libc-for-gcc"
 PROVIDES += "virtual/libintl virtual/libiconv"
 
 inherit autotools
recipes/glibc/glibc_2.6.1.bb +2 -0
index c1a9598..9a13e84 100644
@@ -132,6 +132,7 @@ do_configure () {
 		exit 1
 	fi
 	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+	export libc_cv_slibdir=${layout_base_libdir}
 	CPPFLAGS="" oe_runconf
 }
 
@@ -142,6 +143,7 @@ rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
 do_compile () {
 	# -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
 	unset LDFLAGS
+	export libc_cv_slibdir=${layout_base_libdir}
 	base_do_compile
 	(
 		cd ${S}/sunrpc/rpcsvc
Signature · 7 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#11 lore raw

PATCH 11/11 package.bbclass: add multilib libdir to search path

---
 classes/package.bbclass |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
classes/package.bbclass +5 -1
index 7a61c5a..e251e73 100644
@@ -564,7 +564,11 @@ python package_do_shlibs() {
 		return
 		
 	lib_re = re.compile("^lib.*\.so")
-	libdir_re = re.compile(".*/lib$")
+	multilibdir = bb.data.getVar('LIB_MULTILIB', d, 1)
+	if not multilibdir:
+		libdir_re = re.compile(".*/lib$")
+	else:
+		libdir_re = re.compile(".*/(lib|%s)$" % (multilibdir))
 
 	packages = bb.data.getVar('PACKAGES', d, 1)
 
Signature · 7 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#12 lore raw

Re: [PATCH 08/11] glibc: move get_glibc_fpu_setting to glibc.inc

In reply to Roman I Khimov
Quoted 28 lines · Roman I Khimov
---
 recipes/glibc/glibc-package.bbclass |    5 -----
 recipes/glibc/glibc.inc             |    5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)
recipes/glibc/glibc-package.bbclass +0 -5
index 89fbd1c..1690a30 100644
@@ -58,11 +58,6 @@ DESCRIPTION_ldd = "glibc: print shared library dependencies"
 DESCRIPTION_localedef = "glibc: compile locale definition files"
 DESCRIPTION_glibc-utils = "glibc: misc utilities like iconf, local, gencat, tzselect, rpcinfo, ..."
 
-def get_glibc_fpu_setting(bb, d):
-    if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
-        return "--without-fp"
-    return ""
-
 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
 
 OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
recipes/glibc/glibc.inc +0 -0
index c2ee531..1bdd62b 100644
@@ -17,6 +17,11 @@ LEAD_SONAME = "libc.so"
 GLIBC_EXTRA_OECONF ?= ""

recipes/glibc/glibc.inc LEAD_SONAME = "libc.so" · line 27

Quoted 10 lines
recipes/glibc/glibc.inc +5 -0
 INHIBIT_DEFAULT_DEPS = "1"
 
+def get_glibc_fpu_setting(bb, d):
+	if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
+		return "--without-fp"
+	return ""
+
 ARM_INSTRUCTION_SET = "arm"
 
 PACKAGES = "glibc catchsegv sln nscd ldd localedef glibc-utils glibc-dev glibc-doc glibc-locale libsegfault glibc-extra-nss glibc-thread-db glibc-pcprofile"

why is this patch required. Can you also do multilib stuff for eglibc too

Quoted 13 lines

1.6.2.1

Signature · 9 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
#13 lore raw

Re: [PATCH 08/11] glibc: move get_glibc_fpu_setting to glibc.inc

Quoted 7 lines · On Wednesday 15 April 2009 23:28:45 Khem Raj wrote:
Quoted 4 lines · Roman I Khimov
---
 recipes/glibc/glibc-package.bbclass |    5 -----
 recipes/glibc/glibc.inc             |    5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

why is this patch required.

It is required for glibc-multilib as glibc-multilib includes glibc-package-multilib and not glibc-package, it got a bit out of order, maybe need to squash it with glibc-multilib addition.

Quoted 1 line

Can you also do multilib stuff for eglibc too

Well, let's handle glibc first and settle on overall multilib approach. :) Then adding eglibc and uclibc will be routine.

#14 lore raw

Re: [PATCH 04/11] gcc 4.2.4: add gcc-multilib64dir.patch

In reply to Roman I Khimov
Quoted 60 lines · Roman I Khimov
---
 recipes/gcc/files/gcc-multilib64dir.patch |   43 +++++++++++++++++++++++++++++
 recipes/gcc/gcc-4.2.4.inc                 |    1 +
 2 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100644 recipes/gcc/files/gcc-multilib64dir.patch
recipes/gcc/files/gcc-multilib64dir.patch new file +43 -0
new file mode 100644
index 0000000..301e596
@@ -0,0 +1,43 @@
+#! /bin/sh -e
+
+# DP: Use lib instead of lib64 as multilibdir on amd64 and ppc64.
+#
+# Taken from Debian, fixed to apply with quilt
+
+Index: gcc/config/i386/t-linux64
+===================================================================
+--- gcc/config/i386/t-linux64	(revision 130706)
++++ gcc/config/i386/t-linux64	(working copy)
+@@ -13,7 +13,7 @@
+ 
+ MULTILIB_OPTIONS = m64/m32
+ MULTILIB_DIRNAMES = 64 32 
+-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
++MULTILIB_OSDIRNAMES = ../lib $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
+ 
+ LIBGCC = stmp-multilib
+ INSTALL_LIBGCC = install-multilib
+Index: gcc/config/rs6000/t-linux64
+===================================================================
+--- gcc/config/rs6000/t-linux64	(revision 130706)
++++ gcc/config/rs6000/t-linux64	(working copy)
+@@ -14,13 +14,13 @@
+ # it doesn't tell anything about the 32bit libraries on those systems.  Set
+ # MULTILIB_OSDIRNAMES according to what is found on the target.
+ 
+-MULTILIB_OPTIONS        = m64/m32 msoft-float
+-MULTILIB_DIRNAMES       = 64 32 nof
++MULTILIB_OPTIONS        = m64/m32
++MULTILIB_DIRNAMES       = 64 32
+ MULTILIB_EXTRA_OPTS     = fPIC mstrict-align
+-MULTILIB_EXCEPTIONS     = m64/msoft-float
+-MULTILIB_EXCLUSIONS     = m64/!m32/msoft-float
+-MULTILIB_OSDIRNAMES	= ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) nof
+-MULTILIB_MATCHES        = $(MULTILIB_MATCHES_FLOAT)
++MULTILIB_EXCEPTIONS     =
++MULTILIB_EXCLUSIONS     =
++MULTILIB_OSDIRNAMES	= ../lib $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
++MULTILIB_MATCHES        =
+ 
+ softfp_wrap_start := '\#ifndef __powerpc64__'
+ softfp_wrap_end := '\#endif'
recipes/gcc/gcc-4.2.4.inc +0 -0
index 085f241..20bdfef 100644

recipes/gcc/gcc-4.2.4.inc SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \ · line 43

Quoted 7 lines
recipes/gcc/gcc-4.2.4.inc +1 -0
@@ -37,6 +37,7 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
 	file://gcc-4.0.2-e300c2c3.patch;patch=1 \
 	file://fortran-static-linking.patch;patch=1 \
 	file://intermask-bigendian.patch;patch=1 \
+	file://gcc-multilib64dir.patch;patch=1;pnum=0 \
 "
 
 SRC_URI_append_ep93xx = " \

which multilib are you chosing as default? if it is 64 bit then the patch is ok.

Quoted 14 lines
Signature · 13 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
#15 lore raw

Re: [PATCH 04/11] gcc 4.2.4: add gcc-multilib64dir.patch

Quoted 2 lines · On Wednesday 15 April 2009 23:23:10 Khem Raj wrote:

which multilib are you chosing as default? if it is 64 bit then the patch is ok.

Default and 'primary' or 'native' is 64-bit, so it all goes into /lib and /usr/lib and 32-bit being 'supplementary' in /lib32 and /usr/lib32.

#16 lore raw

Re: [PATCH 04/11] gcc 4.2.4: add gcc-multilib64dir.patch

In reply to Roman I Khimov
Quoted 5 lines · Roman I Khimov
---
 recipes/gcc/files/gcc-multilib64dir.patch |   43 +++++++++++++++++++++++++++++
 recipes/gcc/gcc-4.2.4.inc                 |    1 +
 2 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100644 recipes/gcc/files/gcc-multilib64dir.patch

Does this apply as-is to 4.1 and 4.3 too? If not, lets name it gcc-4.2.x-multilib64dir.patch.

Signature · 1 line
Tom Rini
#17 lore raw

Re: [PATCH 04/11] gcc 4.2.4: add gcc-multilib64dir.patch

Quoted 10 lines · On Friday 17 April 2009 02:10:15 Tom Rini wrote:
Quoted 6 lines · Roman I Khimov
---
 recipes/gcc/files/gcc-multilib64dir.patch |   43
+++++++++++++++++++++++++++++ recipes/gcc/gcc-4.2.4.inc                 |
   1 +
 2 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100644 recipes/gcc/files/gcc-multilib64dir.patch

Does this apply as-is to 4.1 and 4.3 too? If not, lets name it gcc-4.2.x-multilib64dir.patch.

Not tried yet. Again, this is primarily for review/feedback on overall approach. If everything is OK, then I can try add more gcc/glibc versions as already done with binutils.

#18 lore raw

Re: [PATCH 04/11] gcc 4.2.4: add gcc-multilib64dir.patch

Quoted 9 lines · Roman I Khimov
Quoted 8 lines · On Friday 17 April 2009 02:10:15 Tom Rini wrote:
Quoted 6 lines · Roman I Khimov
---
 recipes/gcc/files/gcc-multilib64dir.patch |   43
+++++++++++++++++++++++++++++ recipes/gcc/gcc-4.2.4.inc                 |
   1 +
 2 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100644 recipes/gcc/files/gcc-multilib64dir.patch
Quoted 6 lines
Quoted 2 lines

Does this apply as-is to 4.1 and 4.3 too? If not, lets name it gcc-4.2.x-multilib64dir.patch.

Not tried yet. Again, this is primarily for review/feedback on overall approach. If everything is OK, then I can try add more gcc/glibc versions as already done with binutils.

I think we're all in agreement that the approach (do what Debian does) is fine. So lets move on to making sure most distro's can easily take this in :)

Signature · 1 line
Tom Rini
#19 lore raw

Re: [PATCH 03/11] linux-libc-headers 2.6.23: fix amd64 headers

In reply to Roman I Khimov
Quoted 16 lines · Roman I Khimov

Taken from http://bugs.openembedded.net/show_bug.cgi?id=1728

---
 .../linux-libc-headers_2.6.23.bb                   |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
recipes/linux-libc-headers/linux-libc-headers_2.6.23.bb +3 -0
index 13579f9..db13a45 100644
@@ -63,4 +63,16 @@ 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}" == "x86_64" ]; then
+		cp -pfLR ${STAGE_TEMP}${includedir}/asm-x86_64 ${STAGING_INCDIR}/
+		cp -pfLR ${STAGE_TEMP}${includedir}/asm-i386 ${STAGING_INCDIR}/

recipes/linux-libc-headers/linux-libc-headers_2.6.23.bb do_stage () { · line 78

Quoted 10 lines
recipes/linux-libc-headers/linux-libc-headers_2.6.23.bb +9 -0
+	fi
+}
+
+do_stage_append_multilib () {
+	mkdir ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}
+	ln -s ../linux ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}/linux
+	ln -s ../asm ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}/asm
+	ln -s ../asm-generic ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}/asm-generic
+	ln -s ../asm-i386 ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}/asm-i386
 }

is there any reason not to use sanitized header like we do in do_install even for do_stage

Quoted 14 lines
Signature · 13 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
#20 lore raw

Re: [PATCH 03/11] linux-libc-headers 2.6.23: fix amd64 headers

Quoted 7 lines · On Wednesday 15 April 2009 23:09:13 Khem Raj wrote:

recipes/linux-libc-headers/linux-libc-headers_2.6.23.bb do_stage () {

Quoted 3 lines · Roman I Khimov
recipes/linux-libc-headers/linux-libc-headers_2.6.23.bb +0 -0
@@ -63,4 +63,16 @@ do_stage () {

is there any reason not to use sanitized header like we do in do_install even for do_stage

I think this is the way to go for newer kernels and it can be generalized in some .inc for future. This approach is used now in linux-libc-headers_2.6.29.bb, but 2.6.23 historically uses this kind of do_stage and I don't think we should change that now.

BTW, we have locally a patch modifying kernel.bbclass to also use headers_install in kernel_do_stage for newer kernels. One of many things I still need to prepare and push.

#21 lore raw

Re: [PATCH 03/11] linux-libc-headers 2.6.23: fix amd64 headers

Quoted 9 lines · Roman I Khimov
Quoted 7 lines · On Wednesday 15 April 2009 23:09:13 Khem Raj wrote:

recipes/linux-libc-headers/linux-libc-headers_2.6.23.bb do_stage () {

Quoted 3 lines · Roman I Khimov
recipes/linux-libc-headers/linux-libc-headers_2.6.23.bb +0 -0
@@ -63,4 +63,16 @@ do_stage () {

is there any reason not to use sanitized header like we do in do_install even for do_stage

Quoted 4 lines

I think this is the way to go for newer kernels and it can be generalized in some .inc for future. This approach is used now in linux-libc-headers_2.6.29.bb, but 2.6.23 historically uses this kind of do_stage and I don't think we should change that now.

OK. On that note can you test if your stuff works with 2.6.29 kernel headers ?

Quoted 4 lines

BTW, we have locally a patch modifying kernel.bbclass to also use headers_install in kernel_do_stage for newer kernels. One of many things I still need to prepare and push.

yeah I have always wanted something like that. However its required pretty early in the build phase thats why we have linux-libc-headers

Quoted 6 lines

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

Signature · 1 line
Khem Raj
#22 lore raw

Re: [PATCH 03/11] linux-libc-headers 2.6.23: fix amd64 headers

Quoted 10 lines · On Thursday 16 April 2009 11:12:41 Khem Raj wrote:
Quoted 9 lines · Roman I Khimov
Quoted 7 lines · On Wednesday 15 April 2009 23:09:13 Khem Raj wrote:

recipes/linux-libc-headers/linux-libc-headers_2.6.23.bb do_stage () {

Quoted 3 lines · Roman I Khimov
recipes/linux-libc-headers/linux-libc-headers_2.6.23.bb +0 -0
@@ -63,4 +63,16 @@ do_stage () {

is there any reason not to use sanitized header like we do in do_install even for do_stage

Quoted 7 lines
Quoted 4 lines

I think this is the way to go for newer kernels and it can be generalized in some .inc for future. This approach is used now in linux-libc-headers_2.6.29.bb, but 2.6.23 historically uses this kind of do_stage and I don't think we should change that now.

OK. On that note can you test if your stuff works with 2.6.29 kernel headers ?

With minor correction of

recipes/linux-libc-headers/linux-libc-headers_2.6.29.bb +7 -0
@@ -47,3 +47,10 @@ do_stage () {
 	set_arch
 	oe_runmake headers_install INSTALL_HDR_PATH=${STAGING_DIR_HOST}${layout_prefix} ARCH=$ARCH
 }
+
+do_stage_append_multilib () {
+	install -d ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}
+	ln -s ../linux ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}/linux
+	ln -s ../asm ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}/asm
+	ln -s ../asm-generic ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB}/asm-generic
+}

it works nice. As you can see, I'm using ${STAGING_INCDIR}/${TARGET_SYS_MULTILIB} for supplementary system headers.

#23 lore raw

Re: [PATCH 02/11] binutils: add binutils-x86_64_i386_biarch.patch

In reply to Roman I Khimov
Quoted 42 lines · Roman I Khimov
---
 .../binutils-x86_64_i386_biarch.patch              |   25 ++++++++++++++++++++
 recipes/binutils/binutils_2.18.bb                  |    2 +-
 2 files changed, 26 insertions(+), 1 deletions(-)
 create mode 100644 recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch
recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils_2.18.bb +0 -0
index 9367196..562c8ba 100644

recipes/binutils/binutils_2.18.bb SRC_URI = "\ · line 19

Quoted 9 lines
recipes/binutils/binutils_2.18.bb +1 -1
@@ -12,8 +12,8 @@ SRC_URI = "\
      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-gas-needs-libm.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
 SRC_URI += "file://binutils-2.16.1-e300c2c3.patch;patch=1"
-

Looks ok. Could you also make this on later versions of toolchains. I am not worried about the older ones.

Quoted 14 lines
Signature · 13 lines
1.6.2.1


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
#24 lore raw

Re: [PATCH 02/11] binutils: add binutils-x86_64_i386_biarch.patch

Quoted 11 lines · On Wednesday 15 April 2009 23:25:12 Khem Raj wrote:
Quoted 7 lines · Roman I Khimov
---
 .../binutils-x86_64_i386_biarch.patch              |   25
++++++++++++++++++++ recipes/binutils/binutils_2.18.bb                  |
   2 +-
 2 files changed, 26 insertions(+), 1 deletions(-)
 create mode 100644

recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch

Looks ok. Could you also make this on later versions of toolchains. I am not worried about the older ones.

Works good with 2.19 and 2.19.1, but not 2.18.50.0.7. Not sure it makes sense to adapt it there and add more patch versions to tree. See attached.

From 9aec05acf54fede5890297665bf98995f04eba2d Mon Sep 17 00:00:00 2001
From: Roman I Khimov <[email protected]>
Date: Wed, 15 Apr 2009 15:48:22 +0400
Subject: [PATCH 02/11] binutils: add binutils-x86_64_i386_biarch.patch

Adds 'lib32' directories to binutils search paths on x86_64.

---
 recipes/binutils/binutils_2.18.bb                  |    2 +-
 recipes/binutils/binutils_2.19.1.bb                |    1 +
 recipes/binutils/binutils_2.19.bb                  |    1 +
 .../files/binutils-x86_64_i386_biarch.patch        |   25 ++++++++++++++++++++
 4 files changed, 28 insertions(+), 1 deletions(-)
 create mode 100644 recipes/binutils/files/binutils-x86_64_i386_biarch.patch
recipes/binutils/binutils_2.18.bb +1 -1
index 9367196..562c8ba 100644
@@ -12,8 +12,8 @@ SRC_URI = "\
      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-gas-needs-libm.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
 SRC_URI += "file://binutils-2.16.1-e300c2c3.patch;patch=1"
-
recipes/binutils/binutils_2.19.1.bb +1 -0
index c399ab8..1802dfb 100644
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
recipes/binutils/binutils_2.19.bb +1 -0
index aee5840..782d5c7 100644
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
recipes/binutils/files/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
Signature · 1 line
1.6.2.1
#25 lore raw

Re: [PATCH 02/11] binutils: add binutils-x86_64_i386_biarch.patch

Quoted 10 lines · Roman I Khimov
Quoted 9 lines · On Wednesday 15 April 2009 23:25:12 Khem Raj wrote:
Quoted 7 lines · Roman I Khimov
---
 .../binutils-x86_64_i386_biarch.patch              |   25
++++++++++++++++++++ recipes/binutils/binutils_2.18.bb                  |
   2 +-
 2 files changed, 26 insertions(+), 1 deletions(-)
 create mode 100644

recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch

Quoted 4 lines
Quoted 2 lines

Looks ok. Could you also make this on later versions of toolchains. I am not worried about the older ones.

Works good with 2.19 and 2.19.1, but not 2.18.50.0.7.

FWIW 2.18.50.0.7 is default binutils for some distros (angstrom)

Quoted 3 lines

Not sure it makes sense
to adapt it there and add more patch versions to tree. See attached.

Signature · 1 line
Khem Raj
#26 lore raw

Re: [PATCH 02/11] binutils: add binutils-x86_64_i386_biarch.patch

Quoted 11 lines · On Thursday 16 April 2009 11:14:29 Khem Raj wrote:
Quoted 10 lines · Roman I Khimov
Quoted 9 lines · On Wednesday 15 April 2009 23:25:12 Khem Raj wrote:
Quoted 7 lines · Roman I Khimov
---
 .../binutils-x86_64_i386_biarch.patch              |   25
++++++++++++++++++++ recipes/binutils/binutils_2.18.bb               
  | 2 +-
 2 files changed, 26 insertions(+), 1 deletions(-)
 create mode 100644

recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Looks ok. Could you also make this on later versions of toolchains. I am not worried about the older ones.

Works good with 2.19 and 2.19.1, but not 2.18.50.0.7.

FWIW 2.18.50.0.7 is default binutils for some distros (angstrom)

True, didn't check initially its usage, so it's going to be something like attached.

Do I need to bump PR's for all binutils touched?

From 39ead7fd8b9d8b3687b8564828fad4e9d52b128a Mon Sep 17 00:00:00 2001
From: Roman I Khimov <[email protected]>
Date: Wed, 15 Apr 2009 15:48:22 +0400
Subject: [PATCH 02/11] binutils: add binutils-x86_64_i386_biarch.patch

Adds 'lib32' directories to binutils search paths on x86_64.

---
 .../binutils-x86_64_i386_biarch.patch              |   26 ++++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   25 +++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   25 +++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   25 +++++++++++++++++++
 recipes/binutils/binutils_2.18.50.0.7.bb           |    1 +
 recipes/binutils/binutils_2.18.bb                  |    2 +-
 recipes/binutils/binutils_2.19.1.bb                |    1 +
 recipes/binutils/binutils_2.19.bb                  |    1 +
 8 files changed, 105 insertions(+), 1 deletions(-)
 create mode 100644 recipes/binutils/binutils-2.18.50.0.7/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.19.1/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.19/binutils-x86_64_i386_biarch.patch
recipes/binutils/binutils-2.18.50.0.7/binutils-x86_64_i386_biarch.patch new file +26 -0
new file mode 100644
index 0000000..6054434
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+# Adapted to binutils 2.18.50.0.7
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
+ SHARABLE_SECTIONS=yes
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.19.1/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.19/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils_2.18.50.0.7.bb +1 -0
index a89431e..fbd9189 100644
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
recipes/binutils/binutils_2.18.bb +1 -1
index 9367196..562c8ba 100644
@@ -12,8 +12,8 @@ SRC_URI = "\
      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-gas-needs-libm.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
 SRC_URI += "file://binutils-2.16.1-e300c2c3.patch;patch=1"
-
recipes/binutils/binutils_2.19.1.bb +1 -0
index c399ab8..1802dfb 100644
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
recipes/binutils/binutils_2.19.bb +1 -0
index aee5840..782d5c7 100644
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
Signature · 1 line
1.6.2.1
#27 lore raw

Re: [PATCH 02/11] binutils: add?binutils-x86_64_i386_biarch.patch

Quoted 15 lines · Roman I Khimov
Quoted 14 lines · On Thursday 16 April 2009 11:14:29 Khem Raj wrote:
Quoted 13 lines · Roman I Khimov
Quoted 11 lines · On Wednesday 15 April 2009 23:25:12 Khem Raj wrote:
Quoted 7 lines · Roman I Khimov
---
 .../binutils-x86_64_i386_biarch.patch              |   25
++++++++++++++++++++ recipes/binutils/binutils_2.18.bb               
  | 2 +-
 2 files changed, 26 insertions(+), 1 deletions(-)
 create mode 100644

recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch

Looks ok. Could you also make this on later versions of toolchains. I am not worried about the older ones.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Works good with 2.19 and 2.19.1, but not 2.18.50.0.7.

FWIW 2.18.50.0.7 is default binutils for some distros (angstrom)

True, didn't check initially its usage, so it's going to be something like attached.

Do I need to bump PR's for all binutils touched?

yes.

Quoted 204 lines

From 39ead7fd8b9d8b3687b8564828fad4e9d52b128a Mon Sep 17 00:00:00 2001
From: Roman I Khimov <[email protected]>
Date: Wed, 15 Apr 2009 15:48:22 +0400
Subject: [PATCH 02/11] binutils: add binutils-x86_64_i386_biarch.patch

Adds 'lib32' directories to binutils search paths on x86_64.

---
 .../binutils-x86_64_i386_biarch.patch              |   26 ++++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   25 +++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   25 +++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   25 +++++++++++++++++++
 recipes/binutils/binutils_2.18.50.0.7.bb           |    1 +
 recipes/binutils/binutils_2.18.bb                  |    2 +-
 recipes/binutils/binutils_2.19.1.bb                |    1 +
 recipes/binutils/binutils_2.19.bb                  |    1 +
 8 files changed, 105 insertions(+), 1 deletions(-)
 create mode 100644 recipes/binutils/binutils-2.18.50.0.7/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.19.1/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.19/binutils-x86_64_i386_biarch.patch
recipes/binutils/binutils-2.18.50.0.7/binutils-x86_64_i386_biarch.patch new file +26 -0
new file mode 100644
index 0000000..6054434
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+# Adapted to binutils 2.18.50.0.7
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
+ SHARABLE_SECTIONS=yes
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.19.1/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.19/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils_2.18.50.0.7.bb +1 -0
index a89431e..fbd9189 100644
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
recipes/binutils/binutils_2.18.bb +1 -1
index 9367196..562c8ba 100644
@@ -12,8 +12,8 @@ SRC_URI = "\
      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-gas-needs-libm.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
 SRC_URI += "file://binutils-2.16.1-e300c2c3.patch;patch=1"
-
recipes/binutils/binutils_2.19.1.bb +1 -0
index c399ab8..1802dfb 100644
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
recipes/binutils/binutils_2.19.bb +1 -0
index aee5840..782d5c7 100644
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
Signature · 7 lines
1.6.2.1


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
#28 lore raw

Re: [PATCH 02/11] binutils: add?binutils-x86_64_i386_biarch.patch

Quoted 20 lines · On Saturday 18 April 2009 02:37:35 Khem Raj wrote:
Quoted 19 lines · Roman I Khimov
Quoted 18 lines · On Thursday 16 April 2009 11:14:29 Khem Raj wrote:
Quoted 16 lines · Roman I Khimov
Quoted 5 lines · On Wednesday 15 April 2009 23:25:12 Khem Raj wrote:
Quoted 4 lines · Roman I Khimov
---
 .../binutils-x86_64_i386_biarch.patch              |   25

++++++++++++++++++++ recipes/binutils/binutils_2.18.bb

Quoted 8 lines
Quoted 5 lines

| 2 +-

 2 files changed, 26 insertions(+), 1 deletions(-)
 create mode 100644

recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch

Looks ok. Could you also make this on later versions of toolchains. I am not worried about the older ones.

Works good with 2.19 and 2.19.1, but not 2.18.50.0.7.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

FWIW 2.18.50.0.7 is default binutils for some distros (angstrom)

True, didn't check initially its usage, so it's going to be something like attached.

Do I need to bump PR's for all binutils touched?

yes.

OK, attached.

From 660fc9691349ec5cbae42e06b6f9cc9d7b3c947a Mon Sep 17 00:00:00 2001
From: Roman I Khimov <[email protected]>
Date: Wed, 15 Apr 2009 15:48:22 +0400
Subject: [PATCH 02/11] binutils: add binutils-x86_64_i386_biarch.patch

Adds 'lib32' directories to binutils search paths on x86_64.

---
 .../binutils-x86_64_i386_biarch.patch              |   26 ++++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   25 +++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   25 +++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   25 +++++++++++++++++++
 recipes/binutils/binutils_2.18.50.0.7.bb           |    3 +-
 recipes/binutils/binutils_2.18.bb                  |    4 +-
 recipes/binutils/binutils_2.19.1.bb                |    3 +-
 recipes/binutils/binutils_2.19.bb                  |    3 +-
 8 files changed, 109 insertions(+), 5 deletions(-)
 create mode 100644 recipes/binutils/binutils-2.18.50.0.7/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.19.1/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.19/binutils-x86_64_i386_biarch.patch
recipes/binutils/binutils-2.18.50.0.7/binutils-x86_64_i386_biarch.patch new file +26 -0
new file mode 100644
index 0000000..6054434
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+# Adapted to binutils 2.18.50.0.7
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
+ SHARABLE_SECTIONS=yes
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.19.1/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.19/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils_2.18.50.0.7.bb +2 -1
index a89431e..eb00a2d 100644
@@ -1,4 +1,4 @@
-PR = "r6"
+PR = "r7"
 
 require binutils.inc
 
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
recipes/binutils/binutils_2.18.bb +2 -2
index 9367196..8370538 100644
@@ -1,4 +1,4 @@
-PR = "r4"
+PR = "r5"
 
 require binutils.inc
 
@@ -12,8 +12,8 @@ SRC_URI = "\
      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-gas-needs-libm.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
 SRC_URI += "file://binutils-2.16.1-e300c2c3.patch;patch=1"
-
recipes/binutils/binutils_2.19.1.bb +2 -1
index c399ab8..782d5c7 100644
@@ -1,4 +1,4 @@
-PR = "r0"
+PR = "r1"
 
 require binutils.inc
 
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
recipes/binutils/binutils_2.19.bb +2 -1
index aee5840..072ac56 100644
@@ -1,4 +1,4 @@
-PR = "r1"
+PR = "r2"
 
 require binutils.inc
 
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
Signature · 1 line
1.6.2.1
#29 lore raw

Re: [PATCH 02/11] binutils: add?binutils-x86_64_i386_biarch.patch

Quoted 1 line · On Saturday 18 April 2009 19:44:13 Roman I Khimov wrote:

OK, attached.

And, BTW, I think this one is ready to go too.

Acked-by
#30 lore raw

Re: [PATCH 02/11] binutils:?add?binutils-x86_64_i386_biarch.patch

Quoted 2 lines · Roman I Khimov
Quoted 1 line · On Saturday 18 April 2009 19:44:13 Roman I Khimov wrote:

OK, attached.

ok

Quoted 7 lines

And, BTW, I think this one is ready to go too.

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#31 lore raw

Re: [PATCH 02/11] binutils:?add?binutils-x86_64_i386_biarch.patch

Quoted 7 lines · On Thursday 23 April 2009 08:42:01 Khem Raj wrote:
Quoted 2 lines · Roman I Khimov
Quoted 1 line · On Saturday 18 April 2009 19:44:13 Roman I Khimov wrote:

OK, attached.

ok

New binutils were introduced recently, so I've upgraded patch to handle those as well, please ACK new version and I'll commit it then.

From 97b047e692baba9896bd555a72654bd3e9ca6289 Mon Sep 17 00:00:00 2001
From: Roman I Khimov <[email protected]>
Date: Wed, 15 Apr 2009 15:48:22 +0400
Subject: [PATCH 02/13] binutils: add binutils-x86_64_i386_biarch.patch

Adds 'lib32' directories to binutils search paths on x86_64.

---
 .../binutils-x86_64_i386_biarch.patch              |   26 ++++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   25 +++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   25 +++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   26 ++++++++++++++++++++
 .../binutils-x86_64_i386_biarch.patch              |   25 +++++++++++++++++++
 recipes/binutils/binutils_2.18.50.0.7.bb           |    3 +-
 recipes/binutils/binutils_2.18.bb                  |    4 +-
 recipes/binutils/binutils_2.19.1.bb                |    3 +-
 recipes/binutils/binutils_2.19.51.0.3.bb           |    3 +-
 recipes/binutils/binutils_2.19.bb                  |    3 +-
 10 files changed, 137 insertions(+), 6 deletions(-)
 create mode 100644 recipes/binutils/binutils-2.18.50.0.7/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.19.1/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.19.51.0.3/binutils-x86_64_i386_biarch.patch
 create mode 100644 recipes/binutils/binutils-2.19/binutils-x86_64_i386_biarch.patch
recipes/binutils/binutils-2.18.50.0.7/binutils-x86_64_i386_biarch.patch new file +26 -0
new file mode 100644
index 0000000..6054434
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+# Adapted to binutils 2.18.50.0.7
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
+ SHARABLE_SECTIONS=yes
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.18/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.19.1/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.19.51.0.3/binutils-x86_64_i386_biarch.patch new file +26 -0
new file mode 100644
index 0000000..6054434
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+# Adapted to binutils 2.18.50.0.7
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
+ SHARABLE_SECTIONS=yes
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils-2.19/binutils-x86_64_i386_biarch.patch new file +25 -0
new file mode 100644
index 0000000..b79a76a
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ GENERATE_PIE_SCRIPT=yes
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++    case "$EMULATION_NAME" in
++      *i386*) LIBPATH_SUFFIX=32 ;;
++    esac
++    ;;
++esac
recipes/binutils/binutils_2.18.50.0.7.bb +2 -1
index a89431e..eb00a2d 100644
@@ -1,4 +1,4 @@
-PR = "r6"
+PR = "r7"
 
 require binutils.inc
 
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
recipes/binutils/binutils_2.18.bb +2 -2
index 9367196..8370538 100644
@@ -1,4 +1,4 @@
-PR = "r4"
+PR = "r5"
 
 require binutils.inc
 
@@ -12,8 +12,8 @@ SRC_URI = "\
      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-gas-needs-libm.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
 SRC_URI += "file://binutils-2.16.1-e300c2c3.patch;patch=1"
-
recipes/binutils/binutils_2.19.1.bb +2 -1
index c399ab8..782d5c7 100644
@@ -1,4 +1,4 @@
-PR = "r0"
+PR = "r1"
 
 require binutils.inc
 
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
recipes/binutils/binutils_2.19.51.0.3.bb +2 -1
index 7808d3b..a4ed077 100644
@@ -1,4 +1,4 @@
-PR = "r0"
+PR = "r1"
 
 require binutils.inc
 
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
recipes/binutils/binutils_2.19.bb +2 -1
index aee5840..072ac56 100644
@@ -1,4 +1,4 @@
-PR = "r1"
+PR = "r2"
 
 require binutils.inc
 
@@ -12,6 +12,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-arm-pr7093.patch;patch=1 \
+     file://binutils-x86_64_i386_biarch.patch;patch=1 \
      "
 
 # powerpc patches
Signature · 1 line
1.6.2.3
#32 lore raw

Re: [PATCH 02/11] binutils:?add?binutils-x86_64_i386_biarch.patch

Quoted 2 lines · On Thursday 23 April 2009 13:37:06 Roman I Khimov wrote:

New binutils were introduced recently, so I've upgraded patch to handle those as well, please ACK new version and I'll commit it then.

ping

Acked-by
#33 lore raw

Re: [PATCH 02/11]?binutils:?add?binutils-x86_64_i386_biarch.patch

Quoted 5 lines · Roman I Khimov
Quoted 2 lines · On Thursday 23 April 2009 13:37:06 Roman I Khimov wrote:

New binutils were introduced recently, so I've upgraded patch to handle those as well, please ACK new version and I'll commit it then.

ping

Quoted 5 lines

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#34 lore raw
In reply to Roman I Khimov
Quoted 6 lines · Roman I Khimov

Hello all.

This patch series (will follow in replies) tries to bring in AMD64/x86_64 support into OE. This required some intrusive toolchain fixes that I want to post here for review and feedback as I think (or rather know ;)) I might have broken something along the way.

Maybe building multilib distro in two separate build trees would be much easier. Only very few packages (e. g. nspluginwrapper) are much harder to be built in such environment.

I already tried this:

I used this one in my distro.conf:
layout_libdir = "${layout_exec_prefix}/lib64"

It was surprisingly painless. I hade to fix only few errors in particular packages (fixes are already in oe.dev).

Quoted 3 lines

Next thing is 'libexec' dir. I propose to set it to point to libdir and be done with that (again, Debian does exactly this). For now, I've done that just for glibc-multilib.

It's not so easy. Some packages install to libexecdir directly (which causes ugly pollution of libdir), others use subdirectory.

Something like RECOMMENDED_LIBEXEC_PREFIX in particular packages would fix this situation. Distros than could choose to keep things as they are (/usr/libexec), use strictly prefixed /usr/libexec ($prefix/libexec/+$RECOMMENDED_LIBEXEC_PREFIX) use strictly prefixed libdir, or anything else they want.

I used this one in my distro.conf:
layout_libexecdir = "${layout_exec_prefix}/lib"

But I would really prefer:
layout_libexecdir = "${layout_exec_prefix}/lib/${RECOMMENDED_LIBEXEC_PREFIX}"

Signature · 9 lines
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: [email protected]
Lihovarská 1060/12           tel: +420 284 028 966, +49 911 740538747
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/
#35 lore raw
Quoted 2 lines · Stanislav Brabec
Quoted 2 lines

Next thing is 'libexec' dir. I propose to set it to point to libdir and be done with that

This is bad, because it forces duplicating of all libexec binaries in the system.

Imagine that you have a library libfoo for both archs:
/usr/lib/libfoo.so.0 (32 bit) /usr/lib64/libfoo.so.0 (64 bit)

Now your library needs to call binary ${libexecdir}/libfoo-helper.

If you set libexec to libdir, then you are forced to package libfoo helper twice. Both do _exactly_ the same:
/usr/lib/libfoo-helper (32 bit instance for 32 bit library) /usr/lib64/libfoo-helper (64 bit instance for 64 bit library)

libexecdir pointing to prefix/lib is much better:
/usr/lib/libfoo-helper (64 bit instance for both libraries)

Both 32 bit and 64 bit libfoo will use this helper.

Signature · 9 lines
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: [email protected]
Lihovarská 1060/12           tel: +420 284 028 966, +49 911 740538747
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/
#36 lore raw
Quoted 11 lines · On Wednesday 15 April 2009 17:32:56 Stanislav Brabec wrote:
Quoted 2 lines · Stanislav Brabec
Quoted 2 lines

Next thing is 'libexec' dir. I propose to set it to point to libdir and be done with that

This is bad, because it forces duplicating of all libexec binaries in the system.
.....
libexecdir pointing to prefix/lib is much better:
/usr/lib/libfoo-helper (64 bit instance for both libraries)

Both 32 bit and 64 bit libfoo will use this helper.

Given the nature of libexec dir that might be nice to have, so we wouldn't override libexecdir but just not package it for 32-bit arch.

Just one thing - couldn't there be any situation where libexec program output would be different for primary and supplementary architectures? And, BTW, looking at glibc, it installs "getconf/POSIX_V6_LP64_OFF64" for 64-bit and "getconf/POSIX_V6_ILP32_OFF32" with "getconf/POSIX_V6_ILP32_OFFBIG" for 32-bit.

Although looking at Debian it doesn't have any of this POSIX_* thing at all.

#37 lore raw
Quoted 6 lines · Roman I Khimov
Quoted 1 line · On Wednesday 15 April 2009 17:32:56 Stanislav Brabec wrote:

Both 32 bit and 64 bit libfoo will use this helper.

Given the nature of libexec dir that might be nice to have, so we wouldn't override libexecdir but just not package it for 32-bit arch.

Exactly. Cross-arch exec() is possible.

Just for your info. openSUSE makes bi-arch in following way:

- Compile everything for i586 (in i586 build environment)

- Compile everything for x86_64 (in x86_64 build environment)

- Run baselibs utility, on i586 packages and extract libraries and possible extra stuff to -32bit packages. Baselibs utility can be configured per package.

- Make single repository from the stuff above.

The same works for ppc/ppc64 and s390/s390x.

Quoted 2 lines

Just one thing - couldn't there be any situation where libexec program output would be different for primary and supplementary architectures?

Yes, it can happen, but I am not aware of any real example.

But arch-dependent include files are not rare. Hopefully, most upstream developers are aware of bi-arch problem and package platform specific includes to libdir instead of includedir.

Example:
/usr/lib64/glib-2.0/include/glibconfig.h

You need extra rule for packaging of such stuff. Also glibc-dev would need extra rules.

Signature · 9 lines
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: [email protected]
Lihovarská 1060/12           tel: +420 284 028 966, +49 911 740538747
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/
#38 lore raw
Quoted 5 lines · On Wednesday 15 April 2009 18:23:54 Stanislav Brabec wrote:

Just for your info. openSUSE makes bi-arch in following way:

- Compile everything for i586 (in i586 build environment)

- Compile everything for x86_64 (in x86_64 build environment)

Well, that's nice when you have x86_64 and i586 environments. But here we're bootstraping toolchain from nothing, so it would involve

- compile everything for i586
- extract libraries from i586
- compile gcc-initial for x86_64
- throw in libs from i586
- proceed with bootstrapping the multilib toolchain

Which would require some management for multiple build trees and then some cross-build-trees dependency things. Certainly possible, but not sure any easier. Or am I missing something?

#39 lore raw
Quoted 1 line · Roman I Khimov

Which would require some management for multiple build trees

It is not a problem, just build in another directory and your OE build trees will be completely independent. You should be even share the same tree environment with different config files. The only situation when OE will fail would be (host_triplet == build_triplet), because staging and build root will go into the same directory. It needs fix in OE.

Quoted 2 lines

and then some
cross-build-trees dependency things.

Do you really need it? The whole openSUSE project is a bi-arch, but it can live without cross-build trees. Baselibs utility operates on final binary packages. Only compiler for build system compiler you may want to provide 32-bit target support.

Quoted 2 lines

Certainly possible, but not sure any
easier. Or am I missing something?

If you are trying to build x86_64 compiler for i586 target on an arbitrary host, then you may recycle generic support for canadian toolchain, that was added few months ago (well I did not tried it yet).

Signature · 9 lines
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: [email protected]
Lihovarská 1060/12           tel: +420 284 028 966, +49 911 740538747
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/
#40 lore raw
In reply to Roman I Khimov
Quoted 6 lines · Roman I Khimov

Hello all.

This patch series (will follow in replies) tries to bring in AMD64/x86_64 support into OE. This required some intrusive toolchain fixes that I want to post here for review and feedback as I think (or rather know ;)) I might have broken something along the way.

Have you done a build of meta-toolchain as well?

Signature · 1 line
Tom Rini
#41 lore raw
Quoted 9 lines · On Friday 17 April 2009 02:11:40 Tom Rini wrote:
Quoted 6 lines · Roman I Khimov

Hello all.

This patch series (will follow in replies) tries to bring in AMD64/x86_64 support into OE. This required some intrusive toolchain fixes that I want to post here for review and feedback as I think (or rather know ;)) I might have broken something along the way.

Have you done a build of meta-toolchain as well?

Not yet. gcc-cross was the main target.

[adding to TODO]