spotifyd icon indicating copy to clipboard operation
spotifyd copied to clipboard

Provided binaries do not work on systems with musl libc

Open finnoleary opened this issue 5 years ago • 6 comments

Description When attempting to run built binaries on musl libc systems, it errors out with "No such file or directory". This is because of an error with the expectations of the dynamic loader when the binary is compiled under GNU libc systems. On musl libc systems it is at a different location. This error is from the kernel, which attempts to load the ELF file based on the dynamic loader set in the binary, which does not exist on pure musl libc systems, such as the Alpine Linux I am running.

Installing the gcompat package does not work in this case either, this is because a symbol that is expected to be in the system does not exist. That is in the third log attached.

To Reproduce

  1. Run a musl libc system
  2. Attempt to run the spotifyd binary from the spotifyd-linux-full.tar.gz package
  3. See either "/bin/mksh: ./spotifyd: No such file or directory", or "Error relocating /home/alx/spotifyd: __res_init: symbol not found" if gcompat is installed.

Expected behavior Spotifyd should run normally.

Logs

Click to show logs
17:31 alx$ ./spotifyd --help
/bin/mksh: ./spotifyd: No such file or directory
17:31 alx$ file spotifyd
spotifyd: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=390a4e2257311a539b75aad70dfc68a97ef05707, with debug_info, not stripped
17:32 alx$ ls -l spotifyd
-rwxr-xr-x 1 alx alx 18349168 Jan 24  2020 spotifyd
17:32 alx$ ./spotifyd --verbose 
/bin/mksh: ./spotifyd: No such file or directory

As you can see the interpreter is interpreter /lib64/ld-linux-x86-64.so.2, this directory does not exist on my system. Where the default is /lib/ for 64 bit. In addition, the ld-linux-x86-64.so.2 binary does not exist on my system, as the loader is ld-musl-x86_64.so.1:

17:35 alx$ ls /lib64/     
ls: cannot access '/lib64/': No such file or directory
17:36 alx$ ls /lib/ld-musl-x86_64.so.1                                                                                                                                              
/lib/ld-musl-x86_64.so.1
17:36 alx$ 

When the package gcompat, which provides /lib64/ld-linux-x86-64.so.2, is installed, you instead get the following error:

17:40 alx$ sudo apk add gcompat
(1/2) Installing libucontext (0.11-r0)
(2/2) Installing gcompat (0.9.0-r2)
OK: 9834 MiB in 2012 packages
17:41 alx$ ./spotifyd --verbose                                                                                                                                                     
Error relocating /home/alx/spotifyd: __res_init: symbol not found

Compilation flags

  • N/A

Versions (please complete the following information):

  • OS: Alpine Linux Edge
  • Spotifyd: Release 0.2.24 (latest release)
  • cargo: N/A

Additional context Suggested resolution: Add a musl libc linux distribution to the list of build systems.

finnoleary avatar Sep 10 '20 16:09 finnoleary

Ye, we'd have to add it to CD. There was one earlier on but I am not sure why it got removed.

mainrs avatar Sep 10 '20 17:09 mainrs

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 13 '21 14:01 stale[bot]

Requesting this to be opened again given that there are still no builds for musl systems

finnoleary avatar Mar 23 '21 02:03 finnoleary

Pleease add builds for Alpine, I bought Dell Wyse thinclient with only 8gb MMC and want it to run only apline and spotifyd

aleksasiriski avatar May 05 '23 11:05 aleksasiriski

@aleksasiriski I actually thought about this a few days ago when fighting with cross compiling for glibc. So when I have the time, I'll try to look into this.

eladyn avatar May 05 '23 14:05 eladyn

Currently I'm using this on Alpine

EDIT: I tried but failed to setup alsa/pipewire with OpenRC, I've reverted back to minimal debian install

EDIT 2: Debian and Rocky don't want to install on Dell Wyse 3040, going back to ALSA on Alpine, I found this and this guide for ALSA.

aleksasiriski avatar May 05 '23 15:05 aleksasiriski