public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* test old versions of glibc
@ 2022-03-07 12:12 Paul Zimmermann
  2022-03-07 12:53 ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Zimmermann @ 2022-03-07 12:12 UTC (permalink / raw)
  To: libc-alpha

       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)?

Best regards,
Paul

$ cat test_pow.c
#include <stdio.h>
#include <math.h>
int main()
{
  double x = 0x1.ffeffa651a733p-1;
  double y = 0x1.5d318bcd8f1f1p+22;
  double z = pow (x, y);
  printf ("z=%a\n", z);
  return 0;
}



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: test old versions of glibc
  2022-03-07 12:12 test old versions of glibc Paul Zimmermann
@ 2022-03-07 12:53 ` Florian Weimer
  2022-03-08 10:09   ` Paul Zimmermann
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2022-03-07 12:53 UTC (permalink / raw)
  To: Paul Zimmermann; +Cc: libc-alpha

* 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: test old versions of glibc
  2022-03-07 12:53 ` Florian Weimer
@ 2022-03-08 10:09   ` Paul Zimmermann
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Zimmermann @ 2022-03-08 10:09 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

       Dear Florian,

> As a quick hack, adding
> 
>   asm (".symver pow, pow@GLIBC_2.2.5");
> 
> will work.

thank you, this works perfectly!

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

this would be most welcome.

Paul

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-08 10:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07 12:12 test old versions of glibc Paul Zimmermann
2022-03-07 12:53 ` Florian Weimer
2022-03-08 10:09   ` Paul Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).