[GH-ISSUE #401] docker-build-pi-armv6hf.sh fails with dpkg-deb error #258

Closed
opened 2026-02-27 19:29:41 +03:00 by kerem · 10 comments
Owner

Originally created by @pejobo on GitHub (Nov 17, 2019).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/401

I tried the described cross-build method for raspberry and it fails for me with dpkg-deb: error: 'libasound2_1.0.25-4_armhf.deb' is not a debian format archive

Complete log:

>librespot$ docker -D run -v /tmp/librespot-build:/build librespot-cross contrib/docker-build-pi-armv6hf.sh
+ ALSA_VER=1.0.25-4
+ DEPS=("http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2_${ALSA_VER}_armhf.deb" "http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2-dev_${ALSA_VER}_armhf.deb")
+ SYSROOT=/pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot
+ GCC=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
+ GCC_SYSROOT=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot
+ export PATH=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/:/root/.cargo/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ PATH=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/:/root/.cargo/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ export TARGET_CC=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc
+ TARGET_CC=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc
+ echo -e '#!/bin/bash' '\n/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc --sysroot /pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot "$@"'
+ chmod +x /pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot
+ for path in "${DEPS[@]}"
+ curl -OL http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2_1.0.25-4_armhf.deb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   289  100   289    0     0   1742      0 --:--:-- --:--:-- --:--:--  1751
++ basename http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2_1.0.25-4_armhf.deb
+ dpkg -x libasound2_1.0.25-4_armhf.deb /pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot
dpkg-deb: error: 'libasound2_1.0.25-4_armhf.deb' is not a debian format archive
DEBU[0001] [hijack] End of stdout  

I then used the described generic armfh method, which worked fine and is now running without flaws on my raspberry.

Originally created by @pejobo on GitHub (Nov 17, 2019). Original GitHub issue: https://github.com/librespot-org/librespot/issues/401 I tried the described cross-build method for raspberry and it fails for me with `dpkg-deb: error: 'libasound2_1.0.25-4_armhf.deb' is not a debian format archive` Complete log: ``` >librespot$ docker -D run -v /tmp/librespot-build:/build librespot-cross contrib/docker-build-pi-armv6hf.sh + ALSA_VER=1.0.25-4 + DEPS=("http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2_${ALSA_VER}_armhf.deb" "http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2-dev_${ALSA_VER}_armhf.deb") + SYSROOT=/pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot + GCC=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin + GCC_SYSROOT=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot + export PATH=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/:/root/.cargo/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + PATH=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/:/root/.cargo/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + export TARGET_CC=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc + TARGET_CC=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc + echo -e '#!/bin/bash' '\n/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc --sysroot /pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot "$@"' + chmod +x /pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot + for path in "${DEPS[@]}" + curl -OL http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2_1.0.25-4_armhf.deb % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 289 100 289 0 0 1742 0 --:--:-- --:--:-- --:--:-- 1751 ++ basename http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2_1.0.25-4_armhf.deb + dpkg -x libasound2_1.0.25-4_armhf.deb /pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot dpkg-deb: error: 'libasound2_1.0.25-4_armhf.deb' is not a debian format archive DEBU[0001] [hijack] End of stdout ``` I then used the described generic armfh method, which worked fine and is now running without flaws on my raspberry.
kerem 2026-02-27 19:29:41 +03:00
Author
Owner

@praul commented on GitHub (Dec 7, 2019):

You could change the alsa version in the script to, for example
1.1.3-5
and try again.
I think, you have to rebuild the docker image, though

<!-- gh-comment-id:562828890 --> @praul commented on GitHub (Dec 7, 2019): You could change the alsa version in the script to, for example 1.1.3-5 and try again. I think, you have to rebuild the docker image, though
Author
Owner

@john-a-harris commented on GitHub (Dec 13, 2019):

I've tried this (and rebuilt the docker image). I am now getting a linking error:

= note: /pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: ld-linux-armhf.so.3, needed by /usr/lib/arm-linux-gnueabihf/libasound.so, not found (try using -rpath or -rpath-link)
         /usr/lib/arm-linux-gnueabihf/libasound.so: undefined reference to `__poll_chk@GLIBC_2.16'
         collect2: error: ld returned 1 exit status
         

error: aborting due to previous error

error: could not compile `librespot`.

I can add more of the error output if it's useful. What might I have done wrong here?

<!-- gh-comment-id:565380417 --> @john-a-harris commented on GitHub (Dec 13, 2019): I've tried this (and rebuilt the docker image). I am now getting a linking error: ``` = note: /pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: ld-linux-armhf.so.3, needed by /usr/lib/arm-linux-gnueabihf/libasound.so, not found (try using -rpath or -rpath-link) /usr/lib/arm-linux-gnueabihf/libasound.so: undefined reference to `__poll_chk@GLIBC_2.16' collect2: error: ld returned 1 exit status error: aborting due to previous error error: could not compile `librespot`. ``` I can add more of the error output if it's useful. What might I have done wrong here?
Author
Owner

@praul commented on GitHub (Dec 14, 2019):

I could not successfully build either.
Also, I cannot get armhf-build without script to work, see: https://github.com/librespot-org/librespot/issues/408

I have switched to librespot-java now

<!-- gh-comment-id:565703528 --> @praul commented on GitHub (Dec 14, 2019): I could not successfully build either. Also, I cannot get armhf-build without script to work, see: https://github.com/librespot-org/librespot/issues/408 I have switched to librespot-java now
Author
Owner

@pejobo commented on GitHub (Dec 14, 2019):

@praul No need to switch to the java version, the "generic armfh" build is working and the produced binary is running stable on my raspberry.

<!-- gh-comment-id:565718847 --> @pejobo commented on GitHub (Dec 14, 2019): @praul No need to switch to the java version, the "generic armfh" build is working and the produced binary is running stable on my raspberry.
Author
Owner

@ashthespy commented on GitHub (May 11, 2020):

@pejobo Marking this as closed, feel free to jump back in if you are still having issues..

<!-- gh-comment-id:626922863 --> @ashthespy commented on GitHub (May 11, 2020): @pejobo Marking this as closed, feel free to jump back in if you are still having issues..
Author
Owner

@rlopzc commented on GitHub (Sep 4, 2020):

Hello. I'm having issues, I already changed the ALSA_VER to the latest one and also the recommended in this post: 1.1.3-5. Do you know if this cross compilation is still working?

I get the error:

          /usr/lib/arm-linux-gnueabihf/libasound.so: undefined reference to `__poll_chk@GLIBC_2.16'
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: could not compile `librespot`.

To learn more, run the command again with --verbose.```
<!-- gh-comment-id:687283962 --> @rlopzc commented on GitHub (Sep 4, 2020): Hello. I'm having issues, I already changed the ALSA_VER to the latest one and also the recommended in this post: `1.1.3-5`. Do you know if this cross compilation is still working? I get the error: ``` = note: /pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: ld-linux-armhf.so.3, needed by /usr/lib/arm-linux-gnueabihf/libasound.so, not found (try using -rpath or -rpath-link) /usr/lib/arm-linux-gnueabihf/libasound.so: undefined reference to `__poll_chk@GLIBC_2.16' collect2: error: ld returned 1 exit status error: aborting due to previous error error: could not compile `librespot`. To learn more, run the command again with --verbose.```
Author
Owner

@ashthespy commented on GitHub (Sep 4, 2020):

You might have to match the right ALSA_VER for the target GLIBC version (the version in stretch maybe?)
I can look up my build scripts later this evening..

<!-- gh-comment-id:687285559 --> @ashthespy commented on GitHub (Sep 4, 2020): You might have to match the right `ALSA_VER` for the target `GLIBC` version (the version in [`stretch`](https://github.com/librespot-org/librespot/blob/dev/contrib/Dockerfile#L16) maybe?) I can look up my build scripts later this evening..
Author
Owner

@rlopzc commented on GitHub (Sep 4, 2020):

@ashthespy do you mean change stretch to buster?

Edit
I changed it FROM debian:buster and got:

  = note: /pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: ld-linux-armhf.so.3, needed by /usr/lib/arm-linux-gnueabihf/libasound.so, not found (try using -rpath or -rpath-link)
          /usr/lib/arm-linux-gnueabihf/libasound.so: undefined reference to `__poll_chk@GLIBC_2.16'
          /usr/lib/arm-linux-gnueabihf/libasound.so: undefined reference to `fcntl@GLIBC_2.28'
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: could not compile `librespot`.

To learn more, run the command again with --verbose.
<!-- gh-comment-id:687289452 --> @rlopzc commented on GitHub (Sep 4, 2020): @ashthespy do you mean change `stretch` to `buster`? **Edit** I changed it `FROM debian:buster` and got: ``` = note: /pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: warning: ld-linux-armhf.so.3, needed by /usr/lib/arm-linux-gnueabihf/libasound.so, not found (try using -rpath or -rpath-link) /usr/lib/arm-linux-gnueabihf/libasound.so: undefined reference to `__poll_chk@GLIBC_2.16' /usr/lib/arm-linux-gnueabihf/libasound.so: undefined reference to `fcntl@GLIBC_2.28' collect2: error: ld returned 1 exit status error: aborting due to previous error error: could not compile `librespot`. To learn more, run the command again with --verbose. ```
Author
Owner

@ashthespy commented on GitHub (Sep 5, 2020):

@romariolopezc No I meant you need to find the right version of the ALSA lib that matches the cross-compilers GLIBC version..
You might have to poke around the sysroot and check -- something like

root@6e72365c7281:/pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot/lib# ./libc.so.6
GNU C Library stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.7.1 20120402 (prerelease).
Compiled on a Linux 3.1.9 system on 2012-08-09.
Available extensions:
        crypt add-on version 2.1 by Michael Glad and others
        Native POSIX Threads Library by Ulrich Drepper et al
        Support for some architectures added on, not maintained in glibc core.
        BIND-8.2.3-T5B
libc ABIs: UNIQUE
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>

Looking through my stuff, I see I did try some other things (github.com/ashthespy/librespot@64f6644224 (diff-43bcfbb35e))

Big disclaimer - I may be completely wrong though, but this is what I vaguely recall while trying to get things working for armv6 (pi) target for a while, before ultimately going down a different path with a different toolchain with armel architecture instead.

<!-- gh-comment-id:687637888 --> @ashthespy commented on GitHub (Sep 5, 2020): @romariolopezc No I meant you need to find the right version of the ALSA lib that matches the cross-compilers GLIBC version.. You might have to poke around the `sysroot` and check -- something like ```bash root@6e72365c7281:/pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot/lib# ./libc.so.6 GNU C Library stable release version 2.13, by Roland McGrath et al. Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiled by GNU CC version 4.7.1 20120402 (prerelease). Compiled on a Linux 3.1.9 system on 2012-08-09. Available extensions: crypt add-on version 2.1 by Michael Glad and others Native POSIX Threads Library by Ulrich Drepper et al Support for some architectures added on, not maintained in glibc core. BIND-8.2.3-T5B libc ABIs: UNIQUE For bug reporting instructions, please see: <http://www.gnu.org/software/libc/bugs.html> ``` Looking through my stuff, I see I did try some other things (https://github.com/ashthespy/librespot/commit/64f6644224859cb1e8a8c09cc071c001724b1d3a#diff-43bcfbb35e40d0de143338804c85b408) Big disclaimer - I may be completely wrong though, but this is what I vaguely recall while trying to get things working for armv6 (pi) target for a while, before ultimately going down a different path with a different toolchain with `armel` architecture instead.
Author
Owner

@felixstorm commented on GitHub (Aug 12, 2022):

I know this is very old stuff and just in case anybody will be searching for it: I also had the problem that contrib/docker-build-pi-armv6hf.sh failed for me and was able to fix it.

The new script works for both the old and the new api as of now and can be found here: https://github.com/librespot-org/librespot/pull/1044

<!-- gh-comment-id:1213272871 --> @felixstorm commented on GitHub (Aug 12, 2022): I know this is very old stuff and just in case anybody will be searching for it: I also had the problem that `contrib/docker-build-pi-armv6hf.sh` failed for me and was able to fix it. The new script works for both the old and the new api as of now and can be found here: https://github.com/librespot-org/librespot/pull/1044
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#258
No description provided.