On Sun, Jun 11, 2017 at 05:24:59PM -0400, Isaac D. Cohen wrote: > Hi, > > While compiling GCC on the first pass I got the following error: > > checking for suffix of object files... configure: error: in > `/media/isaac/LFS/Source_Code/build-gcc/i686-elf/libgcc': > configure: error: cannot compute suffix of object files: cannot > compile > See `config.log' for more details. > Makefile:12212: recipe for target 'configure-target-libgcc' failed > > As the books says I used GCC 6.3.0 this time. I ran the > download_prerequisites script after unpacking the zipped folder. So I > have the correct versions of GMP, MPC and MPFR. What can be the > problem? In the FAQ (https://gcc.gnu.org/wiki/FAQ#configure_suffix) > it says an error like mine can either result from not running the > download_prerequisites script, or from a bug in the compiler. My > system compiler is gcc-5.4.0 and Imy system binutils is version 2.28. > Can that be the problem? Or is there another reason it might happen > on LFS? > > Thank you very much, > Isaac D. Cohen >
There are many reasons why you might get that particular error message. Among them, things like missing libraries and (really embarrassing) passing invalid CFLAGS. Probably other reasons as well. In general, you need to look at config.log in your editor of choice (you are building LFS, so I'll assume you use the 'view' program (part of vim), but 'less' also works). However, in gcc (and binutils, and perhaps glibc - also in many programs beyond LFS) configure scripts will be run in several directories. In this case, I guess there is a config.log in the libgcc directory. If I'm wrong, 'find /media/isaac/LFS/Source_Code/build-gcc/ -name config.log | xargs ls -l' and then look at the newest config.log. And (once you have found the appropriate config.log file, the process is general for almost all packages) - find the error message using '/' (in view or less, or whatever works in other editors), so /cannot compute suffix of object files or (probably not necessary in current vim, but I think it might be needed in less) escape the spaces: /cannot\ compute\ suffix\ of\ object\ files Once you have found that error message, look at the lines above it (perhaps up to 40 lines). The configure script create program fragments, one at a time, tries to compile them, then continues or (as here) gives up if it encounters a fatal error. And please notes that many of those program fragments will fail, that is normal (trying to determine the characteristics of the system, e.g. by looking at the contents of a header or library). So, as you look back you will find where it creates a program, tries to compile it, get some informative error, and then "translates" that to the error it reported. What you need is the informative error (cannot find a particular file/library, invalid option, something like that). Once you see that, the problem might be obvious. If not, please tell us what that error message says - we might need more information to diagnose the problem. ĸen -- I live in a city. I know sparrows from starlings. After that everything is a duck as far as I'm concerned. -- Monstrous Regiment -- http://lists.linuxfromscratch.org/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page Do not top post on this list. A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? http://en.wikipedia.org/wiki/Posting_style
