* Errors when building powerpc-softfloat-linux-gnu libgfrotran @ 2008-01-07 23:02 Bob Yan [not found] ` <4781ECE6.3030700@mbnet.fi> 0 siblings, 1 reply; 5+ messages in thread From: Bob Yan @ 2008-01-07 23:02 UTC (permalink / raw) To: gcc-help Hi After I built powerpc-softfloat-linux-gnu gcc and gfortran compiler, The c compiler works well and the gfortran show the error like this: ..../bin/ld: cannot find -lgfortranbegin I think it should work after install libgfortran, So I use the the following configuration to build libgfortran which had been proved ok when i built gcc and gfortran: # ********************************************************************* #!/bin/sh /home/yxb/gcc-4.0.0/configure --prefix=/home/yxb/install --target=powerpc-softfloat-linux-gnu --disable-altivec --with-float=soft --disable-nls --without-headers --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 --enable-c99 --enable-long-long make all-target-libgfortran install-target-libgfortran # ********************************************************************* Then the first error i met was that cannot find stdlib.h string.h ctype.h.... So I modified it into the following: # ********************************************************************* #!/bin/sh /home/yxb/gcc-4.0.0/configure --prefix=/home/yxb/install --target=powerpc-softfloat-linux-gnu --disable-altivec --with-float=soft --disable-nls --without-headers --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 --enable-c99 --enable-long-long make all-target-libgfortran install-target-libgfortran INCLUDES=-I/usr/include # ********************************************************************* Now those header files can be found, but another error comes: make[1]: Entering directory `/home/yxb/build/libiberty' make[2]: Entering directory `/home/yxb/build/libiberty/testsuite' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/yxb/build/libiberty/testsuite' make[1]: Leaving directory `/home/yxb/build/libiberty' make[1]: Entering directory `/home/yxb/build/intl' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/yxb/build/intl' make[1]: Entering directory `/home/yxb/build/build-i686-pc-linux-gnu/libiberty' make[2]: Entering directory `/home/yxb/build/build-i686-pc-linux-gnu/libiberty/testsuite' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/yxb/build/build-i686-pc-linux-gnu/libiberty/testsuite' make[1]: Leaving directory `/home/yxb/build/build-i686-pc-linux-gnu/libiberty' make[1]: Entering directory `/home/yxb/build/build-i686-pc-linux-gnu/fixincludes' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/yxb/build/build-i686-pc-linux-gnu/fixincludes' make[1]: Entering directory `/home/yxb/build/libcpp' test -f config.h || (rm -f stamp-h1 && make stamp-h1) make[1]: Leaving directory `/home/yxb/build/libcpp' make[1]: Entering directory `/home/yxb/build/fixincludes' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/yxb/build/fixincludes' make[1]: Entering directory `/home/yxb/build/gcc' make \ CFLAGS="-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition " \ CONFIG_H="config.h auto-host.h /home/yxb/gcc-4.0.0/gcc/../include/ansidecl.h" \ MAKEOVERRIDES= \ -f libgcc.mk all make[2]: Entering directory `/home/yxb/build/gcc' make GCC_FOR_TARGET="/home/yxb/build/gcc/xgcc -B/home/yxb/build/gcc/ -B/home/yxb/install/powerpc-softfloat-linux-gnu/bin/ -B/home/yxb/install/powerpc-softfloat-linux-gnu/lib/ -isystem /home/yxb/install/powerpc-softfloat-linux-gnu/include -isystem /home/yxb/install/powerpc-softfloat-linux-gnu/sys-include" \ AR_FOR_TARGET="powerpc-softfloat-linux-gnu-ar" \ AR_CREATE_FOR_TARGET="powerpc-softfloat-linux-gnu-ar rc" \ AR_EXTRACT_FOR_TARGET="powerpc-softfloat-linux-gnu-ar x" \ AR_FLAGS_FOR_TARGET="" \ CC="gcc" CFLAGS="-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition " \ BUILD_PREFIX="" \ BUILD_PREFIX_1="loser-" \ LANGUAGES="" \ LIBGCC2_CFLAGS="-O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc " \ MULTILIB_CFLAGS="" T= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o crtsavres.o make[3]: Entering directory `/home/yxb/build/gcc' make[3]: `crtend.o' is up to date. make[3]: `crtbeginS.o' is up to date. make[3]: `crtendS.o' is up to date. make[3]: `crtbeginT.o' is up to date. make[3]: `ecrti.o' is up to date. make[3]: `ecrtn.o' is up to date. make[3]: `ncrti.o' is up to date. make[3]: `ncrtn.o' is up to date. make[3]: `crtsavres.o' is up to date. make[3]: Leaving directory `/home/yxb/build/gcc' make[2]: Leaving directory `/home/yxb/build/gcc' echo timestamp > stmp-multilib make[1]: Leaving directory `/home/yxb/build/gcc' Checking multilib configuration... multilib.out is unchanged make[1]: Entering directory `/home/yxb/build/powerpc-softfloat-linux-gnu/libgfortran' make all-am make[2]: Entering directory `/home/yxb/build/powerpc-softfloat-linux-gnu/libgfortran' /bin/sh ./libtool --mode=compile /home/yxb/build/gcc/xgcc -B/home/yxb/build/gcc/ -B/home/yxb/install/powerpc-softfloat-linux-gnu/bin/ -B/home/yxb/install/powerpc-softfloat-linux-gnu/lib/ -isystem /home/yxb/install/powerpc-softfloat-linux-gnu/include -isystem /home/yxb/install/powerpc-softfloat-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I/home/yxb/gcc- 4.0.0/libgfortran -I. -I/usr/include -iquote/home/yxb/gcc-4.0.0/libgfortran/io -std=gnu99 -O2 -g -O2 -c -o environ.lo `test -f 'runtime/environ.c' || echo '/home/yxb/gcc-4.0.0/libgfortran/'`runtime/environ.c /home/yxb/build/gcc/xgcc -B/home/yxb/build/gcc/ -B/home/yxb/install/powerpc-softfloat-linux-gnu/bin/ -B/home/yxb/install/powerpc-softfloat-linux-gnu/lib/ -isystem /home/yxb/install/powerpc-softfloat-linux-gnu/include -isystem /home/yxb/install/powerpc-softfloat-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I/home/yxb/gcc- 4.0.0/libgfortran -I. -I/usr/include -iquote/home/yxb/gcc-4.0.0/libgfortran/io -std=gnu99 -O2 -g -O2 -c /home/yxb/gcc-4.0.0/libgfortran/runtime/environ.c -o environ.o In file included from /usr/include/stdlib.h:436, from /home/yxb/gcc-4.0.0/libgfortran/runtime/environ.c:32: /usr/include/sys/types.h:88: error: two or more data types in declaration specifiers /usr/include/sys/types.h:88: warning: useless type name in empty declaration make[2]: *** [environ.lo] Error 1 make[2]: Leaving directory `/home/yxb/build/powerpc-softfloat-linux-gnu/libgfortran' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/yxb/build/powerpc-softfloat-linux-gnu/libgfortran' make: *** [all-target-libgfortran] Error 2 Please give some advices to overcome it. Here is the config.log. This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. configure:595: checking host system type configure:616: checking target system type configure:634: checking build system type configure:689: checking for a BSD compatible install configure:742: checking whether ln works configure:766: checking whether ln -s works configure:1803: checking for gcc configure:1916: checking whether the C compiler (gcc ) works configure:1932: gcc -o conftest conftest.c 1>&5 configure:1958: checking whether the C compiler (gcc ) is a cross-compiler configure:1963: checking whether we are using GNU C configure:1991: checking whether gcc accepts -g configure:2058: checking for gnatbind configure:2123: checking whether compiler driver understands Ada configure:2155: checking how to compare bootstrapped objects configure:2253: checking for correct version of gmp.h configure:2266: gcc -c -g -O2 conftest.c 1>&5 configure:2279: checking for MPFR configure:2292: gcc -o conftest -g -O2 conftest.c -lmpfr -lgmp 1>&5 configure:2779: checking for bison configure:2814: checking for bison configure:2849: checking for gm4 configure:2884: checking for flex configure:2919: checking for flex configure:2954: checking for makeinfo configure:3601: checking for i686-pc-linux-gnu-ar configure:3634: checking for ar configure:3673: checking for i686-pc-linux-gnu-as configure:3706: checking for as configure:3745: checking for i686-pc-linux-gnu-dlltool configure:3778: checking for dlltool configure:3817: checking for i686-pc-linux-gnu-ld configure:3850: checking for ld configure:3889: checking for i686-pc-linux-gnu-nm configure:3922: checking for nm configure:3961: checking for i686-pc-linux-gnu-ranlib configure:3994: checking for ranlib configure:4033: checking for i686-pc-linux-gnu-windres configure:4066: checking for windres configure:4105: checking for i686-pc-linux-gnu-objcopy configure:4138: checking for objcopy configure:4177: checking for i686-pc-linux-gnu-objdump configure:4210: checking for objdump configure:4256: checking for powerpc-softfloat-linux-gnu-ar configure:4328: checking for powerpc-softfloat-linux-gnu-as configure:4400: checking for powerpc-softfloat-linux-gnu-dlltool configure:4472: checking for powerpc-softfloat-linux-gnu-ld configure:4544: checking for powerpc-softfloat-linux-gnu-nm configure:4616: checking for powerpc-softfloat-linux-gnu-ranlib configure:4688: checking for powerpc-softfloat-linux-gnu-windres configure:4806: checking whether to enable maintainer-specific portions of Makefiles configure:4853: checking if symbolic links between directories work Thank you in advance. Bob Yan ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <4781ECE6.3030700@mbnet.fi>]
* Re: Errors when building powerpc-softfloat-linux-gnu libgfrotran [not found] ` <4781ECE6.3030700@mbnet.fi> @ 2008-01-08 15:12 ` Bob Yan 2008-01-08 17:55 ` Kai Ruottu 0 siblings, 1 reply; 5+ messages in thread From: Bob Yan @ 2008-01-08 15:12 UTC (permalink / raw) To: Kai Ruottu; +Cc: gcc-help Thank you very much! Your answer is very usefull to me. This is the building process of powerpc-softfloat-linux-gnu tool chain: 1) build the binutils: /home/yxb/binutils-2.18/configure --prefix=/home/yxb/install --target=powerpc-softfloat-linux-gnu --with-sysroot=/opt/host-powerpc-softfloat-linux-gnu make all install 2) build the temp gcc /home/yxb/gcc-4.0.0/configure --prefix=/home/yxb/install --target=powerpc-softfloat-linux-gnu --enable-languages=c --disable-threads --disable-shared --with-newlib make all-gcc install-gcc 3) build the glibc /home/yxb/glibc-2.3.6/configure --prefix=/home/yxb/install --target=powerpc-softfloat-linux-gnu --host=powerpc-softfloat-linux-gnu --enable-add-ons=linuxthreads --with-headers=/usr/powerpc-softfloat-linux-gnu/include --with-binutils=/home/yxb/install/powerpc-softfloat-linux-gnu/bin --without-fp make all install 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 --with-headers=/usr/powerpc-softfloat-linux-gnu/include --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 --enable-c99 --enable-long-long --with-newlib 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 From 1) ~ 5), everything is ok, and the gcc, gfortran seams work well 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/build-gcc/gcc/xgcc -shared-libgcc -B/home/yxb/build-gcc/gcc/ -nostdinc++ -L/home/yxb/build-gcc/powerpc-softfloat-linux-gnu/libstdc++-v3/src -L/home/yxb/build-gcc/powerpc-softfloat-linux-gnu/libstdc++-v3/src/.libs -B/home/yxb/install/powerpc-softfloat-linux-gnu/bin/ -B/home/yxb/install/powerpc-softfloat-linux-gnu/lib/ -isystem /home/yxb/install/powerpc-softfloat-linux-gnu/include -isystem /home/yxb/install/powerpc-softfloat-linux-gnu/sys-include -I/home/yxb/build-gcc/powerpc-softfloat-linux-gnu/libstdc++-v3/include/powerpc-softfloat-linux-gnu -I/home/yxb/build-gcc/powerpc-softfloat-linux-gnu/libstdc++-v3/include -I/home/yxb/gcc-4.0.0/libstdc++-v3/libsupc++ -g -O2 -D_GNU_SOURCE -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -c /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 /home/yxb/build-gcc/powerpc-softfloat-linux-gnu/libstdc++-v3/include/powerpc-softfloat-linux-gnu/bits/ctype_base.h:48: 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:48: error: '_L' 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:49: error: '_N' 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:50: error: '_X' 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:50: error: '_N' 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:51: error: '_S' 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:52: error: '_P' 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:52: 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:52: error: '_L' 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:52: error: '_N' 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:52: error: '_B' 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:53: error: '_P' 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:53: 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:53: error: '_L' 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:53: error: '_N' 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:54: error: '_C' 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:55: error: '_P' 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:56: 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:56: error: '_L' 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:56: error: '_N' was not declared in this scope make[3]: *** [codecvt.lo] Error 1 make[3]: Leaving directory `/home/yxb/build-gcc/powerpc-softfloat-linux-gnu/libstdc++-v3/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/yxb/build-gcc/powerpc-softfloat-linux-gnu/libstdc++-v3' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/yxb/build-gcc/powerpc-softfloat-linux-gnu/libstdc++-v3' make: *** [all-target-libstdc++-v3] Error 2 Would you please give me some sugestions? Thank you very much! Bob Yan 2008/1/7, Kai Ruottu <karuottu@mbnet.fi>: > Bob Yan wrote: > > Hi > > > > After I built powerpc-softfloat-linux-gnu gcc and gfortran compiler, > > The c compiler works well and the gfortran show the error like this: > > ..../bin/ld: cannot find -lgfortranbegin > > > > I think it should work after install libgfortran, So I use the the > > following configuration to build libgfortran which had been proved ok > > when i built gcc and gfortran: > > > > # ********************************************************************* > > #!/bin/sh > > > > /home/yxb/gcc-4.0.0/configure --prefix=/home/yxb/install > > --target=powerpc-softfloat-linux-gnu --disable-altivec > > --with-float=soft --disable-nls --without-headers > > --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 --enable-c99 --enable-long-long > > > > make all-target-libgfortran install-target-libgfortran > > > > # ********************************************************************* > > > > Then the first error i met was that cannot find stdlib.h string.h ctype.h.... > > > As default a GCC build for a "system" target - one which can have a > "native GCC" for it - requires > the target C library during the build! So the '--without-headers' is > quite weird here. Ok, you may get > some kind of "stripped GCC" without any C++, Fortran etc. support, ie > those 'libstdc++-v3', > 'libgfortran' etc. support libraries not being produced, only the bare > GCC parts in the subdirectory 'gcc'. > And could then try this "brain damaged" GCC to compile the target C > library and finally rebuild the > final GCC with this existing target C library... Many "purists" or > "bolsheviks" are following this "from > scratch" approach because always vomiting when seeing names like > "Fedora", "OpenSuSE", "Debian" > etc. which are pproviding prebuilt glibcs for 'i386', 'x86_64', 'PPC', > 'Sparc', 'MIPS*', 'HP-PA', 'm68k', > 'ARM' etc. CPU architectures... But the old "I can accept GoodYears > temporalily in a new car although > really wanting Michelins" approach is much, much easier ! > > In order to get 'libstdc++-v3', 'libgfortran' etc. you must provide a C > library for Linux/PPC for the > build. This can be a "hard-float" defaulted one during bootstraping, > the goal being getting at least some > GCC first, to be used to produce the "soft-float" C library (glibc in > this case) next. When having that > soft-float model of glibc, you can replace the temporary bootstrap glibc > with it and produce the final > GCC with all its "extra libraries". Having a "working" GCC during the > glibc build is the assumption > because for it too the "native" build is the default one, there is that > "prebuilt hammer when producing > a new hammer". No reason to start where Linus & Co started when > producing the first GCC and > glibc for a new CPU port of Linux... > > Your '--with-libs=' hints that you have that "soft-float" model of glibc > already, but you are pointing only > to its libraries! Why not to its headers via '--with-headers=' ? Ok, > these both options are obsolete :( > > The current suggestion is to use a "sysroot" where those '/lib', > '/usr/lib' and '/usr/include' for the $target > would be installed, ie into '$sysroot/lib', '$sysroot/usr/lib' and > '$sysroot/usr/include'. And then using the > '--with-sysroot=$sysroot' when configuring binutils and GCC so that > these would find the sysroot'ed > headers and libraries there below the $sysroot... My "standard" for a > $sysroot is '/opt/host-$target', > in your case that would be '/opt/host-powerpc-softfloat-linux-gnu', > meaning "stuff for this alien $host". > > The traditional default place for the $target stuff is the $tooldir aka > $prefix/$target for the target headers > and libraries, but when there are only one 'lib' to be searched but two > 'include's, this has leaded into a > very big mess! Even the GCC developers have had problems to "grok" > those two include directories > and what to do when there are two or more 'lib' directories for a > $target, the developers usually being > "native only" people :( So their "solution" was that "sysroot'ed native > GCC for the target on a cross host". > With gcc-3.3.2 and earlier only the traditional scheme is possible, I > don't remember the binutils version > where the '--with-sysroot=' appeared. > > Also the target binutils, made for the $host but handling the $target > stuff, will be put into the '$tooldir/bin', > with bare 'as', 'ld', 'nm' etc. names. This 'tradition' continues even > when using the '--with-sysroot=', the > $sysroot is only for the stuff for that alien $target ! > > > /home/yxb/gcc-4.0.0/configure --prefix=/home/yxb/install > > --target=powerpc-softfloat-linux-gnu --disable-altivec > > > This makes the '/home/yxb/install/powerpc-softfloat-linux-gnu' being the > traditional '$tooldir' where the > target headers ('include') and libraries ('lib') should be installed > before starting the GCC build ! The > 'sys-include' there should be a symlink to the 'include', both being > seen as the same directory - this is > the usual workaround for the current mess. And in the 'lib' both the > 'lib' and 'usr/lib' parts should be > seen, the 'libc.so' and 'libpthread.so' scripts being edited to not have > those absolute '/lib' and '/usr/lib' > pathnames, but bare library names! And when 'combining' the two 'lib's, > all the usual symlinks to the > '../../lib' should be fixed! > > The easy solution without using the '--with-sysroot=' would be to take > its idea, to put the target stuff > below some $sysroot and then symlink the '$sysroot/usr' things > ('include' and 'lib') to be seen in the > expected '$tooldir' (as 'include' and 'lib' there). With the bare glibc > almost all the 'target libraries' are > already seen in the 'usr/lib', only the important 'libc.so.6' and > 'ld-linux.so.2' or 'ld.so.1' in the Linux/PPC > case, are not seen there... Adding two more symlinks to the '../../lib' > isn't really that hard! But if one > needs also the X11, gtk (Gnome), KDE etc. target libraries and needs to > build sources which expect > a "native" build, then using the '--with-sysroot=' may be quite > obligatory, as told it makes the cross GCC > to look like a native GCC, converting those '-I/usr/X11R6/include' etc. > things to mean the stuff below > that $sysroot instead of using the native ones for the cross host! > > > make all-target-libgfortran install-target-libgfortran INCLUDES=-I/usr/include > > > If your $host platform isn't Linux/PPC, this INCLUDES points to totally > wrong 'target headers' ! > In some SVR4 releases just as in some WinNT, WinCE, Solaris2 etc > "commercial" opsyses there > were CPU-specific '#ifdef's in the target headers, ie these being common > for all those supported > CPUs, for instance Alpha, MIPS, PPC and i386 in WinNT 4.0... But in > Linux each CPU variation > has always had its own custom glibc headers :( So you should have > Linux/PPC headers where they > are expected to be, in '$tooldir/include' (traditional) or > '$sysroot/usr/include' (sysroot'ed). > > > make[2]: Entering directory `/home/yxb/build/gcc' > > make GCC_FOR_TARGET="/home/yxb/build/gcc/xgcc -B/home/yxb/build/gcc/ > > -B/home/yxb/install/powerpc-softfloat-linux-gnu/bin/ > > -B/home/yxb/install/powerpc-softfloat-linux-gnu/lib/ -isystem > > /home/yxb/install/powerpc-softfloat-linux-gnu/include -isystem > > /home/yxb/install/powerpc-softfloat-linux-gnu/sys-include" \ > > > > Here you can see the default traditional search directories in $tooldir > aka $prefix/$target ! > > > make[2]: Entering directory > > `/home/yxb/build/powerpc-softfloat-linux-gnu/libgfortran' > > /bin/sh ./libtool --mode=compile /home/yxb/build/gcc/xgcc > > -B/home/yxb/build/gcc/ > > -B/home/yxb/install/powerpc-softfloat-linux-gnu/bin/ > > -B/home/yxb/install/powerpc-softfloat-linux-gnu/lib/ -isystem > > /home/yxb/install/powerpc-softfloat-linux-gnu/include -isystem > > /home/yxb/install/powerpc-softfloat-linux-gnu/sys-include > > -DHAVE_CONFIG_H -I. -I/home/yxb/gcc- 4.0.0/libgfortran -I. > > -I/usr/include -iquote/home/yxb/gcc-4.0.0/libgfortran/io -std=gnu99 > > -O2 -g -O2 -c -o environ.lo `test -f 'runtime/environ.c' || echo > > '/home/yxb/gcc-4.0.0/libgfortran/'`runtime/environ.c > > /home/yxb/build/gcc/xgcc -B/home/yxb/build/gcc/ > > -B/home/yxb/install/powerpc-softfloat-linux-gnu/bin/ > > -B/home/yxb/install/powerpc-softfloat-linux-gnu/lib/ -isystem > > /home/yxb/install/powerpc-softfloat-linux-gnu/include -isystem > > /home/yxb/install/powerpc-softfloat-linux-gnu/sys-include > > -DHAVE_CONFIG_H -I. -I/home/yxb/gcc- 4.0.0/libgfortran -I. > > -I/usr/include -iquote/home/yxb/gcc-4.0.0/libgfortran/io -std=gnu99 > > -O2 -g -O2 -c /home/yxb/gcc-4.0.0/libgfortran/runtime/environ.c -o > > environ.o > > In file included from /usr/include/stdlib.h:436, > > from /home/yxb/gcc-4.0.0/libgfortran/runtime/environ.c:32: > > /usr/include/sys/types.h:88: error: two or more data types in > > declaration specifiers > > /usr/include/sys/types.h:88: warning: useless type name in empty declaration > > > The native headers in '/usr/include' aren't for Linux/PPC or how? They > may be for "Linux" > but for 'i386' or 'x86_64 & i386'.... > > configure:3601: checking for i686-pc-linux-gnu-ar > > configure:3634: checking for ar > > configure:3673: checking for i686-pc-linux-gnu-as > > configure:3706: checking for as > > configure:3745: checking for i686-pc-linux-gnu-dlltool > > configure:3778: checking for dlltool > > configure:3817: checking for i686-pc-linux-gnu-ld > > configure:3850: checking for ld > > configure:3889: checking for i686-pc-linux-gnu-nm > > configure:3922: checking for nm > > configure:3961: checking for i686-pc-linux-gnu-ranlib > > configure:3994: checking for ranlib > > configure:4033: checking for i686-pc-linux-gnu-windres > > configure:4066: checking for windres > > configure:4105: checking for i686-pc-linux-gnu-objcopy > > configure:4138: checking for objcopy > > configure:4177: checking for i686-pc-linux-gnu-objdump > > configure:4210: checking for objdump > > configure:4256: checking for powerpc-softfloat-linux-gnu-ar > > configure:4328: checking for powerpc-softfloat-linux-gnu-as > > configure:4400: checking for powerpc-softfloat-linux-gnu-dlltool > > configure:4472: checking for powerpc-softfloat-linux-gnu-ld > > configure:4544: checking for powerpc-softfloat-linux-gnu-nm > > configure:4616: checking for powerpc-softfloat-linux-gnu-ranlib > > configure:4688: checking for powerpc-softfloat-linux-gnu-windres > > configure:4806: checking whether to enable maintainer-specific > > > This hints your $host being a 'i686-pc-linux-gnu' system, not a > 'powerpc-pc-linux-gnu' > or something "compatible with the $target", in which case the native > $host stuff would be > ok also for the $target... > > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Errors when building powerpc-softfloat-linux-gnu libgfrotran 2008-01-08 15:12 ` Bob Yan @ 2008-01-08 17:55 ` Kai Ruottu 2008-01-08 19:17 ` Kai Ruottu 2008-01-08 19:25 ` Bob Yan 0 siblings, 2 replies; 5+ messages in thread From: Kai Ruottu @ 2008-01-08 17:55 UTC (permalink / raw) To: Bob Yan; +Cc: gcc-help 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"... ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Errors when building powerpc-softfloat-linux-gnu libgfrotran 2008-01-08 17:55 ` Kai Ruottu @ 2008-01-08 19:17 ` Kai Ruottu 2008-01-08 19:25 ` Bob Yan 1 sibling, 0 replies; 5+ messages in thread From: Kai Ruottu @ 2008-01-08 19:17 UTC (permalink / raw) To: Bob Yan; +Cc: gcc-help Kai Ruottu wrote: > 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! Let's make it more clear: There should be ONLY ONE glibc with headers and libraries for the $target at a time! Not "some headers from some old glibc" mixed with the new libraries from the just built glibc! The '--with-sysroot=$sysroot' as a bare idea is useful, although using the traditional install scheme, nothing disables one to use the symlinks : $prefix/$target/include -> $sysroot/usr/include and $prefix/$target/lib -> $sysroot/usr/lib and then make those few additional symlinks : ld.so.1 -> ../../lib/ld.so.1 libc.so.6 -> ../../lib/libc.so.6 into the '$sysroot/usr/lib' so that also these would be seen there. And edit the 'libc.so' and 'libpthread.so' scripts to not have those absolute paths like in that : GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a ) or something row in the '$sysroot/usr/lib/libc.so' script... If one has some older glibc in that $sysroot, the recommended way could be to do a : rm -f -r * in the $sysroot before installing the new glibc there... The 'make install_root=$sysroot install' command quite sure doesn't remove those old 'lib*-x.y.z.so*' files in the '$sysroot/lib', ie it is not any "update" command which would do things like this.... ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Errors when building powerpc-softfloat-linux-gnu libgfrotran 2008-01-08 17:55 ` Kai Ruottu 2008-01-08 19:17 ` Kai Ruottu @ 2008-01-08 19:25 ` Bob Yan 1 sibling, 0 replies; 5+ messages in thread From: Bob Yan @ 2008-01-08 19:25 UTC (permalink / raw) To: Kai Ruottu; +Cc: gcc-help 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 <karuottu@mbnet.fi>: > 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"... > > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-01-08 7:09 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-01-07 23:02 Errors when building powerpc-softfloat-linux-gnu libgfrotran Bob Yan [not found] ` <4781ECE6.3030700@mbnet.fi> 2008-01-08 15:12 ` Bob Yan 2008-01-08 17:55 ` Kai Ruottu 2008-01-08 19:17 ` Kai Ruottu 2008-01-08 19:25 ` Bob Yan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).