Notes on updating GCC inside AppImage
Open, Needs TriagePublic

Description

Since we are considering moving from Vc library to something more modern, like xsimd, std-simd or eve, supporting AppImages becomes a problem, because we are basically limited to GCC5, which was standard in Ubuntu 16.04.

The problem

If we update GCC to any newer version, then we also have to update the version of libstdc++ and bundle it into AppImage. This solution basically works, except for the systems that have newer version of libstdc++ installed. It problem unwinds in the following way:

  1. Krita loads embedded libstdc++
  2. Krita loads radeon openGL driver, which is written in C++ and built with the system's libstdc++, which is newer
  3. The driver doesn't find the needed versioned symbols.
  4. Krita crashes.

Solutions

  1. [Failed] I tried to build GCC 11.2 with the older libstdc++, which didn't work. It seems like its build system isn't even tested for this usecase, it fails at the configuration stage. Even if we fix the configuration in the build system, we still won't be able to use ASAN, because it will be explicitly disabled. The good thing is that when I enable libstdc++ GCC 11.2 builds fine in our AppImage environment.
  1. We can decide to "always ship the latest version of libstdc++" and hope noone has some crazy distribution that ships libstdc++ newer than ours.
  1. We can hack AppImage's trampoline app to dynamically choose, what libstdc++ to use, ours of the system one, based on their versions. This approach looks a bit complicated, but it might work.