OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 10:58 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [Solved] Problems building GCC from source
PostPosted: Sat Dec 29, 2018 11:08 am 
Offline

Joined: Sat Dec 29, 2018 10:34 am
Posts: 3
Hello,
(I hope this is the right place to ask this question)

I am trying to build GCC as a native system C/C++ compiler from source.

For some reason I'm facing errors that don't give very much information about what I'm doing wrong.

My system is Debian Stretch.
The GCC version I'm trying to build is 6.4.0.

The source is contained in ~/opt/gcc-6.4.0
The output is to be placed in ~/opt/build-gcc

What I have done so far:

1. Excexuted
Code:
contrib/download_prerequisites
in source directory.
2. Switched to "build-gcc"
3. Configured GCC like that:
Code:
../gcc-6.4.0/configure \
--prefix=$HOME/opt/gcc-6.4.0/ \
--enable-languages=c,c++ \
--disable-nls  \
--disable-werror \
--with-gmp \
--enable-multilib


After that, running "make" inside of "build-gcc" aborts like this:
Code:
make[2]: Leaving directory '/home/userid/opt/build-gcc'
Makefile:23999: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/home/userid/opt/build-gcc'
Makefile:921: recipe for target 'all' failed
make: *** [all] Error 2


I'm stucked at this point. What am I doing wrong?


Last edited by Monolithos on Sat Dec 29, 2018 3:37 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Problems building GCC from source
PostPosted: Sat Dec 29, 2018 11:40 am 
Online
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
You don't seem to have specified a target.


Top
 Profile  
 
 Post subject: Re: Problems building GCC from source
PostPosted: Sat Dec 29, 2018 11:45 am 
Offline

Joined: Sat Dec 29, 2018 10:34 am
Posts: 3
According to the documentation found at https://gcc.gnu.org/install/configure.html it should determine the target itself.

Quote:
GCC has code to correctly determine the correct value for target for nearly all native systems. Therefore, we highly recommend you do not provide a configure target when configuring a native compiler.


So I didn't specify the target on purpose.

The Makefile generated from configure also seems to have the correct target specified
Code:
...
build_alias=x86_64-pc-linux-gnu
build_vendor=pc
build_os=linux-gnu
build=x86_64-pc-linux-gnu
host_alias=x86_64-pc-linux-gnu
host_vendor=pc
host_os=linux-gnu
host=x86_64-pc-linux-gnu
target_alias=x86_64-pc-linux-gnu
target_vendor=pc
target_os=linux-gnu
target=x86_64-pc-linux-gnu
...


Top
 Profile  
 
 Post subject: Re: Problems building GCC from source
PostPosted: Sat Dec 29, 2018 12:13 pm 
Offline
Member
Member
User avatar

Joined: Mon Mar 05, 2012 11:23 am
Posts: 616
Location: Germany
Hey,

check the log for where the actual error occurs. The part you posted is just the end of the log where it says it failed. The actual error came up earlier.

Greets

_________________
Ghost OS - GitHub


Top
 Profile  
 
 Post subject: Re: Problems building GCC from source
PostPosted: Sat Dec 29, 2018 3:20 pm 
Offline

Joined: Sat Dec 29, 2018 10:34 am
Posts: 3
There was an error in the output of make
(I'd like to post the error message but was logged out for inactivity when I wanted to preview
so the already written text is gone and it also vanished from the terminal after starting make check-gcc)

Apparently there actually were some C-libraries missing #-o

Installing libc6-dev-x32, libc6-i386, libc6-x32, libc6-dev-i386 did the trick.

I don't know why they where missing

It compiled and passed the checks succesfully.

Thank you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group