gcc.dg/20020312-2.c: pass -Wl,-no_pie for darwin11

Message ID 20110708125445.GA31841@bromo.med.uc.edu
State New
Headers show

Commit Message

Jack Howarth July 8, 2011, 12:54 p.m.
Currently the gcc.dg/20020312-2.c testcase fails on darwin11 with...

FAIL: gcc.dg/20020312-2.c (test for excess errors)

at -m32 due to the fact that the absolute addressing (-mdynamic-no-pic) is not allowed with the
default -pie linkage of darwin11 and later which produces a warning. The attached patch solves this by passing
-Wl,-no_pie for darwin10 and later. This form of the target match was selected because the linker
in darwin9 and earlier doesn't understand -no_pie. Tested on x86_64-apple-darwin10/11. Okay for
gcc trunk and gcc-4_6-branch/gcc-4_5-branch/gcc-4_4-branch?

2011-07-08  Jack Howarth <howarth@bromo.med.uc.edu>

	* gcc.dg/20020312-2.c: Pass -Wl,-no_pie at -m32 for darwin10 and later.


Index: gcc.dg/20020312-2.c
--- gcc.dg/20020312-2.c	(revision 176025)
+++ gcc.dg/20020312-2.c	(working copy)
@@ -7,6 +7,7 @@ 
 /* { dg-do run } */
 /* { dg-options "-O -fno-pic" } */
+/* { dg-options "-O -fno-pic -Wl,-no_pie" { target { { i?86-*-darwin1* x86_64-*-darwin1* } && ilp32 } } } */
 extern void abort (void);