LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can not compile gcc, fatal error: stdio.h: No such file or directory (https://www.linuxquestions.org/questions/linux-newbie-8/can-not-compile-gcc-fatal-error-stdio-h-no-such-file-or-directory-863780/)

StefanTh 02-19-2011 02:59 PM

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

Regards

Kenny_Strawn 02-20-2011 10:55 AM

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.

StefanTh 02-20-2011 12:05 PM

Hi

# 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 ?



/Stefan

knudfl 02-20-2011 02:48 PM

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.

..

StefanTh 02-21-2011 12:48 AM

> 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.

donjoshu 02-09-2014 04:43 PM

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:

ifdef DEB_STAGE
CONFARGS += \
--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)
CONFARGS += \
--disable-shared \
--with-newlib \
--without-headers
else
# stage2
CONFARGS += \
--enable-shared
endif
else
CONFARGS += \
--enable-shared \
--enable-linker-build-id

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.

John VV 02-10-2014 12:06 AM

donjoshu

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


All times are GMT -5. The time now is 08:54 AM.