LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Why can't I install GCC 9.3.0 from source? (https://www.linuxquestions.org/questions/linux-from-scratch-13/why-cant-i-install-gcc-9-3-0-from-source-4175684129/)

kayjoyka 10-23-2020 05:04 PM

Why can't I install GCC 9.3.0 from source?
 
Hi,
I'm currently making an embedded Linux system that's meant to run on a Raspberry Pi. I'm following the instructions in a book called CLFS - Embedded but unfortunately I'm stuck on the final installation of the GCC cross compiler. Upon configuring it and running make after a while I get this message:
Code:

/usr/bin/ld: libcommon.a(diagnostic.o): in function `diagnostic_action_after_output(diagnostic_context*, diagnostic_t)':
/home/kayjoyka/Pulpit/clfs/sources/gcc-build/gcc/../../gcc-9.3.0/gcc/diagnostic.c:536: undefined reference to `backtrace_full'
collect2: error: ld returned 1 exit status
make[2]: *** [../../gcc-9.3.0/gcc/c/Make-lang.in:85: cc1] Error 1
make[2]: Leaving directory '/home/kayjoyka/Pulpit/clfs/sources/gcc-build/gcc'
make[1]: *** [Makefile:4313: all-gcc] Error 2
make[1]: Leaving directory '/home/kayjoyka/Pulpit/clfs/sources/gcc-build'
make: *** [Makefile:945: all] Error 2

If I'm not mistaken the 'backtrace_full' that diagnostic.c is referring to here is part of backtrace.c from libbacktrace, but backtrace.h in which it is defined is included in diagnostic.c so why would this be happening? Am I doing something wrong?

business_kid 10-26-2020 06:43 AM

Hello, kayjoyka & welcome to LQ.

With LFS and especially CLFS, always post the exact page on which you are working, and your host distribution.

"Undefined Reference" errors are usually libraries. If your program version is too old, features may have been added to newer ones. A library, as you probably know, is a compiled collection of useful routines which programs can call to do stuff. They are memory efficient, because many programs can use the same library. But if they call something that isn't there, that throws the 'undefined reference' error.

I would run the version check script for the current book (in chapter 2?)

Keith Hedger 10-26-2020 09:02 AM

you don't need to cross compile for the pi you can compile (B)LFS completly on a pi ( tested on pi 3/4 ), crosscompiling just adds unnecessary complications.

raspian can easily be set up to build (B)LFS.

Just follow the LFS book as you would for a desktop build


All times are GMT -5. The time now is 12:18 AM.