Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libatomic.so.1 needed in /runtime for RISC-V #141

Open
cpswan opened this issue Mar 31, 2023 · 2 comments
Open

libatomic.so.1 needed in /runtime for RISC-V #141

cpswan opened this issue Mar 31, 2023 · 2 comments

Comments

@cpswan
Copy link
Contributor

cpswan commented Mar 31, 2023

Whilst testing container images with AOT binaries created from build images based on #140 I found that they wouldn't run:

/myaotbinaryname: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory

This can be remedied by copying /usr/lib/riscv64-linux-gnu/libatomic.so.1 into /runtime so it's available in the container.

I'm not entirely sure that this is a RISC-V specific thing, but given that many more people are likely to be testing Dart 3 betas on other platforms it's a strong possibility.

docker run atsigncompany/dartshowplatform:GHA_634 provides an example of a container without libatomic.so.1:

Unable to find image 'atsigncompany/dartshowplatform:GHA_634' locally
GHA_634: Pulling from atsigncompany/dartshowplatform
Digest: sha256:b85c81c69810999812baa6cc3e9ba32375d983bc4b5a9b27c4b15122093b5e6a
Status: Downloaded newer image for atsigncompany/dartshowplatform:GHA_634
/app/dartshowplatform: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory

Whilst docker run atsigncompany/dartshowplatform:GHA_635 provides an example of a container with libatomic.so.1 in the linux/riscv64 image:

Unable to find image 'atsigncompany/dartshowplatform:GHA_635' locally
GHA_635: Pulling from atsigncompany/dartshowplatform
Digest: sha256:a3bb9afd99a2b981ac29fd8d4dea21d1d6a03f1cd03b3dfd9e36adf864b6e24c
Status: Downloaded newer image for atsigncompany/dartshowplatform:GHA_635
3.0.0-290.3.beta (beta) (Tue Mar 21 16:51:50 2023 +0000) on "linux_riscv64"

Source for the examples above is at https://github.com/atsign-company/at_dockerfiles

@cpswan
Copy link
Contributor Author

cpswan commented Aug 30, 2023

It seems that libatomic.so.1 has been removed from the debian:unstable image for linux/riscv64 but it's still needed by dart compile exe (testing with 3.2.0-42.1.beta).

To deal with this I've modified the Dockerfile to install libatomic1:

RUN set -eux; \
    apt-get update; \
    apt-get install -y --no-install-recommends \
        ca-certificates \
        curl \
        dnsutils \
        git \
        libatomic1 \
        openssh-client \
        unzip \
    ; \
    rm -rf /var/lib/apt/lists/*

and then added the library to the list that gets copied into runtime:

        riscv64) \
            TRIPLET="riscv64-linux-gnu" ; \
            FILES="/lib/ld-linux-riscv64-lp64d.so.1 \
                /lib/riscv64-linux-gnu/ld-linux-riscv64-lp64d.so.1 \
                /usr/lib/riscv64-linux-gnu/libatomic.so.1" ;; \

@cpswan
Copy link
Contributor Author

cpswan commented Sep 9, 2024

Seems this isn't needed for Ubuntu 24.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant