Skip to content

Instantly share code, notes, and snippets.

@simendsjo
Created September 9, 2022 18:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save simendsjo/1504e4fe1229acf3549435c28bf2326e to your computer and use it in GitHub Desktop.
$ echo $LIBRARY_PATH
/home/simendsjo/.guix-profile/lib

I have the fontconfig package installed, which gives me the library too

$ ls ~/.guix-profile/lib/libfontconfig.so.1
/home/simendsjo/.guix-profile/lib/libfontconfig.so.1

But notice that libfontconfig.so.1 isn't found when looking at the library

$ ldd libSkiaSharp.so 
        linux-vdso.so.1 (0x00007fffaede7000)
        libpthread.so.0 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread.so.0 (0x00007f699fa75000)
        libfontconfig.so.1 => not found
        libdl.so.2 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libdl.so.2 (0x00007f699fa70000)
        libm.so.6 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libm.so.6 (0x00007f699eebf000)
        libc.so.6 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6 (0x00007f699ecfd000)
        /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-linux-x86-64.so.2 (0x00007f699fa97000)

If I force libaries to load from ~/.guix-profile/lib, it works.

$ LD_LIBRARY_PATH=$LIBRARY_PATH ldd libSkiaSharp.so
        linux-vdso.so.1 (0x00007fffcd551000)
        libpthread.so.0 => /home/simendsjo/.guix-profile/lib/libpthread.so.0 (0x00007f2fd575e000)
        libfontconfig.so.1 => /home/simendsjo/.guix-profile/lib/libfontconfig.so.1 (0x00007f2fd5713000)
        libdl.so.2 => /home/simendsjo/.guix-profile/lib/libdl.so.2 (0x00007f2fd570e000)
        libm.so.6 => /home/simendsjo/.guix-profile/lib/libm.so.6 (0x00007f2fd4abf000)
        libc.so.6 => /home/simendsjo/.guix-profile/lib/libc.so.6 (0x00007f2fd48fd000)
        /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-linux-x86-64.so.2 (0x00007f2fd5780000)
        libfreetype.so.6 => /home/simendsjo/.guix-profile/lib/libfreetype.so.6 (0x00007f2fd484d000)
        libbz2.so.1.0 => /gnu/store/s3hl12jxz9ybs7nsy7kq7ybzz7qnzmsg-bzip2-1.0.8/lib/libbz2.so.1.0 (0x00007f2fd56f9000)
        libpng16.so.16 => /home/simendsjo/.guix-profile/lib/libpng16.so.16 (0x00007f2fd56c3000)
        libz.so.1 => /home/simendsjo/.guix-profile/lib/libz.so.1 (0x00007f2fd56a4000)
        libexpat.so.1 => /home/simendsjo/.guix-profile/lib/libexpat.so.1 (0x00007f2fd5673000)
        libgcc_s.so.1 => /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libgcc_s.so.1 (0x00007f2fd4833000)

Lots of libraries in my lib folder is provided by gcc-toolchain.

$ ls -lah ~/.guix-profile/lib | grep libc-
libc-2.33.so -> /gnu/store/0dbscs8zq4bdg8vbn9jkdgynjcn3s01p-gcc-toolchain-12.2.0/lib/libc-2.33.so

Pretty sure I'm missing some crucial mental model here. Why isn't libfontconfig.so.1 loaded? Should I patch the library somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment