Due to @sgerrand's docker-glibc-builder being out of date, 2.42 and above will not build. I'm not interested in fixing this right now (would require forking and updating the container) but I might do it in the future. If you need the latest glibc, fix that container and point to the new container in
build.sh.
This is the GNU C Library as an Alpine Linux
package, so that you may run binaries linked against glibc. This package
uses as a source a custom-built glibc binary, built by
@sgerrand's
docker-glibc-builder.
This is a fork of his
alpine-pkg-glibc, but updated
to the latest glibc version and with new CI. I did this as @sgerrand has
neglected to update the package in his repository for quite a long time now.
Note: I primarily started this project to learn how to use OneDev CI, and as such I am not particularly interested in adding new features to or fixing the Docker build image, or making changes to this repo.
If you have any features or fixes, open an issue or send a PR on OneDev. You may also open an issue via email.
Binary tarball releases are built and made available via OneDev CI build artifacts.
To build your own Alpine package, you first need a built binary tarball. You
can get one from the CI artifacts as mentioned above, or by building it:
# install prerequisites
sudo apk add docker abuild
git clone https://git.sev.monster/sev/alpine-pkg-glibc
cd alpine-pkg-glibc
# first arg is desired glibc version, second is the pkgrel
./build.sh 2.41 0 #builds glibc-bin-2.41-r0.tar.gz
# alternatively, put a pre-built glibc-bin-*.tar.gz in this directory
# use your favorite editor here to ensure the $pkgver and $pkgrel match the
# tarball version; if you don't do this, package creation will fail
vim APKBUILD
# recalculate checksums for the tarball
abuild checksum
# build apk
abuild -rThe tarballs are not intended to be installed directly, but in theory you could
manually extract them to /usr on an Alpine/musl libc system:
tar -C /usr -xzf glibc-bin-*.tar.gzPre-built Alpine packages are available in my
Alpine repo.
Installation instructions are available in the
repo README.
If you are using tools like localedef you will need the glibc-bin and
glibc-i18n packages in addition to the glibc package.
Previously, if you wanted to also install gcompat (previously libc6-compat), which was also a dependency of glibc-bin, you had to:
- Install
gcompatfirst - Remove its
ld-linux-x86-64.soloader from/lib - Install
glibc/glibc-binwith--force-overwrite
This was a cumbersome and error-prone process. To avoid that issue, this
package will overwrite gcompat if it is installed, by setting
replaces=gcompat.
You will need to generate your locale if you would like to use a specific one
for your glibc application. You can do this by installing the glibc-i18n
package and generating a locale using the localedef binary. An example for
en_US.UTF-8 would be:
apk add glibc-bin glibc-i18n
/usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8