Message ID | CAFULd4ZQA56M5Z5Q+M3BemY4cC2X7X3yp3V6=OBkOHmLRz8zaQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | [testsuite] : Fix g++.dg/torture/pr86763.C link failure for glibc < 2.17 | expand |
On 08/06/2018 09:10 AM, Uros Bizjak wrote: > 2018-08-06 Uros Bizjak <ubizjak@gmail.com> > > * g++.dg/torture/pr86763.C (dg-additional-options): Add -lrt. > > Tested on CentOS 5.10 and Fedora 28. > > OK for mainline? But what about systems without librt? I'm thinking primarily of the embedded *-elf targets. Jeff
On Mon, Aug 6, 2018 at 5:23 PM, Jeff Law <law@redhat.com> wrote: > On 08/06/2018 09:10 AM, Uros Bizjak wrote: >> 2018-08-06 Uros Bizjak <ubizjak@gmail.com> >> >> * g++.dg/torture/pr86763.C (dg-additional-options): Add -lrt. >> >> Tested on CentOS 5.10 and Fedora 28. >> >> OK for mainline? > But what about systems without librt? I'm thinking primarily of the > embedded *-elf targets. Perhaps the following patch is better: --cut here-- Index: g++.dg/torture/pr86763.C =================================================================== --- g++.dg/torture/pr86763.C (revision 263317) +++ g++.dg/torture/pr86763.C (working copy) @@ -1,5 +1,6 @@ // { dg-do run } // { dg-additional-options "-fschedule-insns2 -fstrict-aliasing" } +// { dg-additional-options "-lrt" { target *-*-linux-gnu } } #include <cstdint> #include <cassert> --cut here-- Uros.
On 08/06/2018 09:33 AM, Uros Bizjak wrote: > On Mon, Aug 6, 2018 at 5:23 PM, Jeff Law <law@redhat.com> wrote: >> On 08/06/2018 09:10 AM, Uros Bizjak wrote: >>> 2018-08-06 Uros Bizjak <ubizjak@gmail.com> >>> >>> * g++.dg/torture/pr86763.C (dg-additional-options): Add -lrt. >>> >>> Tested on CentOS 5.10 and Fedora 28. >>> >>> OK for mainline? >> But what about systems without librt? I'm thinking primarily of the >> embedded *-elf targets. > > Perhaps the following patch is better: > > --cut here-- > Index: g++.dg/torture/pr86763.C > =================================================================== > --- g++.dg/torture/pr86763.C (revision 263317) > +++ g++.dg/torture/pr86763.C (working copy) > @@ -1,5 +1,6 @@ > // { dg-do run } > // { dg-additional-options "-fschedule-insns2 -fstrict-aliasing" } > +// { dg-additional-options "-lrt" { target *-*-linux-gnu } } That's be fine with me. If someone wants the test to be run on solaris or some other target with librt, they can extend the selector to include the proper target/versions. Jeff
On Mon, Aug 6, 2018 at 5:44 PM, Jeff Law <law@redhat.com> wrote: > On 08/06/2018 09:33 AM, Uros Bizjak wrote: >> On Mon, Aug 6, 2018 at 5:23 PM, Jeff Law <law@redhat.com> wrote: >>> On 08/06/2018 09:10 AM, Uros Bizjak wrote: >>>> 2018-08-06 Uros Bizjak <ubizjak@gmail.com> >>>> >>>> * g++.dg/torture/pr86763.C (dg-additional-options): Add -lrt. >>>> >>>> Tested on CentOS 5.10 and Fedora 28. >>>> >>>> OK for mainline? >>> But what about systems without librt? I'm thinking primarily of the >>> embedded *-elf targets. >> >> Perhaps the following patch is better: >> >> --cut here-- >> Index: g++.dg/torture/pr86763.C >> =================================================================== >> --- g++.dg/torture/pr86763.C (revision 263317) >> +++ g++.dg/torture/pr86763.C (working copy) >> @@ -1,5 +1,6 @@ >> // { dg-do run } >> // { dg-additional-options "-fschedule-insns2 -fstrict-aliasing" } >> +// { dg-additional-options "-lrt" { target *-*-linux-gnu } } > That's be fine with me. > > If someone wants the test to be run on solaris or some other target with > librt, they can extend the selector to include the proper target/versions. Thanks, I'll commit the patch to mainline with updated ChangeLog entry: 2018-08-06 Uros Bizjak <ubizjak@gmail.com> * g++.dg/torture/pr86763.C (dg-additional-options): Add -lrt for target *-*-linux-gnu. Uros.
How about replacing clock_gettime with something else? It's not needed for the particular test. Andreas.
Hi Andreas, > How about replacing clock_gettime with something else? It's not needed > for the particular test. that would certainly be useful: Solaris 10 also needs librt or clock_gettime, while Solaris 11 has folded it into libc. Rainer
Index: g++.dg/torture/pr86763.C =================================================================== --- g++.dg/torture/pr86763.C (revision 263317) +++ g++.dg/torture/pr86763.C (working copy) @@ -1,5 +1,5 @@ // { dg-do run } -// { dg-additional-options "-fschedule-insns2 -fstrict-aliasing" } +// { dg-additional-options "-fschedule-insns2 -fstrict-aliasing -lrt" } #include <cstdint> #include <cassert>