Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This 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!


  Search this Thread
Old 02-19-2011, 02:59 PM   #1
LQ Newbie
Registered: Jan 2011
Posts: 7

Rep: Reputation: 0
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.

# Pass one
# binutils
./configure --prefix=/ffp --libdir=/ffp/lib --includedir=/ffp/include --with-gmp=/ffp --with-mpfr=/ffp

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.

Would appreciate some help here

Old 02-20-2011, 10:55 AM   #2
Senior Member
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 55
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.
Old 02-20-2011, 12:05 PM   #3
LQ Newbie
Registered: Jan 2011
Posts: 7

Original Poster
Rep: Reputation: 0

# uname -a
Linux Brisinga #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)

but these does not exists, is this some missing installation from binutils ?


Last edited by StefanTh; 02-20-2011 at 12:15 PM.
Old 02-20-2011, 02:48 PM   #4
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2015, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,018

Rep: Reputation: 3064Reputation: 3064Reputation: 3064Reputation: 3064Reputation: 3064Reputation: 3064Reputation: 3064Reputation: 3064Reputation: 3064Reputation: 3064Reputation: 3064
uClibc is your system and cannot be changed.

All libraries, all commands depend on that.

Changing any uClibc components will probably stop your OS immediately :
No commands will work any more.

Old 02-21-2011, 12:48 AM   #5
LQ Newbie
Registered: Jan 2011
Posts: 7

Original Poster
Rep: Reputation: 0
> uClibc is your system and cannot be changed.

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.
Old 02-09-2014, 04:43 PM   #6
LQ Newbie
Registered: Dec 2011
Posts: 1

Rep: Reputation: Disabled
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:

--disable-decimal-float \
--disable-libatomic \
--disable-libgomp \
--disable-libmudflap \
--disable-libssp \
--disable-libquadmath \
--disable-libsanitizer \
--disable-threads \
--libexecdir=/$(libexecdir) \
--libdir=/$(PF)/$(configured_libdir) \
$(if $(with_build_sysroot),--with-build-sysroot=$(with_build_sysroot)) \
$(if $(with_sysroot),--with-sysroot=$(with_sysroot))
ifeq ($(DEB_STAGE),stage1)
--disable-shared \
--with-newlib \
# stage2
--enable-shared \

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.
Old 02-10-2014, 12:06 AM   #7
John VV
LQ Muse
Registered: Aug 2005
Posts: 16,256

Rep: Reputation: Disabled

this thread is from February 2011
3 years ago
if this was not fixed 3 years back..........


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
cmem.c:38:19: error: stdio.h: No such file or directory skedar Linux - Newbie 1 08-10-2010 02:39 PM
stdio.h: No such file or directory elaa82 Linux - Software 2 12-29-2009 04:31 AM
GCC 3.2.3 gives error with <stdio.h> on slackware 9.1 Daid Slackware 4 03-01-2009 10:53 PM
test.c:1:19: error: stdio.h: No such file or directory Lokathor Debian 2 09-14-2006 12:11 PM
test.c:1:19: Stdio.h: No such file or directory :( wogga Linux - Software 1 06-11-2004 02:57 PM

All times are GMT -5. The time now is 03:48 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration