Problems while compiling GCC.

1,177 views
Skip to first unread message

Vishal Yadav

unread,
Jan 14, 2012, 11:00:15 AM1/14/12
to cof...@googlegroups.com
Dear All,
           I am a final year student and as my final year project I've to deal with GCC source code. But while compiling the source code I'm getting the following error.
                 
                /usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory
                compilation terminated.
                make[3]: *** [_muldi3.o] Error 1
                make[3]: Leaving directory `/home/vishal/GCC/build/i686-pc-linux-gnu/libgcc'
                make[2]: *** [all-stage1-target-libgcc] Error 2
                make[2]: Leaving directory `/home/vishal/GCC/build'
                make[1]: *** [stage1-bubble] Error 2
                make[1]: Leaving directory `/home/vishal/GCC/build'
                make: *** [all] Error 2

As far as I know I've taken all the necessary precautions while installing. I've installed all the necessary prerequisites like mpfr, mpc, gmp, cloog and libelf. Yet I getting the above mentioned error. I've tried it with gcc version 4.6.0, 4.6.1 and 4.6.2 but the same error persists.

                           I would be like to know if there are any errors in the installion process or it is som kind of a bug.
                                      
                                             Yours faithfully,
                                             Vishal I. Yadav,
                                             BTech I.T.,

shravan aras

unread,
Jan 14, 2012, 11:05:45 AM1/14/12
to cof...@googlegroups.com
Hi,
/usr/include/features.h includes the file /usr/include/bits/predefs.h
However in your case this file is not present in the directory I
presume. Please check if that file is present. I have attached my file
in case it is not present please download the file attached along with
this email and place it in /usr/include/bits/

Thank You,

> --
> You received this message because you are subscribed to the Google Groups
> "CoFSUG" group.
> To post to this group, send an email to cof...@googlegroups.com.
> To unsubscribe from this group, send email to
> cofsug+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/cofsug?hl=en-GB.

--
Shravan Aras.
(http://www.kushraho.com)

predefs.h

Vishal Yadav

unread,
Jan 14, 2012, 2:24:54 PM1/14/12
to cof...@googlegroups.com
  I think I might be having problems with glibc library. About the previous error about predefs.h not found - I downloaded predefs.h and copied in /usr/include/bits(incidentally there was no /usr/include/bits directory). After then the errors kept on escalating like - /usr/include/sys/cdefs.h not found, /usr/include/gnu/stubs.h, /usr/include/bits/types.h and so on.
 
  I'm using Ubuntu 11.10, is there some problem there?

स्वप्नील Swapnil

unread,
Jan 14, 2012, 2:32:08 PM1/14/12
to cof...@googlegroups.com
Hi Vishal,

Had you installed all the dependencies required for gcc compilation? Was  "./configure" step completed successfully?


--
Regards,
Swapnil Kulkarni

shravan aras

unread,
Jan 14, 2012, 2:45:54 PM1/14/12
to cof...@googlegroups.com
Hi,
Please check if you have installed libc6-dev-i386 package along with
libc6-dev package. You can check if the required packages are
installed by running a dpkg -l | grep libc6

Please let us know your system architecture as well.

Thank You,

Muneeb Shaikh

unread,
Jan 14, 2012, 2:56:53 PM1/14/12
to cof...@googlegroups.com
On 01/15/2012 12:54 AM, Vishal Yadav wrote:
> I think I might be having problems with glibc library. About the previous
> error about predefs.h not found - I downloaded predefs.h and copied in
> /usr/include/bits(incidentally there was no /usr/include/bits directory).
> After then the errors kept on escalating like - /usr/include/sys/cdefs.h
> not found, /usr/include/gnu/stubs.h, /usr/include/bits/types.h and so on.
>
> I'm using Ubuntu 11.10, is there some problem there?
>

I think you don't have dependencies installed for building GCC. You will
get almost all dependencies by issuing following command. This will
fetch dependencies required to build GCC for C and C++ AFAIK, but will
fail to build for Java and other languages.

$ sudo apt-get build-dep gcc-4.6

Again you might face problem as you are on Ubuntu 11.10 which uses
multiarch. To overcome this issue you will have to *specify the library
path.* So the commands will look like ( I assume you are on 64bit OS)

$ cd path/to/gcc-source
$ ./configure

Note: Only enable languages which you need. I think the option is
"--enable-languages=c,c++", do cross check here.

$ LIBRARY_PATH=/usr/lib/x86_64-linux-gnu make

This is time consuming step, you might want to consider 'ccache' if you
are going to be rebuilding often, and the "-j" option to 'make' to
specify number of cpu cores to use.

$ sudo make install # if you want to install it.

Do let us know if it solves the problem.

-Muneeb

prasanna balan

unread,
Jan 15, 2012, 12:46:09 AM1/15/12
to cof...@googlegroups.com
I saw ubuntu's list of packages and found this

http://packages.ubuntu.com/oneiric/i386/libc6-dev/filelist
(i386 as error tuple was i696-pc-linux-gnu)

All the files mentioned by vishal
(bits/predefs.h,sys/cdefs.h,gnu/stubs.h etc) were there under
/usr/include/i386-linux-gnu/
instead of /usr/include

Some more searching revealed that Ubuntu 11.10 has a new concept
called multiarch.
Thus the exra triplet

This link below explains it roughly with some links and gives a patch too.

http://gcc.gnu.org/ml/gcc-patches/2011-08/msg01649.html

You can build gcc by pulling the patch from Ubuntu's or debian's source repos
(ubuntu's at launchpad, debian no idea)

I don't use Ubuntu so i can't test this.Try and let me know

-prasanna

Vishal Yadav

unread,
Jan 15, 2012, 2:20:44 AM1/15/12
to cof...@googlegroups.com
After doing that I'm getting this error.
My Architecture is as follows
Processor : Intel® Core™2 Duo CPU T6500 @ 2.10GHz × 2
OS : 32-bit
In file included from /usr/include/features.h:388:0,
                 from /usr/include/stdio.h:28,
                 from ../../../gcc-4.6.0/libgcc/../gcc/tsystem.h:87,
                 from ../../../gcc-4.6.0/libgcc/../gcc/libgcc2.c:29:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory

compilation terminated.
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory `/home/vishal/GCC/build/i686-pc-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/home/vishal/GCC/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/vishal/GCC/build'
make: *** [all] Error 2


Shakthi Kannan

unread,
Jan 15, 2012, 7:08:45 AM1/15/12
to cof...@googlegroups.com
Hi,

--- On Sun, Jan 15, 2012 at 12:50 PM, Vishal Yadav <yada...@gmail.com> wrote:
| /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or

\--

Can you try to install build-essential?

# apt-get install build-essential

Most deb based systems use this to install all the dependency packages
required for development.

SK

--
Shakthi Kannan
http://www.shakthimaan.com

Muneeb Shaikh

unread,
Jan 15, 2012, 3:51:20 PM1/15/12
to cof...@googlegroups.com
On 01/15/2012 12:50 PM, Vishal Yadav wrote:
> After doing that I'm getting this error.
> My Architecture is as follows
> Processor : Intel� Core�2 Duo CPU T6500 @ 2.10GHz � 2

> OS : 32-bit
> In file included from /usr/include/features.h:388:0,
> from /usr/include/stdio.h:28,
> from ../../../gcc-4.6.0/libgcc/../gcc/tsystem.h:87,
> from ../../../gcc-4.6.0/libgcc/../gcc/libgcc2.c:29:
> /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or
> directory
> compilation terminated.
> make[3]: *** [_muldi3.o] Error 1
> make[3]: Leaving directory `/home/vishal/GCC/build/i686-pc-linux-gnu/libgcc'
> make[2]: *** [all-stage1-target-libgcc] Error 2
> make[2]: Leaving directory `/home/vishal/GCC/build'
> make[1]: *** [stage1-bubble] Error 2
> make[1]: Leaving directory `/home/vishal/GCC/build'
> make: *** [all] Error 2
>
>

It would be easy for us to solve the issue if you can post the steps
executed and its output to some paste service such as pastebin.com

Still, looking at the error,

> /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such
file or directory

indicates that you either didn't have installed the libc6-dev (and
libc6-dev-i386) or didn't exported the library path as mentioned in my
previous post (which is required as Ubuntu is using multiarch)

As you mentioned your OS is 32bit, and assuming you installed the
libc6-dev, execute 'make' command as follows,

$ LIBRARY_PATH=/usr/lib/i386-linux-gnu make

And again, post the full steps you followed on some paste service if you
get error.

-Muneeb

Reply all
Reply to author
Forward
0 new messages