Spotifyd / spotifyd

A spotify daemon
https://spotifyd.rs
GNU General Public License v3.0
9.88k stars 453 forks source link

Provided binaries do not work on systems with musl libc #674

Open finnoleary opened 4 years ago

finnoleary commented 4 years ago

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

Versions (please complete the following information):

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

mainrs commented 4 years ago

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

stale[bot] commented 3 years ago

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.

finnoleary commented 3 years ago

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

aleksasiriski commented 1 year ago

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

eladyn commented 1 year ago

@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.

aleksasiriski commented 1 year ago

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.