1

If I download and try to build GCC 8.x on a newer machine, e.g. Devuan Excalibur GNU/Linux (i.e. Debian Trixie without systemd) - this fails, with the error going something like this:

libstdc++.so.6: version `GLIBCXX_3.4.30' not found

If I manually copy my system's libstdc++6.so over the file missing the relevant [?] - and repeat the process a few times - I get to a different error:

make[7]: Entering directory '/usr/local/src/gcc-8.5.0/x86_64-pc-linux-gnu/32/libitm'
In file included from /usr/include/linux/fs.h:19,
                 from ../../.././libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:68:
/usr/include/linux/mount.h:96:6: error: multiple definition of ‘enum fsconfig_command’
 enum fsconfig_command {
      ^~~~~~~~~~~~~~~~
In file included from ../../.././libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:55:
/usr/local/src/gcc-8.5.0/host-x86_64-pc-linux-gnu/gcc/include-fixed/sys/mount.h:249:6: note: previous definition here
 enum fsconfig_command
      ^~~~~~~~~~~~~~~~
In file included from /usr/include/linux/fs.h:19,
                 from ../../.././libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:68:
/usr/include/linux/mount.h:130:8: error: redefinition of ‘struct mount_attr’
 struct mount_attr {
        ^~~~~~~~~~
In file included from ../../.././libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:55:
/usr/local/src/gcc-8.5.0/host-x86_64-pc-linux-gnu/gcc/include-fixed/sys/mount.h:219:8: note: previous definition of ‘struct mount_attr’
 struct mount_attr
        ^~~~~~~~~~

which is weird, but perhaps my fault for trying to force the library version. Anyway - how can I GCC 8.5.0 to actually build on my machine?

Note:

  • The configuration is: ./configure --disable-bootstrap --enable-languages=c,c++.
  • Any additional information will be provided per request.
12
  • 1
    There might be a difference between Devuan and Debian here — the build works fine for me on Debian 13. Commented Dec 24, 2023 at 14:12
  • @StephenKitt : Fair comment, but it might also be something on my specific system (e.g. since I dist-upgraded from chimaera to daedalus to excalibur or for another reason) rather than a Debian-vs-Devuan difference. Commented Dec 24, 2023 at 15:03
  • Yes, it could be (I can’t think of a difference between Devuan and Debian which would produce this result). The same procedure works fine for me on Debian 11 and 12 too. You could try building without libstdc++ (--disable-libstdcxx). Commented Dec 24, 2023 at 15:17
  • @StephenKitt: I'll try it, just to see what kind of errors I'm getting; but I do want libstdcxx . Commented Dec 24, 2023 at 19:42
  • 1
    Then consider at least using the tools from build-essential in your repo and the package manager agnostic documentation in a changeroot, so you minimize risk to your system. Commented Jan 26, 2024 at 18:57

1 Answer 1

0

The solution involves several steps:

  • Install apt packages for the static 64-bit and 32-bit version of the GCC standard C++ library: libstdc++-dev and lib32stdc++-dev
  • Configure the GCC repository so as not to build the sanitizer library: Add --disable-libsanitizer argument for the configure command.

That should do the trick. Note that, over time and with newer versions of Debian, more things might break than you can hope to fix or get around.

Relevant GCC "bug" pages:

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.