Use glibc higher than 2.35 in core24

Hi, the snap I’m making needs glibc 2.39 or higher, but even on core 24 with libc6 in the stage-packages, the snap installs glibc 2.35.

I tried to install glibc-source, as it installs glibc 2.40, but ldd --version still outputs 2.35. How can I force the snap to use glibc 2.40 ?

Here is the snapcraft.yaml :

name: lrcget
base: core22
version: '0.1'
summary: Téléchargez les paroles de vos musiques préférées.
description: |
  Utilitaire pour télécharger en masse les paroles synchronisées LRC pour votre bibliothèque de musiques hors-ligne.
  LRCGET scannera l'ensemble des fichiers d'un répertoire donné, trouvera vos musiques, et téléchargera les paroles sous la forme d'un fichier LRC ayant le même nom que celui du fichier musical et stocké au même endroit.
  LRCGET est le client officiel du service LRCLIB.
grade: devel
confinement: devmode

apps:
  lrcget:
    extensions: [gnome]
    command: bin/LRCGET
    plugs:
      - desktop
      - audio-playback
      - x11
      - wayland
      - opengl

layout:
  /usr/share/alsa:
    bind: $SNAP/usr/share/alsa
  /usr/lib/x86_64-linux-gnu/oss4-libsalsa:
    bind: $SNAP/usr/lib/x86_64-linux-gnu/oss4-libsalsa
  /usr/lib/x86_64-linux-gnu/libproxy:
    bind: $SNAP/usr/lib/x86_64-linux-gnu/libproxy

parts:
  LRCGET:
    plugin: dump
    source: src-tauri/target/release/
    source-type: local
    stage-packages:
      - libasound2
      - libasound2-dev
      - libasound2-plugins
      - alsa-utils
      - liboss4-salsa2
      - libwebkit2gtk-4.1-0
      - libwebkitgtk-6.0-4
      - libproxy1v5
      - glibc-source
    organize:
      LRCGET: bin/LRCGET

Thanks in advance.

Hi,

libc is included in the base snap. If you switch your base to core24, you will get 2.39 which is included in Ubuntu 24.04 release. If you still need a newer version you’ll need to build it yourself and then ensure that the ELF interpreter which loads your binaries is set up to find your build of libc.

Though I had a quick look at LRCGET. If you are simply repacking upstream releases, the binaries they build seem to require glibc 2.39 which is already included in core24. You can probably just build it under snapcraft in which case it should link with whatever is provided in the appropriate base for the build (in this case Ubuntu 24.04 for core24 snaps).