From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16098 invoked by alias); 8 Jan 2008 07:09:10 -0000 Received: (qmail 16088 invoked by uid 22791); 8 Jan 2008 07:09:08 -0000 X-Spam-Check-By: sourceware.org Received: from rv-out-0910.google.com (HELO rv-out-0910.google.com) (209.85.198.187) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 08 Jan 2008 07:08:51 +0000 Received: by rv-out-0910.google.com with SMTP id g11so5889830rvb.56 for ; Mon, 07 Jan 2008 23:08:49 -0800 (PST) Received: by 10.140.177.15 with SMTP id z15mr4278500rve.128.1199776129115; Mon, 07 Jan 2008 23:08:49 -0800 (PST) Received: by 10.141.179.17 with HTTP; Mon, 7 Jan 2008 23:08:49 -0800 (PST) Message-ID: <7119e3eb0801072308o6dd233e4n94ee73a84cc47dfb@mail.gmail.com> Date: Tue, 08 Jan 2008 19:25:00 -0000 From: "Bob Yan" To: "Kai Ruottu" Subject: Re: Errors when building powerpc-softfloat-linux-gnu libgfrotran Cc: gcc-help@gcc.gnu.org In-Reply-To: <4782A93E.1020200@mbnet.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7119e3eb0801062116q5340fc20g3a91d3d85c9c9d27@mail.gmail.com> <4781ECE6.3030700@mbnet.fi> <7119e3eb0801070825ucb63aeeoe086b46d27f0b95f@mail.gmail.com> <4782A93E.1020200@mbnet.fi> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg00069.txt.bz2 In fact, we do not have to install a gcc into the host because it is just a experimental host with little disk and a small linux. But with your help, I remove --with-newlib and build again. Now the cross only version compiler works, and the programs compiled by it seams running ok on the powerpc-linux host. Now, some other important work can be started with the ugly-built tool chain, that is enough for these days. After I finish my necessary work, I will try to build a real compiler for the host according to your suggestions. Thank you very much. Bob Yan Ps: After i built my glib, many headers was copied into the directory "$prefix/$target/sys-include" but not the directory "$prefix/$target/include", so I execute "ln -s /home/yxb/install/include /home/yxb/install/powerpc-softfloat-linux-gnu/include" to get the necessary headers. In my configuration, it seams the headers made by glibc are copied into the $prefix/include but not $prefix/$target/include. 2008/1/8, Kai Ruottu : > Bob Yan wrote: > > 3) build the glibc > > /home/yxb/glibc-2.3.6/configure --prefix=/home/yxb/install > > > The goal in building glibc usually is to make it suitable to be > installed onto the target > system, ie it provides the "native" glibc there. So the normal value > for $prefix is the > '/usr', ie the option should be '--prefix=/usr' ! One doesn't think > where this glibc > would be installed on the cross host system but where it would be > installed on the > target system. So there is always a full 1-to-1 similarity between the > glibc on the > cross host and on the target system. When the target system already > exists like the > case is with something like Fedora 8 / PPC, the target glibc comes from > it. When > the target system doesn't exist yet, one produces the glibc for it with > the cross GCC > on the cross host. But it will be made mainly for the target system, the > $sysroot place > is the one where it will appear in its 1-to-1 scheme with the > becoming target system. > > Your $prefix installs the glibc into the '/home/yxb/install/...', in > 'include', 'lib', 'etc', > 'bin',... there. This kind of glibc is a "cross only version", usually > a "just for a fun" > experimental one which will not be installed onto any real target system > as its "runtime" > (the shared parts)... > > --with-headers=/usr/powerpc-softfloat-linux-gnu/include > > > This then should point to the Linux kernel headers - if someone doesn't > yet know this > about the glibc configure & build, here it was told.... > > > make all install > > > If the '--prefix=/usr' was used, this command would overwrite the native > glibc and > crash the host system totally! So one must be very careful in the > 'make install' command ! > The right install command would be like : > > make install_root=$sysroot install > > This puts the produced glibc into the '$sysroot/...' and > '$sysroot/usr/...' directories... > > > 4) build the full gcc > > /home/yxb/gcc-4.0.0/configure --prefix=/home/yxb/install > > --target=powerpc-softfloat-linux-gnu --disable-altivec > > --with-float=soft --disable-nls > > > Looks being ok this far ... > > > --with-headers=/usr/powerpc-softfloat-linux-gnu/include > > > When one has that self-made "right" glibc after the step 3, of course it > should be used now! > So this is wrong :( > > --enable-languages=c,c++,f95 --with-cpu=405 --disable-multilib > > --disable-threads --disable-shared --enable-static > > --enable-__cxa-atexit --enable-clocale=gnu > > --with-libs=/home/yxb/install/lib > This '--with-libs=' points to the place where those target libs are, > so basically it is "right". But generally the "cross only version" of > glibc should have been built to be installed into the $tooldir or > '$prefix/$target' where the values are those used in the binutils and > GCC configures. Ie using a '--prefix=$prefix/$target' in the glibc > configure. When NOT using the '--with-sysroot=' in the binutils and GCC > configures, ie using the "traditional" install scheme for the crosstoolchain. > > The alternative then is to use the '--with-sysroot=$sysroot' in the > binutils and GCC configure and then build the glibc for installation > into this $sysroot, via that 'make install_root=$sysroot install' after > configuring the glibc sources using the '--prefix=/usr'... > > Two choices for the installation scheme, the traditional into the > $tooldir and the new one into $tooldir (stuff for running on the $host > and targeted to handle stuff for the $target) and $sysroot (stuff for > the $target). > > > > --enable-c99 --enable-long-long > > --with-newlib > > > The C library is glibc, not "newlib", so this last option is wrong! > > > make all-gcc install-gcc > > > > 5) build the libgfortran > > > > ln -s /home/yxb/install/include > > /home/yxb/install/powerpc-softfloat-linux-gnu/include > > > > /home/yxb/gcc-4.0.0/configure --prefix=/home/yxb/install > > --target=powerpc-softfloat-linux-gnu > > --host=powerpc-softfloat-linux-gnu --with-float=soft > > --with-headers=/usr/powerpc-softfloat-linux-gnu/include > > --with-binutils=/home/yxb/install/powerpc-softfloat-linux-gnu/bin > > --without-fp > > > > make all-target-libgfortran install-target-libgfortran > > > Too complicated, generally the headers from the self-made glibc should > have been in > this '/home/yxb/install/powerpc-softfloat-linux-gnu/include' already > when producing the > earlier GCC parts! This extra 'make' command might be required in order > to get the > 'libgfortran' though... I would expect the > '--enable-languages=c,c++,f95' taking care > about both 'libstdc++-v3' and 'libgfortran' when those 'c++' and 'f95' > are there! > > But when I build the libstdc++-v3, some errors come : > > > > 6) build the libstdc++-v3 > > > > /home/yxb/gcc-4.0.0/configure --prefix=/home/yxb/install > > --target=powerpc-softfloat-linux-gnu > > --host=powerpc-softfloat-linux-gnu --with-float=soft > > --with-headers=/usr/powerpc-softfloat-linux-gnu/include > > --with-binutils=/home/yxb/install/powerpc-softfloat-linux-gnu/bin > > --without-fp > > > > make all-target-libstdc++-v3 install-target-libstdc++-v3 > > > > Here is the errors: > > > > /home/yxb/gcc-4.0.0/libstdc++-v3/src/codecvt.cc -o codecvt.o > > /home/yxb/build-gcc/powerpc-softfloat-linux-gnu/libstdc++-v3/include/powerpc-softfloat-linux-gnu/bits/ctype_base.h:46: > > error: '_U' was not declared in this scope > > /home/yxb/build-gcc/powerpc-softfloat-linux-gnu/libstdc++-v3/include/powerpc-softfloat-linux-gnu/bits/ctype_base.h:47: > > error: '_L' was not declared in this scope > > > This may come from using the '--with-newlib' earlier... All these > "reconfigures" : for libgfortran > and for libstdc++-v3 after the original for GCC aren't what is expected, > a single configure&build > should be enough for GCC, libstdc++-v3 and libgfortran. After the target > glibc is in its right place > (for that "cross only glibc") in the $prefix/$target, 'include' and > 'lib' there. And not forgetting to > make that symlink "sys-include -> include" ! The 'fixinc' phase checks > the 'sys-include', not the > 'include' for the "target headers possibly needing fixing for GCC"... > >