This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[testsuite] Link gcc.dg/pie-link.c with -pie
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 11 Sep 2015 11:08:03 +0200
- Subject: [testsuite] Link gcc.dg/pie-link.c with -pie
- Authentication-results: sourceware.org; auth=none
While starting to develop the patch for Solaris PIE support,
the gcc.dg/pie-link.c test succeeded at a point when it shouldn't have,
i.e. before I had PIC crt files. In its current form, the test doesn't
test what it's supposed to test, namely successfully linking position
independent executables, because it compiles with -fpie, but links as a
regular executable. The test was added here
2007-06-01 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/pie-link.c: New test.
https://gcc.gnu.org/ml/gcc-patches/2007-06/msg00070.html
-pie doesn't make a difference on Darwin, but very much so on Linux and
Solaris, where it is necessary for PIE creation.
Fixed thus, tested on x86_64-unknown-linux-gnu and *-*-solaris2.12 with
my upcoming PIE patch.
Ok for mainline and gcc-5 branch?
Rainer
2015-02-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc.dg/pie-link.c: Add -pie to dg-options.
# HG changeset patch
# Parent 3e8c1a7c7f81ba581f0dd21ef2fc84ba136ec40d
Link gcc.dg/pie-link.c with -pie
diff --git a/gcc/testsuite/gcc.dg/pie-link.c b/gcc/testsuite/gcc.dg/pie-link.c
--- a/gcc/testsuite/gcc.dg/pie-link.c
+++ b/gcc/testsuite/gcc.dg/pie-link.c
@@ -1,5 +1,5 @@
/* { dg-do link { target pie } } */
-/* { dg-options "-fpie" } */
+/* { dg-options "-fpie -pie" } */
int main(void)
{
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University