[testsuite, i386] Require -static support in gcc.dg/pie-static-[12].c (PR testsuite/81793)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[testsuite, i386] Require -static support in gcc.dg/pie-static-[12].c (PR testsuite/81793)

Rainer Orth-2
The new gcc.dg/pie-static-[12].c testcases FAIL on several systems:

* Solaris 11.4 has PIE support, but lacks static libc, libm

* Linux without the static libc, libm installed

The following patch fixes this by requiring both PIE and -static
support.

Tested with the appropriate runtest invocations on i386-pc-solaris2.11
and x86_64-pc-linux-gnu (where the tests come up as UNSUPPORTED; I don't
have a Linux system with static libc/libm installed), installed on
mainline.

The tests also FAIL on Darwin/x86_64, but the failure mode is different:
for -static, the executable is linked with -lcrt0.o (done this way to
locate crt0.o in the linker's search path, cf. config/darwin.h
(STARTFILE_SPEC)), but neither on Darwin 11 nor on Darwin 17 could I
find where crt0.o would come from, so I've left this part alone.

        Rainer

--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

2017-08-12  Rainer Orth  <[hidden email]>

        PR testsuite/81793
        * gcc.dg/pie-static-1.c: Require both static and pie support.
        * gcc.dg/pie-static-2.c: Likewise.


# HG changeset patch
# Parent  ab504e0e88e6aee93d2910b5ad66fe16cd5414f9
Require -static support in gcc.dg/pie-static-[12].c

diff --git a/gcc/testsuite/gcc.dg/pie-static-1.c b/gcc/testsuite/gcc.dg/pie-static-1.c
--- a/gcc/testsuite/gcc.dg/pie-static-1.c
+++ b/gcc/testsuite/gcc.dg/pie-static-1.c
@@ -1,4 +1,6 @@
-/* { dg-do run { target pie } } */
+/* { dg-do run } */
+/* { dg-require-effective-target static } */
+/* { dg-require-effective-target pie } */
 /* { dg-options "-static -fpie -pie" } */
 
 int main(void)
diff --git a/gcc/testsuite/gcc.dg/pie-static-2.c b/gcc/testsuite/gcc.dg/pie-static-2.c
--- a/gcc/testsuite/gcc.dg/pie-static-2.c
+++ b/gcc/testsuite/gcc.dg/pie-static-2.c
@@ -1,4 +1,6 @@
-/* { dg-do run { target pie } } */
+/* { dg-do run } */
+/* { dg-require-effective-target pie } */
+/* { dg-require-effective-target static } */
 /* { dg-options "-fpie -pie -static" } */
 
 int main(void)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [testsuite, i386] Require -static support in gcc.dg/pie-static-[12].c (PR testsuite/81793)

Mike Stump-3
On Aug 12, 2017, at 9:03 AM, Rainer Orth <[hidden email]> wrote:

>
> The new gcc.dg/pie-static-[12].c testcases FAIL on several systems:
>
> * Solaris 11.4 has PIE support, but lacks static libc, libm
>
> * Linux without the static libc, libm installed
>
> The following patch fixes this by requiring both PIE and -static
> support.
>
> Tested with the appropriate runtest invocations on i386-pc-solaris2.11
> and x86_64-pc-linux-gnu (where the tests come up as UNSUPPORTED; I don't
> have a Linux system with static libc/libm installed), installed on
> mainline.
>
> The tests also FAIL on Darwin/x86_64, but the failure mode is different:
> for -static, the executable is linked with -lcrt0.o (done this way to
> locate crt0.o in the linker's search path, cf. config/darwin.h
> (STARTFILE_SPEC)), but neither on Darwin 11 nor on Darwin 17 could I
> find where crt0.o would come from, so I've left this part alone.

darwin isn't exactly like other systems.  There is no crt0.o and static is more special than you can imagine.  There was once 1 program that did a static link, but one was exceptionally special.

Indeed, one way to implement it would be as a request option, and then ignore the parts that don't make sense for the platform.  In that case, -static-libgcc and friends might be the end semantics.

Loading...