From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2950 invoked by alias); 13 Apr 2006 22:53:20 -0000 Received: (qmail 2940 invoked by uid 22791); 13 Apr 2006 22:53:19 -0000 X-Spam-Check-By: sourceware.org Received: from nproxy.gmail.com (HELO nproxy.gmail.com) (64.233.182.190) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 13 Apr 2006 22:53:17 +0000 Received: by nproxy.gmail.com with SMTP id y25so1270802nfb for ; Thu, 13 Apr 2006 15:53:14 -0700 (PDT) Received: by 10.49.93.4 with SMTP id v4mr210023nfl; Thu, 13 Apr 2006 15:53:14 -0700 (PDT) Received: by 10.49.55.2 with HTTP; Thu, 13 Apr 2006 15:53:14 -0700 (PDT) Message-ID: <9f7850090604131553y66c4cb5au466d6bba43c55f6@mail.gmail.com> Date: Thu, 13 Apr 2006 22:53:00 -0000 From: "marty fouts" To: Niklaus Subject: Re: need help with gcc 4.1.0 crosscompiler for arm Cc: gcc-help@gcc.gnu.org In-Reply-To: <85e0e3140604130025m17ca0aearf83360575bb09c27@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_27518_32743832.1144968794077" References: <9f7850090604121611n65f69452u8de92a946fac6221@mail.gmail.com> <85e0e3140604130025m17ca0aearf83360575bb09c27@mail.gmail.com> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-04/txt/msg00129.txt.bz2 ------=_Part_27518_32743832.1144968794077 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-length: 2304 On 4/13/06, Niklaus wrote > How did you try to build gcc-4.1. Can you give the whole build command. > Please provide more details so that we can help you out. > I've attached a shar file with all the details. Unpack it into an empty directory, cd to that directory, and try 'sh ./makeit' This will fetch binutils and gcc; configure and make binutils and gcc; and then attempt to use arm-elf-gcc to compile a tiny c program that demonstrates the problem. (Obviously, if you already have binutils and gcc tgz files, you can comment out the wgets before running the script and replace them with references to your local copies.) ----- demo.c int _start() { double f =3D 1.23; return f; } ----- Basically, if I tell arm-elf-gcc which arm processor I'm using, it recognizes that the processor has no floating point, so arm-elf-ld fails, as it should, with the messages: sponge:sf 500:arm/bin/arm-elf-gcc -mthumb-interwork -msoft-float -mcpu=3Darm926ej-s -c demo.c sponge:sf 501: arm/bin/arm-elf-ld -o demo.elf demo.o=20 arm/lib/gcc/arm-elf/4.1.0/interwork/libgcc.a arm/bin/arm-elf-ld: ERROR: arm/lib/gcc/arm-elf/4.1.0/interwork/libgcc.a(_fixdfsi.o) uses FPA instructions, whereas demo.elf does not arm/bin/arm-elf-ld: failed to merge target specific data of file arm/lib/gcc/arm-elf/4.1.0/interwork/libgcc.a(_fixdfsi.o) if I remove '-mcpu=3Darm926ej-s' from the compile, then the ld will work, but i'll end up with floating point instructions on an arm processor that has no fp. The configuration and make steps from the attached script are: mkdir binutils-build cd binutils-build ../binutils-2.16.1/configure --prefix=3D$BASE/arm --target=3Darm-elf --enable-interwork --enable-multilib --with-float=3Dsoft make all && make install cd .. mkdir gcc-build cd gcc-build ../gcc-4.1.0/configure --prefix=3D$BASE/arm --target=3Darm-elf --enable-languages=3Dc --with-float=3Dsoft --enable-interwork make all-gcc && make install-gcc cd .. The problem seems to be that I'm not passing the right arguments to gcc-4.1.0/configure to cause it to not build libgcc.a with floating point. All help is appreciated. If the shar file attachment doesn't make it through, it can be picked up via wget http://www.fogey.com/bug.shar or wget http://www.fogey.com/bug.tgz Marty ------=_Part_27518_32743832.1144968794077 Content-Type: application/x-shar; name=bug.shar Content-Transfer-Encoding: 7bit X-Attachment-Id: f_elzof003 Content-Disposition: attachment; filename="bug.shar" Content-length: 10135 #!/bin/sh # This is a shell archive (produced by GNU sharutils 4.2.1). # To extract the files from this archive, save it to some FILE, remove # everything before the `!/bin/sh' line above, then type `sh FILE'. # # Made on 2006-04-13 15:34 PDT by . # Source directory was `/home/mfouts/sf'. # # Existing files will *not* be overwritten unless `-c' is specified. # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 46 -rw-r--r-- demo.c # 1106 -rw-r--r-- makeit # 489 -r--r--r-- patch-configure.diff # 494 -r--r--r-- patch-configure.in.diff # 940 -r--r--r-- patch-t-arm-elf.diff # save_IFS="${IFS}" IFS="${IFS}:" gettext_dir=FAILED locale_dir=FAILED first_param="$1" for dir in $PATH do if test "$gettext_dir" = FAILED && test -f $dir/gettext \ && ($dir/gettext --version >/dev/null 2>&1) then set `$dir/gettext --version 2>&1` if test "$3" = GNU then gettext_dir=$dir fi fi if test "$locale_dir" = FAILED && test -f $dir/shar \ && ($dir/shar --print-text-domain-dir >/dev/null 2>&1) then locale_dir=`$dir/shar --print-text-domain-dir` fi done IFS="$save_IFS" if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED then echo=echo else TEXTDOMAINDIR=$locale_dir export TEXTDOMAINDIR TEXTDOMAIN=sharutils export TEXTDOMAIN echo="$gettext_dir/gettext -s" fi if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"' elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"' elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then shar_touch='touch -am $3$4$5$6$2 "$8"' else shar_touch=: echo $echo 'WARNING: not restoring timestamps. Consider getting and' $echo "installing GNU \`touch', distributed in GNU File Utilities..." echo fi rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch # if mkdir _sh26658; then $echo 'x -' 'creating lock directory' else $echo 'failed to create lock directory' exit 1 fi # ============= demo.c ============== if test -f 'demo.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'demo.c' '(file already exists)' else $echo 'x -' extracting 'demo.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'demo.c' && int _start() { X double f = 1.23; X return f; } SHAR_EOF (set 20 06 04 13 14 40 14 'demo.c'; eval "$shar_touch") && chmod 0644 'demo.c' || $echo 'restore of' 'demo.c' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'demo.c:' 'MD5 check failed' 326874c83f86da8a704f0e979872ef28 demo.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'demo.c'`" test 46 -eq "$shar_count" || $echo 'demo.c:' 'original size' '46,' 'current size' "$shar_count!" fi fi # ============= makeit ============== if test -f 'makeit' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'makeit' '(file already exists)' else $echo 'x -' extracting 'makeit' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'makeit' && #!/bin/sh X export BASE=`pwd` export PATH=$BASE/arm/bin:$PATH X rm -rf arm binutils-2.16.1 gcc-4.1.0 binutils-build gcc-build X wget http://ftp.gnu.org/gnu/binutils/binutils-2.16.1.tar.gz wget ftp://mirrors.kernel.org/gnu/gcc/gcc-4.1.0/gcc-core-4.1.0.tar.bz2 wget ftp://mirrors.kernel.org/gnu/gcc/gcc-4.1.0/gcc-g++-4.1.0.tar.bz2 X tar xzf binutils-2.16.1.tar.gz tar jxf gcc-core-4.1.0.tar.bz2 tar jxf gcc-g++-4.1.0.tar.bz2 cd gcc-4.1.0 patch gcc/config/arm/t-arm-elf -i ../patch-t-arm-elf.diff patch -i ../patch-configure.diff patch -i ../patch-configure.in.diff cd .. X mkdir binutils-build cd binutils-build X../binutils-2.16.1/configure --prefix=$BASE/arm --target=arm-elf --enable-interwork --enable-multilib --with-float=soft make all && make install cd .. X mkdir gcc-build cd gcc-build X../gcc-4.1.0/configure --prefix=$BASE/arm --target=arm-elf --enable-languages=c --with-float=soft --enable-interwork X make all-gcc && make install-gcc cd .. X arm/bin/arm-elf-gcc -mthumb-interwork -msoft-float -mcpu=arm926ej-s -c demo.c arm/bin/arm-elf-ld -o demo.elf demo.o arm/lib/gcc/arm-elf/4.1.0/interwork/libgcc.a SHAR_EOF (set 20 06 04 13 15 34 00 'makeit'; eval "$shar_touch") && chmod 0644 'makeit' || $echo 'restore of' 'makeit' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'makeit:' 'MD5 check failed' 279c5b484643603b13e9b284d8018fe5 makeit SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'makeit'`" test 1106 -eq "$shar_count" || $echo 'makeit:' 'original size' '1106,' 'current size' "$shar_count!" fi fi # ============= patch-configure.diff ============== if test -f 'patch-configure.diff' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'patch-configure.diff' '(file already exists)' else $echo 'x -' extracting 'patch-configure.diff' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'patch-configure.diff' && --- configure.orig 2005-12-16 04:57:40.000000000 -0800 +++ configure 2006-03-31 16:51:28.000000000 -0800 @@ -1265,7 +1265,7 @@ X noconfigdirs="$noconfigdirs ${libgcj}" X ;; X arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* ) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" + noconfigdirs="$noconfigdirs target-libffi target-qthreads target-libstc++-v3" X ;; X arm*-*-linux-gnueabi) X noconfigdirs="$noconfigdirs target-libffi target-qthreads" SHAR_EOF (set 20 06 04 13 14 39 58 'patch-configure.diff'; eval "$shar_touch") && chmod 0444 'patch-configure.diff' || $echo 'restore of' 'patch-configure.diff' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'patch-configure.diff:' 'MD5 check failed' 8f1f2a4c142538f1682cb455489f093a patch-configure.diff SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'patch-configure.diff'`" test 489 -eq "$shar_count" || $echo 'patch-configure.diff:' 'original size' '489,' 'current size' "$shar_count!" fi fi # ============= patch-configure.in.diff ============== if test -f 'patch-configure.in.diff' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'patch-configure.in.diff' '(file already exists)' else $echo 'x -' extracting 'patch-configure.in.diff' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'patch-configure.in.diff' && --- configure.in.orig 2005-12-16 04:57:40.000000000 -0800 +++ configure.in 2006-03-31 16:51:48.000000000 -0800 @@ -473,7 +473,7 @@ X noconfigdirs="$noconfigdirs ${libgcj}" X ;; X arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* ) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" + noconfigdirs="$noconfigdirs target-libffi target-qthreads target-libstdc++-v3" X ;; X arm*-*-linux-gnueabi) X noconfigdirs="$noconfigdirs target-libffi target-qthreads" SHAR_EOF (set 20 06 04 13 14 39 58 'patch-configure.in.diff'; eval "$shar_touch") && chmod 0444 'patch-configure.in.diff' || $echo 'restore of' 'patch-configure.in.diff' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'patch-configure.in.diff:' 'MD5 check failed' 821eb7f989487d513f243a66ccea95f7 patch-configure.in.diff SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'patch-configure.in.diff'`" test 494 -eq "$shar_count" || $echo 'patch-configure.in.diff:' 'original size' '494,' 'current size' "$shar_count!" fi fi # ============= patch-t-arm-elf.diff ============== if test -f 'patch-t-arm-elf.diff' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'patch-t-arm-elf.diff' '(file already exists)' else $echo 'x -' extracting 'patch-t-arm-elf.diff' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'patch-t-arm-elf.diff' && --- t-arm-elf.orig 2004-09-01 04:14:21.000000000 -0700 +++ t-arm-elf 2006-03-31 16:55:28.000000000 -0800 @@ -23,8 +23,8 @@ X # MULTILIB_DIRNAMES += fpu soft X # MULTILIB_EXCEPTIONS += *mthumb/*mhard-float* X # -# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork -# MULTILIB_DIRNAMES += normal interwork +MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork +MULTILIB_DIRNAMES += normal interwork X # X # MULTILIB_OPTIONS += fno-leading-underscore/fleading-underscore X # MULTILIB_DIRNAMES += elf under @@ -67,7 +67,7 @@ X # Currently there is a bug somewhere in GCC's alias analysis X # or scheduling code that is breaking _fpmul_parts in fp-bit.c. X # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline -msoft-float X X # Assemble startup files. X $(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES) SHAR_EOF (set 20 06 04 13 14 39 58 'patch-t-arm-elf.diff'; eval "$shar_touch") && chmod 0444 'patch-t-arm-elf.diff' || $echo 'restore of' 'patch-t-arm-elf.diff' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'patch-t-arm-elf.diff:' 'MD5 check failed' 4c43bc66988990927b18eba26988a097 patch-t-arm-elf.diff SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'patch-t-arm-elf.diff'`" test 940 -eq "$shar_count" || $echo 'patch-t-arm-elf.diff:' 'original size' '940,' 'current size' "$shar_count!" fi fi rm -fr _sh26658 exit 0 ------=_Part_27518_32743832.1144968794077--