sgerrand / alpine-pkg-glibc

A glibc compatibility layer package for Alpine Linux
2.05k stars 280 forks source link

support arm #126

Open lp2jx0309 opened 4 years ago

lp2jx0309 commented 4 years ago

hi, @sgerrand ,whether to consider supporting arm?thank you

Rjerk commented 4 years ago

I build for arm64 version for my own usage:

https://github.com/Rjerk/alpine-pkg-glibc/releases/tag/2.30-r0-arm64

tdesaules commented 4 years ago

Hi !

This is for aarch64 right ? need to try to make a second one for the armhf :/

kuwork commented 4 years ago

I build for arm64 version for my own usage:

https://github.com/Rjerk/alpine-pkg-glibc/releases/tag/2.30-r0-arm64

UNTRUSTED signature

how can I fix this problem?

Rjerk commented 4 years ago

UNTRUSTED signature

how can I fix this problem?

apk add --allow-untrusted should work.

--allow-untrusted Install packages with untrusted signature or no signature

kuwork commented 4 years ago

I build for arm64 version for my own usage: https://github.com/Rjerk/alpine-pkg-glibc/releases/tag/2.30-r0-arm64

UNTRUSTED signature

how can I fix this problem?

FROM alpine:3.12

ENV LANG=C.UTF-8

# Here we install GNU libc (aka glibc) and set C.UTF-8 locale as default.

RUN ALPINE_GLIBC_BASE_URL="https://github.com/Rjerk/alpine-pkg-glibc/releases/download" && \
    ALPINE_GLIBC_PACKAGE_VERSION="2.30-r0" && \
    ALPINE_GLIBC_ARCHITECTURES="arm64" && \
    ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
    ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
    ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
    sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
    apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \
    echo \
        "-----BEGIN PUBLIC KEY-----\
        MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApZ2u1KJKUu/fW4A25y9m\
        y70AGEa/J3Wi5ibNVGNn1gT1r0VfgeWd0pUybS4UmcHdiNzxJPgoWQhV2SSW1JYu\
        tOqKZF5QSN6X937PTUpNBjUvLtTQ1ve1fp39uf/lEXPpFpOPL88LKnDBgbh7wkCp\
        m2KzLVGChf83MS0ShL6G9EQIAUxLm99VpgRjwqTQ/KfzGtpke1wqws4au0Ab4qPY\
        KXvMLSPLUp7cfulWvhmZSegr5AdhNw5KNizPqCJT8ZrGvgHypXyiFvvAH5YRtSsc\
        Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\
        1QIDAQAB\
        -----END PUBLIC KEY-----" | sed 's/   */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \
    wget \
        "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION-$ALPINE_GLIBC_ARCHITECTURES/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION-$ALPINE_GLIBC_ARCHITECTURES/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION-$ALPINE_GLIBC_ARCHITECTURES/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
    apk add --no-cache \
        "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
    \
    rm "/etc/apk/keys/sgerrand.rsa.pub" && \
    /usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true && \
    echo "export LANG=$LANG" > /etc/profile.d/locale.sh && \
    \
    apk del glibc-i18n && \
    \
    rm "/root/.wget-hsts" && \
    apk del .build-dependencies && \
    rm \
        "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME"
Rjerk commented 4 years ago
    apk add --no-cache \
        "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \

add --allow-untrusted here I guess

kuwork commented 4 years ago
    apk add --no-cache \
        "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
        "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \

add --allow-untrusted here I guess

Thanks.

CelsoSantos commented 4 years ago

@Rjerk you mean you built your own Docker image? I'm trying to replicate the build of this container on a rpi4 but it's failing with a message like /usr/glibc-compat/sbin/ldconfig: line 4: syntax error: unexpected word *expecting ")") and similar but in relation to /usr/glibc-compat/bin/localedef

How did you manage to build it?

Rjerk commented 4 years ago

@Rjerk you mean you built your own Docker image? I'm trying to replicate the build of this container on a rpi4 but it's failing with a message like /usr/glibc-compat/sbin/ldconfig: line 4: syntax error: unexpected word *expecting ")") and similar but in relation to /usr/glibc-compat/bin/localedef

How did you manage to build it?

It looks like a cross-compiling error.

use file /usr/glibc-compat/bin/localedef to find out the file type. Also check your os arch using uname -a

CelsoSantos commented 4 years ago

Humm, I think you are right, but I don't quite get what's wrong... Isn't this image arm64? Maybe I misunderstood something... .It does run on the pi using docker run, so I don't see what's the issue here..

Alpine, btw, seems like it doesn't have file command

matonb commented 3 years ago

@Rjerk you mean you built your own Docker image? I'm trying to replicate the build of this container on a rpi4 but it's failing with a message like /usr/glibc-compat/sbin/ldconfig: line 4: syntax error: unexpected word *expecting ")") and similar but in relation to /usr/glibc-compat/bin/localedef How did you manage to build it?

It looks like a cross-compiling error.

use file /usr/glibc-compat/bin/localedef to find out the file type. Also check your os arch using uname -a

@Rjerk you're quite right /usr/glibc-compat/bin/localedef is compiled for the wrong architecture:

file /usr/glibc-compat/bin/localedef

/usr/glibc-compat/bin/localedef: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/glibc-compat/lib/ld-linux-x86-64.so.2, BuildID[sha1]=8c89aeed61904b61d0b0cba7c3b3a4efd990ebb0, for GNU/Linux 3.2.0, stripped

I'd be expecting to see ARM aarch64 not x86-64

 # uname -a
Linux 72511c90c9d4 5.4.51-v8+ #1333 SMP PREEMPT Mon Aug 10 16:58:35 BST 2020 aarch64 Linux

Any ideas ?

CelsoSantos commented 3 years ago

This one is working for me: https://github.com/CelsoSantos/docker-glibc-builder

I don't think there's anything too special about it, I think there aren't even any changes, but I use it here to produce an arm64 compatible version... The only thing is that I must build it on a RPi4 (in my case) or a compatible ARM machine

matonb commented 3 years ago

This one is working for me: https://github.com/CelsoSantos/docker-glibc-builder

I don't think there's anything too special about it, I think there aren't even any changes, but I use it here to produce an arm64 compatible version... The only thing is that I must build it on a RPi4 (in my case) or a compatible ARM machine

@CelsoSantos Thanks for the link, I can probably use it but I was looking for an ARM version here as my interest is really in the upstream project https://github.com/AdoptOpenJDK/openjdk-docker

CelsoSantos commented 3 years ago

I agree it would make sense for this project to have it, IMHO. Maybe point the openjdk-docker maintainer to that repo or, better yet, fork your own copy and work based off of that :)

Lauri-Nomme commented 2 years ago

cross building from x86_64 supported in this fork: https://github.com/Lauri-Nomme/alpine-glibc-xb

chadlwilson commented 1 year ago

Seems there were a few attempts all stuck in PRs on the sister project:

adamqqqplay commented 7 months ago

I build for arm64 version for my own usage:

https://github.com/Rjerk/alpine-pkg-glibc/releases/tag/2.30-r0-arm64

@Rjerk Thanks for your contribution, it works for me!

sgerrand commented 2 months ago

I've merged an upstream change which provides 64 bit Arm binaries. I plan to release new versions of this package by the end of this week which will support x86_64 and aarch64 architectures. I'll also incrementally release new versions of the GNU C library to bring it up to date, i.e. to version 2.39.

chadlwilson commented 2 months ago

Oh wow, thanks @sgerrand - great to see some movement here!