Can not compile gcc, fatal error: stdio.h: No such file or directory
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can not compile gcc, fatal error: stdio.h: No such file or directory
Dear sir or madame
I am trying to upgrade my NAS with anew toolchain, gcc-4.5.2
The NAS have been "hacked" fonz_plug, that contain a gcc version 4.1.3 with uClibc
I have download all needed tar files and done the following.
My goal is to upgrade the gcc to 4.5.2 and replace the ucLibc on the system with a GNU libc.
But when I try to compile the gcc with
../configure --prefix=/ffp --libdir=/ffp/lib --includedir=/ffp/include --enable-__cxa_atexit --with-float=soft --enable-languages=c,c++ --with-build-sysroot=/ffp --with-build-time-tools=/ffp/bin --with-system-zlib --enable-threads=posix --disable-bootstrap
I get the follwoing error
make[3]: Leaving directory `/mnt/HD/HD_a2/ffp/install/gcc-4.5.2/build/armv5tejl-unknown-linux-gnu/libgcc'
/ffp/install/gcc-4.5.2/build/./gcc/xgcc -B/ffp/install/gcc-4.5.2/build/./gcc/ -B/ffp/armv5tejl-unknown-linux-gnu/bin/ -B/ffp/armv5tejl-unknown-linux-gnu/lib/ -isystem /ffp/armv5tejl-unknown-linux-gnu/include -isystem /ffp/armv5tejl-unknown-linux-gnu/sys-include --sysroot=/ffp -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fomit-frame-pointer -fPIC -Wno-missing-prototypes -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include -DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../libgcc/../gcc/libgcc2.c \
-fvisibility=hidden -DHIDE_EXPORTS
In file included from ../../../libgcc/../gcc/libgcc2.c:29:0:
../../../libgcc/../gcc/tsystem.h:87:19: fatal error: stdio.h: No such file or directory
Why is it doing "Make[3]", I thought --disable-bootstrap avoided that.
Why do I get this error ?
The NAS I have a fulyl working linux environment, I can compie on it and so fort, but apparently not the gcc.
What Linux distro is on the NAS? From what I understand, you need to compile glibc first before compiling gcc, because stdio.h is the C standard library. If you still get errors, chances are other things still need to be installed for dependencies. Post the output of other errors, and if they point to other dependency problems let me know.
# uname -a
Linux Brisinga 2.6.22.18 #22 Mon Aug 30 19:09:34 CST 2010 armv5tejl GNU/Linux
Well, I could try to compile glibc, let me check.
The thing is that fun_plug (that is the distro that have been installed originaly on the NAS) does not have glibc
but instead uClibc.
My goal is to compile up binutils/gcc/glibc and by this replacing the older gcc and uClibc that exist on the NAS.
The toolchain on the NAS at the moment is working in the sense that it is possible to compile and install
other softwares like autoconfig, mediatomb etc. (but I want to upgrade to newer gcc and glibc) so
this mean that I am not trying to build a cross compiler or configuring up something from scratch
but more of updating an existing system
Also, the installation of binutils created the directory "/ffp/armv5tejl-unknown-linux-gnu" (as expected)
but in this directory there is only a bin and a lib directory and I can see that when compiling up the gcc
the /ffp/install/gcc-4.5.2/build/./gcc/xgcc is looking for the directory (among others)
/ffp/armv5tejl-unknown-linux-gnu/include
/ffp/armv5tejl-unknown-linux-gnu/sys-include
but these does not exists, is this some missing installation from binutils ?
That sucks stone hard, I do not want uClibc, I want GNU
I was mearly thinking that if ucLibc is some light version of glibc it's interfaces should be
the same so replacing uClibc with glibc would go smoothly.
Btw, I manage to compile the gcc by adding a link in the armv5tejl-unknown-linux-gnu
to the ordinary include directory on the system and gcc works fine so at least I got the gcc updated.
If you are compiling gcc for a clib you have not installed yet, use the --with-newlib switch in your configure. This is what Linux From Scratch does, and is also available in the Debian source package build process by setting their environment variable DEB_STAGE=stage1. The Debian code from debian/rules2:
LFS sets similar flags disabling the build of the libraries in their pass 1 build of gcc before they have a libc, saying that the libraries will fail to cross compile under such circumstances.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.