cross-compiling for x86_64
Hi all,
I tried to build a cross-compilation SDK on a 32 bit Debian stable host with x86_64 as target. My idea is to regularly test 64 compilation of a project that I work on.
I had considerable problems getting libc-initial and libc-immediate to build. Most of the problems seemed to be related to not having the right (kernel?) header files in place. After working around some problems it completely failed in the end.
Is this something that someone has done already and perhaps can share a local.conf for? Should I try again and report my problems in more detail?
Signature · 4 lines
Bye, Patrick Ohly -- [email protected] http://www.estamos.de/
Quoted 3 lines · Patrick Ohly
I tried to build a cross-compilation SDK on a 32 bit Debian stable host with
x86_64as target. My idea is to regularly test 64 compilation of a project that I work on.
[...]
Quoted 2 lines
Is this something that someone has done already and perhaps can share a local.conf for?
Apparently not, so let me describe in more detail what I am doing and how it fails - perhaps then someone can give me a hint about how to fix it. To be specific, something that I don't understand is why glibc is built multiple times and why gcc-cross depends on it. Is there a circular dependency between gcc and glibc that OE is trying to break this way?
Here's a summary of the problems I had:
* glibc-initial-2.3.2+cvs20040726-r22: generic bits/wordsize.h and bits/endian.h is used instead of the x86_64 ones
* glibc-intermediate-2.5-r2: asm-x86_64 header files not found
* glibc-intermediate-2.5-r2: config-name.h not created by configure although it is needed
* glibc-intermediate-2.5-r2: #error "__NR_pread and __NR_pread64 both defined???"
My setup:
OpenEmbedded: dev branch, pull/update today, revision e2fde1c5cf87c2b0a9be2dfac2a1a1937db68382
Bitbake: 1.6 branch, revision 638
local configs: conf/local.conf and conf/machine/x86_64.conf
x86_64.conf was derived from x86.conf with just some minor changes:TARGET_ARCH = "x86_64", no IPKG_EXTRA_ARCHS. It is used by local.conf as MACHINE together with DISTRO = "generic".
Bitbake tried to compile glibc-initial-2.3.2+cvs20040726-r22. The
configure task fails, with the final error being:
[...]
make[1]: Leaving directory /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-initial-2.3.2+cvs20040726-r22/libc' make[1]: Entering directory /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-initial-2.3.2+cvs20040726-r22/libc'
{ echo '#include "posix/bits/posix1_lim.h"'; \
echo '#define _LIBC 1'; \
echo '#include "misc/sys/uio.h"'; } | \
ccache gcc -E -dM -MD -MP -MF /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-initial-2.3.2+cvs20040726-r22/build-x86_64-linux/bits/stdio_lim.dT -MT '/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-initial-2.3.2+cvs20040726-r22/build-x86_64-linux/bits/stdio_lim.h /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-initial-2.3.2+cvs20040726-r22/build-x86_64-linux/bits/stdio_lim.d' \
-Iinclude -I. -I/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-initial-2.3.2+cvs20040726-r22/build-x86_64-linux -Ilibio -I/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-initial-2.3.2+cvs20040726-r22/build-x86_64-linux -Isysdeps/x86_64/elf -Isysdeps/unix/sysv/linux/x86_64 -Isysdeps/unix/sysv/linux/wordsize-64 -Isysdeps/unix/sysv/linux -Isysdeps/gnu -Isysdeps/unix/common -Isysdeps/unix/mman -Isysdeps/unix/inet -Isysdeps/unix/sysv -Isysdeps/unix/x86_64 -Isysdeps/unix -Isysdeps/posix -Isysdeps/x86_64/fpu -Isysdeps/x86_64 -Isysdeps/wordsize-64 -Isysdeps/ieee754/ldbl-96 -Isysdeps/ieee754/dbl-64 -Isysdeps/ieee754/flt-32 -Isysdeps/ieee754 -Isysdeps/generic/elf -Isysdeps/generic -nostdinc -isystem /usr/lib/gcc-lib/i486-linux/3.3.5/include -isystem /home/patrick/x86_64/tmp/cross/x86_64-linux/include -xc - -o /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-initial-2.3.2+cvs20040726-r22/build-x86_64-linux/bits/stdio_lim.hT
In file included from bits/types.h:28,
from posix/sys/types.h:31,
from include/sys/types.h:1,
from misc/sys/uio.h:24,
from <stdin>:3:
bits/wordsize.h:1:2: #error "This file must be written based on the data type sizes of the target"
In file included from posix/sys/types.h:31,
from include/sys/types.h:1,
from misc/sys/uio.h:24,
from <stdin>:3:
bits/types.h:127:3: #error
In file included from string/endian.h:37,
from include/endian.h:1,
from posix/sys/types.h:213,
from include/sys/types.h:1,
from misc/sys/uio.h:24,
from <stdin>:3:bits/endian.h:13:2: #error Machine byte order unknown.
make[1]: *** [/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-initial-2.3.2+cvs20040726-r22/build-x86_64-linux/bits/stdio_lim.st] Error 1 make[1]: Leaving directory `/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-initial-2.3.2+cvs20040726-r22/libc'
make: *** [sysdeps/gnu/errlist.c] Error 2
The configure completed, it is the GLIBC_2.3 hack with "make sysdeps/gnu/errlist.c" which fails here. The problem comes from the fact that -I. comes before -Isysdeps/x86_64. I have no idea where that command line is assembled, so I went for another hack: removing the "wrong" bits/wordsize.h and bits/endian.h.
That got me a step further to compiling glibc-intermediate-2.5-r2. Here the problem is that it cannot find various asm-x86_64 header files like asm-x86_64/param.h. Here's an example:
| gawk -f ../scripts/gen-as-const.awk ../nptl/sysdeps/x86_64/tcb-offsets.sym \ | | ccache x86_64-linux-gcc -S -o /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/tcb-offsets.hT3 -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fexpensive-optimizations -fmerge-all-constants -frename-registers -Wstrict-prototypes -I../include -I/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/csu -I/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux -I../sysdeps/x86_64/elf -I../nptl/sysdeps/unix/sysv/linux/x86_64 -I../sysdeps/unix/sysv/linux/x86_64 -I../sysdeps/unix/sysv/linux/wordsize-64 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/x86_64 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/x86_64/fpu -I../nptl/sysdeps/x86_64 -I../sysdeps/x86_64 -I../sysdeps/wordsize-64 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /home/patrick/x86_64/tmp/cross/lib/gcc/x86_64-linux/4.1.1/include -isystem /home/patrick/x86_64/tmp/staging/x86_64-linux/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DHAVE_INITFINI -x c - \ | -MD -MP -MF /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/tcb-offsets.h.dT -MT '/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/tcb-offsets.h.d /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/tcb-offsets.h' | In file included from ../sysdeps/unix/sysv/linux/sys/syscall.h:25, | from ../sysdeps/unix/sysdep.h:21, | from ../sysdeps/unix/x86_64/sysdep.h:19, | from ../sysdeps/unix/sysv/linux/x86_64/sysdep.h:23, | from <stdin>:1: | /home/patrick/x86_64/tmp/staging/x86_64-linux/include/asm/unistd.h:5:33: error: asm-x86_64/unistd.h: No such file or directory
Here's where I had that file at that moment:
$ find tmp -name unistd.h | grep x86_64/unistd.h tmp/work/x86_64-linux/linux-libc-headers-2.6.18-r1/linux-2.6.18/include/asm-x86_64/unistd.h tmp/work/x86_64-linux/linux-libc-headers-2.6.18-r1/install/linux-libc-headers-dev/usr/include/asm-x86_64/unistd.h tmp/work/x86_64-linux/linux-libc-headers-2.6.18-r1/temp-staging/usr/include/asm-x86_64/unistd.h
Should they also be installed in tmp/staging/x86_64-linux? "-isystem /home/patrick/x86_64/tmp/staging/x86_64-linux/include" is part of the link line, but the x86_64 files haven't been installed there. linux-libc-headers_2.6.18.bb only seems to copy linux, asm and asm-generic there. I modified its do_stage() to also install asm-x86_64, then removed everything related to x86_64 and reran bitbake.
Hmm, installing asm-x86_64 broke glibc-intermediate's Linux kernel header version check during the configure, so I reverted the change to linux-libc-headers_2.6.18.bb, let bitbake configure glibc-intermediate and manually copied asm-x86_64 before compiling it.
Next problem during compilation of glibc-intermediate: config-name.h is not found. glibc-2.5's configure contains a comment that "For non-generic uname, we don't need to create config-name.h at all." but apparently it is trying to compile the generic version:
| make[2]: Entering directory `/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/glibc-2.5/posix' | .././scripts/mkinstalldirs /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/posix | mkdir /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/posix | ccache x86_64-linux-gcc uname.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fexpensive-optimizations -fmerge-all-constants -frename-registers -Wstrict-prototypes -fomit-frame-pointer -I../include -I/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/posix -I/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux -I../sysdeps/x86_64/elf -I../nptl/sysdeps/unix/sysv/linux/x86_64 -I../sysdeps/unix/sysv/linux/x86_64 -I../sysdeps/unix/sysv/linux/wordsize-64 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/x86_64 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/x86_64/fpu -I../nptl/sysdeps/x86_64 -I../sysdeps/x86_64 -I../sysdeps/wordsize-64 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /home/patrick/x86_64/tmp/cross/lib/gcc/x86_64-linux/4.1.1/include -isystem /home/patrick/x86_64/tmp/staging/x86_64-linux/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -o /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/posix/uname.o -MD -MP -MF /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/posix/uname.o.dt -MT /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/posix/uname.o | uname.c:25:25: error: config-name.h: No such file or directory | uname.c: In function ‘__uname’: | uname.c:57: error: ‘UNAME_SYSNAME’ undeclared (first use in this function) | uname.c:57: error: (Each undeclared identifier is reported only once | uname.c:57: error: for each function it appears in.) | uname.c:58: error: ‘UNAME_RELEASE’ undeclared (first use in this function) | uname.c:59: error: ‘UNAME_VERSION’ undeclared (first use in this function) | uname.c:60: error: ‘UNAME_MACHINE’ undeclared (first use in this function) | make[2]: *** [/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/posix/uname.o] Error 1 | make[2]: Leaving directory `/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/glibc-2.5/posix' | make[1]: *** [posix/subdir_lib] Error 2 | make[1]: Leaving directory `/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/glibc-2.5' | make: *** [all] Error 2 | FATAL: oe_runmake failed
I manually created the file intmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/config-name.h based on its template tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/glibc-2.5/config-name.in.
Then compilation failed again:
| ccache x86_64-linux-gcc ../sysdeps/unix/sysv/linux/pread.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fexpensive-optimizations -fmerge-all-constants -frename-registers -Wstrict-prototypes -fomit-frame-pointer -fexceptions -fasynchronous-unwind-tables -I../include -I/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/posix -I/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux -I../sysdeps/x86_64/elf -I../nptl/sysdeps/unix/sysv/linux/x86_64 -I../sysdeps/unix/sysv/linux/x86_64 -I../sysdeps/unix/sysv/linux/wordsize-64 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/x86_64 -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/x86_64/fpu -I../nptl/sysdeps/x86_64 -I../sysdeps/x86_64 -I../sysdeps/wordsize-64 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports -I.. -I../libio -I. -nostdinc -isystem /home/patrick/x86_64/tmp/cross/lib/gcc/x86_64-linux/4.1.1/include -isystem /home/patrick/x86_64/tmp/staging/x86_64-linux/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -o /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/posix/pread.o -MD -MP -MF /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/posix/pread.o.dt -MT /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/posix/pread.o | ../sysdeps/unix/sysv/linux/pread.c:33:4: error: #error "__NR_pread and __NR_pread64 both defined???" | make[2]: *** [/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/build-x86_64-linux/posix/pread.o] Error 1 | make[2]: Leaving directory `/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/glibc-2.5/posix' | make[1]: *** [posix/subdir_lib] Error 2 | make[1]: Leaving directory `/home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/glibc-2.5' | make: *** [all] Error 2 | FATAL: oe_runmake failed
NOTE: Task failed: /home/patrick/x86_64/tmp/work/x86_64-linux/glibc-intermediate-2.5-r2/temp/log.do_compile.29319
I did not investigate further. Any comments? What further information should I provide?
Signature · 4 lines
Bye, Patrick Ohly -- [email protected] http://www.estamos.de/
#
# OpenEmbedded local configuration file (sample)
#
# Please visit the Wiki at http://openembedded.org/ for more info. #
#
# Be SURE to read this file in its entirety and the GettingStarted page on the
# wiki before proceeding.
#
# Once you have done that, remove the line at the end of this
# file and build away.
#
# WARNING: lines starting with a space (' ') will result in parse failures.
# Remove '# ' from commented lines to activate them.
#
# NOTE: Do NOT use $HOME in your paths, BitBake does NOT expand ~ for you. If you
# must have paths relative to your homedir use ${HOME} (note the {}'s there
# you MUST have them for the variable expansion to be done by BitBake). Your
# paths should all be absolute paths (They should all start with a / after
# expansion. Stuff like starting with ${HOME} or ${TOPDIR} is ok).# Use this to specify where BitBake should place the downloaded sources into DL_DIR = "/tmp/oe/sources"
# Delete the line below. Then specify which .bb files to consider for
# your build. Typically this will be something like BBFILES = "/path/to/openembedded/packages/*/*.bb" BBFILES := "/home/patrick/oe/openembedded/packages/*/*.bb"
# Use the BBMASK below to instruct BitBake to _NOT_ consider some .bb files # This is a regulary expression, so be sure to get your parenthesis balanced. BBMASK = ""
# Uncomment this if you want to use a prebuilt toolchain. You will need to
# provide packages for toolchain and additional libraries yourself. You also
# have to set PATH in your environment to make sure BitBake finds additional binaries.
# Note: You will definitely need to say:
# ASSUME_PROVIDED += "virtual/arm-linux-gcc-2.95"
# to build any of two Linux 2.4 Embedix kernels,
# i.e. openzaurus-sa-2.4.18 and openzaurus-pxa-2.4.18 - and don't forget
# to rename the binaries as instructed in the Wiki.
# ASSUME_PROVIDED += "virtual/${TARGET_PREFIX}gcc virtual/libc"# Select between multiple alternative providers, if more than one is eligible. PREFERRED_PROVIDERS = "virtual/qte:qte virtual/libqpe:libqpe-opie" PREFERRED_PROVIDERS += " virtual/libsdl:libsdl-qpe" PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc-initial:gcc-cross-initial" PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc:gcc-cross" PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}g++:gcc-cross"
# Uncomment this to specify where BitBake should create its temporary files. # Note that a full build of everything in OpenEmbedded will take GigaBytes of hard
# disk space, so make sure to free enough space. The default TMPDIR is # <build directory>/tmp # Don't use symlinks in in the path to avoid problems # TMPDIR = /tmp/oe
# Uncomment this to specify a machine to build for. See the conf directory
# for machines currently known to OpenEmbedded. # MACHINE = "collie" MACHINE = "x86_64"
# Use this to specify the target architecture. Note that this is only
# needed when building for a machine not known to OpenEmbedded. Better use # the MACHINE attribute (see above) #TARGET_ARCH = ""
# Use this to specify the target operating system. The default is "linux",
# for a normal linux system with glibc. Set this to "linux-uclibc" if you want # to build a uclibc based system. TARGET_OS = "linux" # TARGET_OS = "linux-uclibc"
# Uncomment this to select a distribution policy. See the conf directory
# for distributions currently known to OpenEmbedded. # Although they no longer contain version number in the (file-)name # familiar-unstable and openzaurus-unstable are so called "versioned" # distros, i.e. they explicitely select specific versions of various # packages. # Stay away from unversioned distros unless you really know what you are doing # DISTRO = "familiar-unstable" DISTRO = "generic"
# So far, angstrom.conf and familiar.conf set ENABLE_BINARY_LOCALE_GENERATION
# to generate binary locale packages at build time using qemu-native and # thereby guarantee i18n support on all devices. If your build breaks on # qemu-native consider disabling ENABLE_BINARY_LOCALE_GENERATION (note that # this breaks i18n on devices with less than 128MB RAM) or installing # a working third-party qemu (e.g. provided by your distribution) and # adding qemu-native to ASSUME_PROVIDED # ENABLE_BINARY_LOCALE_GENERATION = "0" # ASSUME_PROVIDED += "qemu-native"
# Uncomment this to select a particular major kernel version if the MACHINE setting
# supports more than one major kernel version. Currently this is suported by the # following MACHINE types: poodle, tosa and simpad. # MACHINE_KERNEL_VERSION = "2.6"
# Uncomment one of these to build packages during the build process. # This is done automatically if you set DISTRO (see above) # INHERIT = "package_ipk"
# INHERIT = "package_tar"
# Add the required image file system types below. Valid are jffs2, tar, cramfs and ext2 #IMAGE_FSTYPES = "jffs2 tar"
# Uncomment this to disable the parse cache (not recommended). # CACHE = ""
# Uncomment this if you want BitBake to emit debugging output # BBDEBUG = "yes"
# Uncomment these two if you want BitBake to build images useful for debugging. # Note that INHIBIT_PACKAGE_STRIP needs a package format to be defined # DEBUG_BUILD = "1"
# INHIBIT_PACKAGE_STRIP = "1"
# Uncomment these to build a package such that you can use gprof to profile it. # NOTE: This will only work with 'linux' targets, not
# 'linux-uclibc', as uClibc doesn't provide the necessary
# object files. Also, don't build glibc itself with these
# flags, or it'll fail to build.
#
# PROFILE_OPTIMIZATION = "-pg"
# SELECTED_OPTIMIZATION = "${PROFILE_OPTIMIZATION}"
# LDFLAGS =+ "-pg"# Uncomment this to enable parallel make.
# This allows make to spawn mutliple processes to take advantage of multiple
# processors. Useful on SMP machines. This may break some packages - we're # in the process of marking these so let us know if you find any. # PARALLEL_MAKE = "-j 4"
# Uncomment this if you want BitBake to emit the log if a build fails. BBINCLUDELOGS = "yes"
# Specifies a location to search for pre-generated tarballs when fetching
# a cvs:// URI. Outcomment this, if you always want to pull directly from CVS. #CVS_TARBALL_STASH = ""
# EDIT THIS FILE and then remove the line below before using! #REMOVE_THIS_LINE:="${@oe.fatal('Read the comments in your conf/local.conf')}"
#PREFERRED_VERSION_glibc-initial ?= "2.2.5"
#PREFERRED_VERSION_glibc-intermediate ?= "2.4"
#PREFERRED_VERSION_gcc-cross-initial ?= "3.4.4"
#@TYPE: Machine
#@NAME: X86
#@DESCRIPTION: Machine configuration for a Linux running on x86_64 compatible machines
TARGET_ARCH = "x86_64"
# TARGET_VENDOR = "-oe"
#IPKG_EXTRA_ARCHS = ""
# reuse .bb for "normal" x86 PREFERRED_PROVIDER_virtual/kernel = "linux-x86" # todo: convert to task-base BOOTSTRAP_EXTRA_RDEPENDS = "kernel pciutils udev kernel-modules"
udevdir = "/dev"OLDEST_KERNEL = "2.6.17"GLIBC_ADDONS = "nptl"GLIBC_EXTRA_OECONF = "--with-tls"
#require conf/machine/include/tune-x86.conf
Hi all,
I have had some time over the holidays to investigate this again and have come up with patches that solves the problem for me. I'm attaching them in the hope that someone else will find them useful and/or commit them on dev.
Note that I have only patched the packages that were picked up by the current "generic" distro - some of the changes will probably also need to be done to other .bb files. I have also intentionally not updated any PR variables to avoid conflicts.
Quoted 3 lines · Patrick Ohly
Here's a summary of the problems I had:
* glibc-initial-2.3.2+cvs20040726-r22: genericbits/wordsize.handbits/endian.his used instead of thex86_64ones
Failed differently for me now (something about NTPL requiring TLS), but instead of investigating further I simply changed gcc-cross-initial_4.1.1.bb to not depend on libc-initial. This is already how it works for 'arm', 'armeb', 'mips', 'mipsel'.
If there is a particular reason why the initial libc should be needed for x86_64, then I haven't noticed it.
Quoted 5 lines
* glibc-intermediate-2.5-r2: asm-x86_64 header files not found
* glibc-intermediate-2.5-r2:config-name.hnot created by configure although it is needed
* glibc-intermediate-2.5-r2: #error "__NR_preadand__NR_pread64both defined???"
All caused by linux-libc-headers_2.6.18.bb not installing the asm-i386/x86_64 directories which are referenced by the asm include files depending on the current compiler flags. Along the same line compiler.h also had to be installed explicitly because it was missing otherwise.
Finally gcc-cross-initial_4.1.1.bb failed to stage the compiler shared objects because the gcc make system insists on installing them in <libdir>/../lib64 and the .bb file expects them in <libdir> (code came from gcc-package-cross.inc).
With those changes I was able to compile the normal glibc and some other packages. I have not tested whether any of these results actually run anywhere, ATM my main goal is to just verify that compilation in 64 bit mode works.
Signature · 4 lines
Bye, Patrick Ohly -- [email protected] http://www.estamos.de/
#
# old_revision [08852d3ee921e5b54ef924285cd0ed124cb83e31]
#
# patch "packages/gcc/gcc-cross-initial_4.1.1.bb"
# from [7820cd16078d41cfc1e61af5ec45f1fbe7835156]
# to [246e2d677fba6679138489915cb8570790a896cc]
#
============================================================
--- packages/gcc/gcc-cross-initial_4.1.1.bb 7820cd16078d41cfc1e61af5ec45f1fbe7835156
+++ packages/gcc/gcc-cross-initial_4.1.1.bb 246e2d677fba6679138489915cb8570790a896cc
@@ -1,7 +1,7 @@ DEPENDS = "virtual/${TARGET_PREFIX}binut
require gcc-cross_${PV}.bb DEPENDS = "virtual/${TARGET_PREFIX}binutils"
-DEPENDS += "${@['virtual/${TARGET_PREFIX}libc-initial',''][bb.data.getVar('TARGET_ARCH', d, 1) in ['arm', 'armeb', 'mips', 'mipsel']]}" +DEPENDS += "${@['virtual/${TARGET_PREFIX}libc-initial',''][bb.data.getVar('TARGET_ARCH', d, 1) in ['arm', 'armeb', 'mips', 'mipsel', 'x86_64']]}"
PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial"
PACKAGES = ""
#
# old_revision [08852d3ee921e5b54ef924285cd0ed124cb83e31]
#
# patch "packages/gcc/gcc-package-cross.inc"
# from [02cf25e589eef74ad349812027d82351a7cf8ec9]
# to [2e5f07377a4db88a035c3a46e16649e7cb1aaa9b]
#
============================================================
--- packages/gcc/gcc-package-cross.inc 02cf25e589eef74ad349812027d82351a7cf8ec9
+++ packages/gcc/gcc-package-cross.inc 2e5f07377a4db88a035c3a46e16649e7cb1aaa9b
@@ -47,18 +47,18 @@ do_install () {
:
elif [ -f ${D}${prefix}/lib/libgcc_s.so.? ]; then
mv -f ${D}${prefix}/lib/libgcc_s.so* ${D}${target_base_libdir}
- else
- mv -f ${D}${prefix}/*/lib/libgcc_s.so* ${D}${target_base_libdir}
+ else
+ mv -f ${D}${prefix}/*/lib*/libgcc_s.so* ${D}${target_base_libdir}
fi # Move libstdc++ and libg2c into libdir (resetting our prefix to /usr mkdir -p ${D}${target_libdir}
- mv -f ${D}${prefix}/*/lib/libstdc++.so* ${D}${target_libdir}
+ mv -f ${D}${prefix}/*/lib*/libstdc++.so* ${D}${target_libdir}
if [ "${HAS_G2C}" = "yes" ]; then
- mv -f ${D}${prefix}/*/lib/libg2c.so* ${D}${target_libdir} || true
+ mv -f ${D}${prefix}/*/lib*/libg2c.so* ${D}${target_libdir} || true fi
if [ "${HAS_GFORTRAN}" = "yes" ]; then
- mv -f ${D}${prefix}/*/lib/libgfortran*.so* ${D}${target_libdir}
+ mv -f ${D}${prefix}/*/lib*/libgfortran*.so* ${D}${target_libdir}
fi
# Manually run the target stripper since we won't get it run by
#
# old_revision [08852d3ee921e5b54ef924285cd0ed124cb83e31]
#
# patch "packages/linux-libc-headers/linux-libc-headers_2.6.18.bb"
# from [037dd011e97011fedc216fdceaba007201fa19dd]
# to [4e3aaa4c88bc5fc59f119bf1c10237744e7801e0]
#
============================================================
--- packages/linux-libc-headers/linux-libc-headers_2.6.18.bb 037dd011e97011fedc216fdceaba007201fa19dd
+++ packages/linux-libc-headers/linux-libc-headers_2.6.18.bb 4e3aaa4c88bc5fc59f119bf1c10237744e7801e0
@@ -46,6 +46,10 @@ do_install_append_arm() {
cp include/asm-arm/procinfo.h ${D}${includedir}/asm
}+do_install_append_x86_64() {
+ cp -r include/asm-x86_64 include/asm-i386 ${D}${includedir}/
+}
+
STAGE_TEMP="${WORKDIR}/temp-staging"
do_stage () {
@@ -56,6 +60,9 @@ do_stage () {
if [ "${ARCH}" == "arm" ]; then
cp include/asm-arm/procinfo.h ${STAGE_TEMP}${includedir}/asm
fi
+ if [ "${ARCH}" == "x86_64" ]; then
+ cp include/linux/compiler.h ${STAGE_TEMP}${includedir}/linux
+ fi
install -d ${STAGING_INCDIR}
rm -rf ${STAGING_INCDIR}/linux ${STAGING_INCDIR}/asm ${STAGING_INCDIR}/asm-generic cp -pfLR ${STAGE_TEMP}${includedir}/linux ${STAGING_INCDIR}/
@@ -68,4 +75,11 @@ do_stage () {
cp -pfLR ${STAGE_TEMP}${includedir}/linux ${CROSS_DIR}/${TARGET_SYS}/include/ cp -pfLR ${STAGE_TEMP}${includedir}/asm ${CROSS_DIR}/${TARGET_SYS}/include/ cp -pfLR ${STAGE_TEMP}${includedir}/asm-generic ${CROSS_DIR}/${TARGET_SYS}/include/
+ if [ "${ARCH}" == "x86_64" ]; then
+ cp -pfLR include/asm-x86_64 ${STAGING_INCDIR}
+ cp -pflR include/asm-i386 ${STAGING_INCDIR}
+ rm -rf ${CROSS_DIR}/${TARGET_SYS}/include/asm-x86_64 ${CROSS_DIR}/${TARGET_SYS}/include/asm-i386
+ cp -pfLR ${STAGE_TEMP}${includedir}/asm-x86_64 ${CROSS_DIR}/${TARGET_SYS}/include/
+ cp -pfLR ${STAGE_TEMP}${includedir}/asm-i386 ${CROSS_DIR}/${TARGET_SYS}/include/
+ fi
}
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Patrick Ohly schreef:
Quoted 6 lines
Hi all,
I have had some time over the holidays to investigate this again and have come up with patches that solves the problem for me. I'm attaching them in the hope that someone else will find them useful and/or commit them on dev.
Could you attach them to the bugtracker? The mailinglist has a really short memory for patches...
regards,
Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iD8DBQFFloemMkyGM64RGpERAkuHAJ4gbGO/sIivEJUIquFq49qx94ziiwCfemmu sKtKhMm92BYjYaVAtvXQqNA=
=TiX3
-----END PGP SIGNATURE-----
Quoted 10 lines · Koen Kooi
Patrick Ohly schreef:
Quoted 6 lines
Hi all,
I have had some time over the holidays to investigate this again and have come up with patches that solves the problem for me. I'm attaching them in the hope that someone else will find them useful and/or commit them on dev.
Could you attach them to the bugtracker? The mailinglist has a really short memory for patches...
Done: see http://bugs.openembedded.org/show_bug.cgi?id=1728
I wasn't sure whether you'd want work which seems to be unrelated to what everyone else does with OE in your tracker.
Signature · 4 lines
Bye, Patrick Ohly -- [email protected] http://www.estamos.de/
Quoted 9 lines · Patrick Ohly
Quoted 8 lines · Koen Kooi
Patrick Ohly schreef:
Quoted 6 lines
Hi all,
I have had some time over the holidays to investigate this again and have come up with patches that solves the problem for me. I'm attaching them in the hope that someone else will find them useful and/or commit them on dev.
Quoted 4 lines
Quoted 2 lines
Could you attach them to the bugtracker? The mailinglist has a really short memory for patches...
Thanks.
Quoted 2 lines
I wasn't sure whether you'd want work which seems to be unrelated to what everyone else does with OE in your tracker.
You're doing it with OE which means there is at least one user :). Hopefully it will get merged. Even if it doesn't its easier to find in the bugzilla if anyone has similar issues/needs.
Cheers,
Richard