Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC 11: Dwarf Error: found dwarf version '5', this reader only handles version 2, 3 and 4 information. #1546

Closed
nyckmaia opened this issue Jun 30, 2021 · 6 comments

Comments

@nyckmaia
Copy link

...
[INFO ]  =================================================================
[INFO ]  Installing C library
[INFO ]    =================================================================
[INFO ]    Building for multilib 1/1: ''
[EXTRA]      Cleaning up start files
[EXTRA]      Configuring C library
[EXTRA]      Building C library
[ERROR]      /home/vm/crosstool-ng/.build/arm-unknown-linux-gnueabi/buildtools/lib/gcc/arm-unknown-linux-gnueabi/11.1.0/../../../../arm-unknown-linux-gnueabi/bin/ld.bfd: Dwarf Error: found dwarf version '5', this reader only handles version 2, 3 and 4 information.
[EXTRA]      Installing C library
[INFO ]    Building for multilib 1/1: '': done in 224.26s (at 30:08)
[INFO ]  Installing C library: done in 224.37s (at 30:09)
...
[INFO ]  =================================================================
[INFO ]  Finalizing the toolchain's directory
[INFO ]    Stripping all toolchain executables
[EXTRA]    Installing the populate helper
[EXTRA]    Installing a cross-ldd helper
[EXTRA]    Creating toolchain aliases
[EXTRA]    Collect license information from: /home/vm/crosstool-ng/.build/arm-unknown-linux-gnueabi/src
[EXTRA]    Put the license information to: /home/vm/x-tools/arm-unknown-linux-gnueabi/share/licenses
[INFO ]  Finalizing the toolchain's directory: done in 8.12s (at 51:15)
[INFO ]  Build completed at 20210630.125651
[INFO ]  (elapsed: 51:14.95)
[INFO ]  Finishing installation (may take a few seconds)...
Done!

My question is: Only when I set the crosstool-ng to build a GCC 11.1 I got this erros message:

Dwarf Error: found dwarf version '5', this reader only handles version 2, 3 and 4 information.

Could this cause problems? Should I use GCC 10 to avoid this above error?
Is there a way to get a GCC 11.1 working with my configurations?

  • Linux Kernel 2.6.32
  • Glibc 2.23
  • armv6

Here is my .config file.
ct_config_GCC_11.1_glib-2.23.txt

CrossTool-Ng version: latest (cloned from master today 30 June 2021) I think that is 1.24.0
Host OS: Ubuntu 20.04 LTS x64
Target/sample used: arm-unknown-linux-gnueabi

@nikkon-dev
Copy link
Contributor

Hi, I for some reason I cannot see your config file.
What version of the binutils you are using?
Could you try to lower the binutils version and check if that'd fix your issue?

@nikkon-dev
Copy link
Contributor

Look for the DWARF 5 related info here https://gcc.gnu.org/gcc-11/changes.html

@nyckmaia
Copy link
Author

nyckmaia commented Jul 1, 2021

Hi, I'm using:

CT_BINUTILS_V_2_26=y
CT_BINUTILS_VERSION="2.26.1"

This is the lower version of Binutils in the current master version of Crosstool-ng.

@nyckmaia
Copy link
Author

nyckmaia commented Jul 1, 2021

Look for the DWARF 5 related info here https://gcc.gnu.org/gcc-11/changes.html

In this page above, I saw:

To make GCC 11 generate an older DWARF version use -g together with -gdwarf-2, -gdwarf-3 or -gdwarf-4.

But I cannot localize where to put the -gdwarf-4 inside the Crosstool-ng.
Could you help me?

@nikkon-dev
Copy link
Contributor

If that's a GLibc related flag, you may update GLIBC_EXTRA_CFLAGS in the config.

@deliciousteas
Copy link

Look for the DWARF 5 related info here https://gcc.gnu.org/gcc-11/changes.html

In this page above, I saw:

To make GCC 11 generate an older DWARF version use -g together with -gdwarf-2, -gdwarf-3 or -gdwarf-4.

But I cannot localize where to put the -gdwarf-4 inside the Crosstool-ng. Could you help me?

what about install another type of gcc? I just has the same issue while i was build a c++ project in centos. And my solution is trying to install lower gcc type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants