test old versions of glibc

Florian Weimer fweimer@redhat.com
Mon Mar 7 12:53:42 GMT 2022


* Paul Zimmermann:

>        Hi,
>
> I have an application that I want to test with old versions of glibc.
> The following usually works:
>
> $ gcc -fno-builtin test_pow.c -lm
> $ /localdisk/zimmerma/glibc-2.29/build/testrun.sh ./a.out
> z=0x1.fffeb4d85aa15p-1010
>
> However with glibc-2.28 it fails, because the binary contains a call to
> pow@GLIBC_2.29:
>
> $ nm a.out | grep pow
>                  U pow@GLIBC_2.29
>
> $ /localdisk/zimmerma/glibc-2.28/build/testrun.sh ./a.out
> ./a.out: /localdisk/zimmerma/glibc-2.28/build/math/libm.so.6: version `GLIBC_2.29' not found (required by ./a.out)
>
> How can I disable the check for GLIBC_2.29 (this is for my particular
> application, and I know what I'm doing)?

As a quick hack, adding

  asm (".symver pow, pow@GLIBC_2.2.5");

will work.

We should probably put gcc and g++ wrappers in the build tree alongside
with testrun.sh, to simplify building against the uninstalled glibc.

Thanks,
Florian



More information about the Libc-alpha mailing list