_GNU_SOURCE and __USE_GNU

_GNU_SOURCE is the only one you should ever define yourself. __USE_GNU is defined internally through a mechanism in features.h (which is included by all other glibc headers) when _GNU_SOURCE is defined, and possibly under other conditions. Defining or undefining __USE_GNU yourself will badly break the glibc headers.

How to upgrade glibc on Debian?

I was able to install libc6 2.17 in Debian Wheezy by editing the recommendations in perror’s answer: IMPORTANT You need to exit out of your display manager by pressing CTRL–ALT–F1. Then you can stop x (slim) with sudo /etc/init.d/slim stop (replace slim with mdm or lightdm or whatever) Add the following line to the file … Read more

Is this possible to customize printf?

Sorry, but some answers are incorrect on Linux with Glibc On Linux with a GNU Glibc, you can customize printf: you would call register_printf_function to e.g. define the meaning of %Y in your printf format strings. However, this behavior is Glibc specific, and might even become obsolete… I’m not sure I would recommend this approach! … Read more

Compiling with -static-libgcc -static-libstdc++ still results in dynamic dependency on libc.so

GNU libc is not designed to be statically linked. Important functions, e.g. gethostbyname and iconv, will malfunction or not work at all in a static binary. Arguably even worse, under some conditions a static binary will attempt to dynamically open and use libc.so.6, even though the whole point of static linkage is to avoid such … Read more

Is there a best practice on setting up glibc on docker alpine linux base image?

Yes there is, I’ve used a custom built glibc to install a JRE on it. You can find it here You can use wget or curl to get the code and apk to install them UPDATED commands see comments below apk –no-cache add ca-certificates wget wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk apk add glibc-2.28-r0.apk … Read more

tech