[PATCH, PE] Don't pass -fpic to gcc.

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

[PATCH, PE] Don't pass -fpic to gcc.

pedro_alves (Bugzilla)
Hi all,

PE targets ignore -fpic, since they are always pic.  This patch makes
gdb_compile_shlib not add
-fpic to PE targets.  There are a few fails in cygwin caused by the
warning cygwin gcc emits when
-fpic is passed.
"warning: -fpic ignored for target (all code is position independent)"

Please review and commit.

Cheers,
Pedro Alves

gdb/testsuite/

2006-12-21  Pedro Alves  <[hidden email]>

       * gdb.base/lib/gdb.exp: Don't pass -fpic to gcc on Cygwin, MinGW
       and generic PE targets.


Index: testsuite/lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.72
diff -u -p -r1.72 gdb.exp
--- testsuite/lib/gdb.exp 10 Nov 2006 16:58:53 -0000 1.72
+++ testsuite/lib/gdb.exp 21 Dec 2006 22:00:14 -0000
@@ -1575,7 +1575,10 @@ proc gdb_compile_shlib {sources dest opt
         }
         "gcc-*" {
             if { !([istarget "powerpc*-*-aix*"]
-                   || [istarget "rs6000*-*-aix*"]) } {
+                   || [istarget "rs6000*-*-aix*"]
+                   || [istarget "*-*-cygwin*"]
+                   || [istarget "*-*-mingw*"]
+                   || [istarget "*-*-pe*"]) } {
                 lappend obj_options "additional_flags=-fpic"
             }
         }
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH, PE] Don't pass -fpic to gcc.

Daniel Jacobowitz-2
On Thu, Dec 21, 2006 at 10:09:32PM +0000, Pedro Alves wrote:

> Hi all,
>
> PE targets ignore -fpic, since they are always pic.  This patch makes
> gdb_compile_shlib not add
> -fpic to PE targets.  There are a few fails in cygwin caused by the
> warning cygwin gcc emits when
> -fpic is passed.
> "warning: -fpic ignored for target (all code is position independent)"
>
> Please review and commit.

> 2006-12-21  Pedro Alves  <[hidden email]>
>
>       * gdb.base/lib/gdb.exp: Don't pass -fpic to gcc on Cygwin, MinGW
>       and generic PE targets.

Typo (gdb.base).  Otherwise OK; I committed it.

Have I offered you write-after-approval access yet?  If not, I should
have; feel free to fill out the form on the front of sourceware.org,
and list me as approver.

--
Daniel Jacobowitz
CodeSourcery