Skip to main content
1 of 2
einpoklum
  • 11.1k
  • 23
  • 91
  • 171

How can I build an older GCC version (8.5.0) on a newer Linux distribution (Devuan Excalibur/Debian Trixie)?

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: config --disable-bootstrap --enable-languages=c,c++.
  • Any additional information will be provided per reqest.
einpoklum
  • 11.1k
  • 23
  • 91
  • 171