This is the mail archive of the
crossgcc@sourceware.org
mailing list for the crossgcc project.
See the CrossGCC FAQ for lots
more information.
crosscompiler toolchain from i686 to x86_64
- From: Juraj Lutter <jlutter at cisco dot com>
- To: crossgcc at sourceware dot org
- Date: Thu, 25 Jan 2007 20:56:00 +0100
- Subject: crosscompiler toolchain from i686 to x86_64
- Authentication-results: sj-dkim-7; header.From=jlutter@cisco.com; dkim=pass ( sig from cisco.com/sjdkim7002 verified; );
- Dkim-signature: v=0.5; a=rsa-sha256; q=dns/txt; l=4436; t=1169755006; x=1170619006; c=relaxed/simple; s=sjdkim7002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=jlutter@cisco.com; z=From:=20Juraj=20Lutter=20<jlutter@cisco.com> |Subject:=20crosscompiler=20toolchain=20from=20i686=20to=20x86_64 |Sender:=20; bh=6ajHWVYO8uyrRosPk+nD3aDOlO/+ureC8U1UZpvKGp4=; b=C9/hLC/yi7bjIhlvLYpCT/iiczbVN3UIFTlmSmHIQWp3eejfB3Wa363nebcNXIcuu19IS5Kw nyMl6mOyt5SlZ36L+NYMdSMQ5/Z8oSHPTWTPJZUDP1j0HeVwd0lwcEDH;
Folks,
I turn to you because I seem to be really stuck.
I have:
- binutils 2.17
- gcc 3.4.6
- glibc 2.3.6
what I need to achieve is to have ``multilib'' support in this
toolchain which I can't manage to work :-( I need to have
both 32-bit and 64-bit of glibc compiled using this compiler.
Build platform for toolchain is i686-pc-linux-gnu or x86_64-pc-linux-gnu
with
resulting binaries running on x86_64-pc-linux-gnu.
gcc should support both -m32 and -m64 as well as probably the rest of
the tools need.
So far I've managed to build toolchain from i686 to x86_64 using
binutils, gcc-stage1, glibc and gcc-stage2.
Options used to generate:
binutils
--------
--prefix=${[TOOLCHAIN_PREFIX]} \
--disable-nls \
--disable-multilib \
--enable-shared \
--with-lib-path=${[TOOLCHAIN_TARGET_PREFIX]}/lib \
--host=${[GNU_CONFIGURE_TRIPLET_BUILD]} \
--build=${[GNU_CONFIGURE_TRIPLET_BUILD]} \
--target=${[GNU_CONFIGURE_TRIPLET_TARGET]}
gcc-stage1
----------
--prefix=${[TOOLCHAIN_PREFIX]} \
--host=${[GNU_CONFIGURE_TRIPLET_BUILD]} \
--build=${[GNU_CONFIGURE_TRIPLET_BUILD]} \
--target=${[GNU_CONFIGURE_TRIPLET_TARGET]} \
--disable-multilib \
--with-local-prefix=${[TOOLCHAIN_GCC_BUILD_DIR]} \
--disable-nls \
--disable-shared \
--disable-threads \
--enable-languages=c
glibc
-----
cd ${[TOOLCHAIN_BUILD_DIR]} && echo "libc_cv_forced_unwind=yes" >
config.cache
cd ${[TOOLCHAIN_BUILD_DIR]} && echo "libc_cv_c_cleanup=yes" >>
config.cache
cd ${[TOOLCHAIN_BUILD_DIR]} &&
CC="${[TOOLCHAIN_TARGET_PREFIX]}/bin/gcc"
AR="${[TOOLCHAIN_TARGET_PREFIX]}/bin/ar" RANLIB="${
[TOOLCHAIN_TARGET_PREFIX]}/bin/ranlib" BUILD_CC="/usr/bin/gcc" sh
${[CWD]}/$(SUB)/configure \
--prefix=${[TOOLCHAIN_TARGET_PREFIX]} \
--host=${[GNU_CONFIGURE_TRIPLET_TARGET]} \
--build=${[GNU_CONFIGURE_TRIPLET_BUILD]} \
--disable-profile \
--enable-add-ons \
--with-tls \
--enable-kernel=2.6.0 \
--with-__thread \
--with-binutils=${[TOOLCHAIN_TARGET_PREFIX]}/bin \
--with-headers=$(INCLUDE_TARGET) \
--cache-file=config.cache
gcc-stage2
----------
cd ${[TOOLCHAIN_GCC_BUILD_DIR]} && \
PATH="${[TOOLCHAIN_BASE]}/usr/bin:${PATH}" \
RANLIB="${[TOOLCHAIN_BASE]}/usr/bin/${[GNU_CONFIGURE_TRIPLET_TARGET]}-ranlib"
\
RANLIB_FOR_TARGET="${[TOOLCHAIN_BASE]}/usr/bin/${[GNU_CONFIGURE_TRIPLET_TARGET]}-ranlib"
\
AR="${[TOOLCHAIN_BASE]}/usr/bin/${[GNU_CONFIGURE_TRIPLET_TARGET]}-ar" \
AR_FOR_TARGET="${AR}" \
AS_FOR_TARGET="${[TOOLCHAIN_BASE]}/usr/bin/${[GNU_CONFIGURE_TRIPLET_TARGET]}-as"
\
LD_FOR_TARGET="${[TOOLCHAIN_BASE]}/usr/bin/${[GNU_CONFIGURE_TRIPLET_TARGET]}-ld"
\
sh ${[CWD]}/$(SUB)/configure \
--prefix=${[TOOLCHAIN_PREFIX]} \
--host=${[GNU_CONFIGURE_TRIPLET_BUILD]} \
--build=${[GNU_CONFIGURE_TRIPLET_BUILD]} \
--target=${[GNU_CONFIGURE_TRIPLET_TARGET]} \
--disable-multilib \
--with-local-prefix=${[TOOLCHAIN_GCC_BUILD_DIR]} \
--disable-nls \
--enable-shared \
--enable-languages=c,c++ \
--enable-__cxa_atexit \
--enable-c99 \
--enable-long-long \
--enable-threads=posix
Using the above options I'm able to compile on i686 platform binaries
for x86_64 platform but as soon as I start to fiddle with multilib
support, I start to get errors regarding incompatible libc and so on.
Obviously I'm getting something wrong. Can someone of you point me to
the right direction where can I have look at?
TIA,
otis
--
Juraj Lutter | |
Software Developer :|: :|:
SRBU Service Node :|||: :|||:
phone: +421 907 986 576 .:|||||||:...:|||||||:.
email: jlutter@cisco.com C i s c o S y s t e m s
--
For unsubscribe information see http://sourceware.org/lists.html#faq