Flatpak-builder: stuck on "ld: cannot find -lsupc++: No such file or directory"

I’m trying to flatpak a Rust application that uses fltk-rs.
I successfully managed to add the missing libpangoxft-1.0 by rebuilding libpango with the appropriate features.
But now I’m stuck on the missing libsupc++, the fltk build seems to need this library and I have no idea where to get it or how to add it.

The project: GitHub - dheijl/swyh-rs: Stream What You Hear written in rust, inspired by SWYH.
The flatpak build script: swyh-rs/deploy/flatpak/build.sh at master · dheijl/swyh-rs · GitHub
The flatpak manifest: swyh-rs/deploy/flatpak/com.github.dheijl.swyh-rs.json at master · dheijl/swyh-rs · GitHub
The build log: swyh-rs/deploy/flatpak/build.log at master · dheijl/swyh-rs · GitHub

Any help is greatly appreciated…

I’m running into the same issues with fltk-rs and my understanding is that gcc static libraries need to be built.

  • I don’t know if there’s another way to get gcc static libraries into Flatpak other than compiling
  • In order to build gcc to build you need mpc, gmp and mpfr
  • You’ll also need the llvm Sdk extension

I believe that a static build of gcc libraries will give you libsupc++.

You can find my current manifest here (not working yet, as gcc cannot find mpc libraries)

1 Like

Thank you very much for sharing this! If I get anywhere I will post it here.

I was able to get further along with a simpler test application and I updated the Flatpak manifest.

  • I disabled temporarily bootstrapping during gcc compilation (build times too long)
  • I updated gcc configuration flags, so that it could find libraries such as mpc

While building fltk-rs, I now see different linkage errors against libsupc++, CFLAGS don’t work so far. It looks like something needs to be recompiled with -fPIE.

  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: /usr/lib/gcc/x86_64-unknown-linux-gnu/14.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /app/lib64/libsupc++.a(class_type_info.o): relocation R_X86_64_32S against symbol `_ZTVN10__cxxabiv117__class_type_infoE' can not be used when making a PIE object; recompile with -fPIE
          /usr/lib/gcc/x86_64-unknown-linux-gnu/14.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: failed to set dynamic section sizes: bad value
          collect2: error: ld returned 1 exit status

You can find my new Flatpak manifest here.

I was able finally able to compile the project with flatpak, the build is still failing in my “test project” though because of missing assets (Desktop file and other stuff, but that’s easy to fix).

...
2025-04-29T14:19:26.3602619Z warning: `/run/build/entrusted/cargo/config` is deprecated in favor of `config.toml`
2025-04-29T14:19:26.3603885Z note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
2025-04-29T14:19:26.4244744Z    Compiling shlex v1.3.0
2025-04-29T14:19:26.4245214Z    Compiling cmk v0.1.2
2025-04-29T14:19:26.4245617Z    Compiling crossbeam-utils v0.8.21
2025-04-29T14:19:26.4246157Z    Compiling paste v1.0.15
2025-04-29T14:19:26.5442719Z    Compiling cc v1.2.20
2025-04-29T14:19:26.6003160Z    Compiling ttf-parser v0.25.1
2025-04-29T14:19:27.1522489Z    Compiling crossbeam-channel v0.5.15
2025-04-29T14:19:27.2079672Z    Compiling once_cell v1.21.3
2025-04-29T14:19:27.3632922Z    Compiling cmake v0.1.54
2025-04-29T14:19:27.6334517Z    Compiling bitflags v2.9.0
2025-04-29T14:19:27.8439823Z    Compiling fltk-sys v1.5.6
2025-04-29T14:20:18.7790832Z    Compiling fltk v1.5.6
2025-04-29T14:20:26.9916989Z    Compiling entrusted v0.1.0 (/run/build/entrusted/app)
2025-04-29T14:20:27.6919652Z     Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 01s
2025-04-29T14:20:27.6949456Z Running: install -Dm644 -t /app/share/metainfo/com.rimerosolutions.Entrusted.metainfo.xml flatpak/com.rimerosolutions.Entrusted.metainfo.xml
2025-04-29T14:20:27.7575272Z Running: install -Dm644 -t /app/share/applications/com.rimerosolutions.Entrusted.desktop assets/com.rimerosolutions.Entrusted.desktop
2025-04-29T14:20:27.8206515Z install: cannot stat 'assets/com.rimerosolutions.Entrusted.desktop': No such file or directory
2025-04-29T14:20:27.8214427Z Error: module entrusted: Child process exited with code 1
2025-04-29T14:20:27.8466718Z ##[error]Process completed with exit code 1.
2025-04-29T14:20:27.8574655Z Post job cleanup.
2025-04-29T14:20:27.9567106Z [command]/usr/bin/git version
2025-04-29T14:20:27.9604638Z git version 2.49.0
2025-04-29T14:20:27.9649173Z Temporarily overriding HOME='/home/runner/work/_temp/3ed80f47-2cad-4135-a005-d5413a0cb254' before making global git config changes
2025-04-29T14:20:27.9650450Z Adding repository directory to the temporary git global config as a safe directory
2025-04-29T14:20:27.9655748Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/fltk-rs-flatpak/fltk-rs-flatpak
2025-04-29T14:20:27.9693532Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2025-04-29T14:20:27.9727958Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2025-04-29T14:20:27.9955201Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2025-04-29T14:20:27.9977396Z http.https://github.com/.extraheader
2025-04-29T14:20:27.9990214Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2025-04-29T14:20:28.0020808Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2025-04-29T14:20:28.0357973Z Cleaning up orphan processes

I’ll fix that assets part just to have a fully working basic example, but now I’m confident that I can integrate with my real project that also uses couple of other C/C++ libraries.

Here’s the updated manifest

Thanks a million! I’ll try to incorporate this in my manifest.

This topic was automatically closed after 3 days. New replies are no longer allowed.