diff mbox

[x86,Darwin] update darwin's x86 output.

Message ID CAF7ACE4-908E-4AA3-9356-5902FDEF4D99@sandoe-acoustics.co.uk
State New
Headers show

Commit Message

Iain Sandoe Oct. 31, 2010, 8:58 p.m. UTC
On 31 Oct 2010, at 20:34, Uros Bizjak wrote:

> Hello!
>
>> It makes the stub choices and sections agree with those used by the  
>> Darwin system tools, and also finally enables -mdynamic-no-pic for  
>> i686-darwin.
>
> Can you test -mdynamic-no-pic with attached patch (you will have to
> regenerate configure and reconfigure gcc) by bootstrapping gcc?

> -  powerpc-*-darwin*)
> +  *-*-darwin*)
>     host_makefile_frag="config/mh-ppc-darwin"

Well, I had an mh-x86-darwin in my local tree for the last few  
months.. :-)

I'm re-running it to make sure on a clean tree.
Iain

         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $ 
(INCLUDES) $<

Comments

Paolo Bonzini Oct. 31, 2010, 9:33 p.m. UTC | #1
On 10/31/2010 09:58 PM, IainS wrote:
>
> On 31 Oct 2010, at 20:34, Uros Bizjak wrote:
>
>> Hello!
>>
>>> It makes the stub choices and sections agree with those used by the
>>> Darwin system tools, and also finally enables -mdynamic-no-pic for
>>> i686-darwin.
>>
>> Can you test -mdynamic-no-pic with attached patch (you will have to
>> regenerate configure and reconfigure gcc) by bootstrapping gcc?
>
>> - powerpc-*-darwin*)
>> + *-*-darwin*)
>> host_makefile_frag="config/mh-ppc-darwin"
>
> Well, I had an mh-x86-darwin in my local tree for the last few months.. :-)
>
> I'm re-running it to make sure on a clean tree.
> Iain
>
> ====
>
> P.S.
>
> The reason I did not include it in the patch is because it requires a
> tangential config fix for plugins...
> ... reported a while back for powerpc ...
> because - mdynamic-no-pic produces a warning when specified together
> with -fPIC
>
> you need to add something like these as well :
>
> Index: gcc/configure.ac
> ===================================================================
> --- gcc/configure.ac (revision 166060)
> +++ gcc/configure.ac (working copy)
> @@ -4715,11 +4715,15 @@ if test x"$enable_plugin" = x"yes"; then
>
> # Check that we can build shared objects with -fPIC -shared
> saved_LDFLAGS="$LDFLAGS"
> + saved_CFLAGS="$CFLAGS"
> case "${host}" in
> *-*-darwin*)
> - LDFLAGS="$LDFLAGS -fPIC -shared -undefined dynamic_lookup"
> + CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
> + CFLAGS="$CFLAGS -fPIC"
> + LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
> ;;
> *)
> + CFLAGS="$CFLAGS -fPIC"
> LDFLAGS="$LDFLAGS -fPIC -shared"
> ;;
> esac
> @@ -4733,6 +4737,7 @@ if test x"$enable_plugin" = x"yes"; then
> enable_plugin=no
> fi
> LDFLAGS="$saved_LDFLAGS"
> + CFLAGS="$saved_CFLAGS"
>
> # If plugin support had been requested but not available, fail.
> if test x"$enable_plugin" = x"no" ; then
>
>
> Index: gcc/config/x-darwin
> ===================================================================
> --- gcc/config/x-darwin (revision 166060)
> +++ gcc/config/x-darwin (working copy)
> @@ -1,3 +1,4 @@
> +PLUGINCFLAGS := $(filter-out -mdynamic-no-pic, $(PLUGINCFLAGS))
> host-darwin.o : $(srcdir)/config/host-darwin.c $(CONFIG_H) $(SYSTEM_H) \
> coretypes.h toplev.h config/host-darwin.h
> $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<

Uros's patch and the configure.ac hunks look good.

As to the last hunk above, options are currently specified in 
testsuite/lib/plugin-support.exp.  You can either remove the Darwin 
special casing there altogether and move -undefined dynamic_lookup to 
config/x-darwin, or you can replace the config/x-darwin patch above with 
a change to plugin-support.exp.  Either is fine for me.

Paolo
Iain Sandoe Oct. 31, 2010, 11:24 p.m. UTC | #2
On 31 Oct 2010, at 21:33, Paolo Bonzini wrote:

> On 10/31/2010 09:58 PM, IainS wrote:
>>
>> On 31 Oct 2010, at 20:34, Uros Bizjak wrote:
>>
>>> Hello!
>>>
>>>> It makes the stub choices and sections agree with those used by the
>>>> Darwin system tools, and also finally enables -mdynamic-no-pic for
>>>> i686-darwin.
>>>
>>> Can you test -mdynamic-no-pic with attached patch (you will have to
>>> regenerate configure and reconfigure gcc) by bootstrapping gcc?
>>
>>> - powerpc-*-darwin*)
>>> + *-*-darwin*)
>>> host_makefile_frag="config/mh-ppc-darwin"

if we enable this can we either add a mh-x86-darwin or rename mh-ppc- 
darwin to mh-darwin ?

>> Well, I had an mh-x86-darwin in my local tree for the last few  
>> months.. :-)
>>
>> I'm re-running it to make sure on a clean tree.

Bootstrap & make check-gcc completed OK (less the missing plugin tests  
as expected - since I only included your change)
Iain


>> Iain
>>
>> ====
>>
>> P.S.
>>
>> The reason I did not include it in the patch is because it requires a
>> tangential config fix for plugins...
>> ... reported a while back for powerpc ...
>> because - mdynamic-no-pic produces a warning when specified together
>> with -fPIC
>>
>> you need to add something like these as well :
>>
>> Index: gcc/configure.ac
>> ===================================================================
>> --- gcc/configure.ac (revision 166060)
>> +++ gcc/configure.ac (working copy)
>> @@ -4715,11 +4715,15 @@ if test x"$enable_plugin" = x"yes"; then
>>
>> # Check that we can build shared objects with -fPIC -shared
>> saved_LDFLAGS="$LDFLAGS"
>> + saved_CFLAGS="$CFLAGS"
>> case "${host}" in
>> *-*-darwin*)
>> - LDFLAGS="$LDFLAGS -fPIC -shared -undefined dynamic_lookup"
>> + CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
>> + CFLAGS="$CFLAGS -fPIC"
>> + LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
>> ;;
>> *)
>> + CFLAGS="$CFLAGS -fPIC"
>> LDFLAGS="$LDFLAGS -fPIC -shared"
>> ;;
>> esac
>> @@ -4733,6 +4737,7 @@ if test x"$enable_plugin" = x"yes"; then
>> enable_plugin=no
>> fi
>> LDFLAGS="$saved_LDFLAGS"
>> + CFLAGS="$saved_CFLAGS"
>>
>> # If plugin support had been requested but not available, fail.
>> if test x"$enable_plugin" = x"no" ; then
>>
>>
>> Index: gcc/config/x-darwin
>> ===================================================================
>> --- gcc/config/x-darwin (revision 166060)
>> +++ gcc/config/x-darwin (working copy)
>> @@ -1,3 +1,4 @@
>> +PLUGINCFLAGS := $(filter-out -mdynamic-no-pic, $(PLUGINCFLAGS))
>> host-darwin.o : $(srcdir)/config/host-darwin.c $(CONFIG_H) $ 
>> (SYSTEM_H) \
>> coretypes.h toplev.h config/host-darwin.h
>> $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
>
> Uros's patch and the configure.ac hunks look good.
>
> As to the last hunk above, options are currently specified in  
> testsuite/lib/plugin-support.exp.  You can either remove the Darwin  
> special casing there altogether and move -undefined dynamic_lookup  
> to config/x-darwin, or you can replace the config/x-darwin patch  
> above with a change to plugin-support.exp.  Either is fine for me.
>
> Paolo
Paolo Bonzini Oct. 31, 2010, 11:46 p.m. UTC | #3
On 11/01/2010 12:24 AM, IainS wrote:
>
> if we enable this can we either add a mh-x86-darwin or rename
> mh-ppc-darwin to mh-darwin ?

mh-darwin please.

Paolo
diff mbox

Patch

====

P.S.

The reason I did not include it in the patch is because it requires a  
tangential config fix for plugins...
  ... reported a while back for powerpc  ...
because  - mdynamic-no-pic produces a warning when specified together  
with -fPIC

you need to add something like these as well :

Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac    (revision 166060)
+++ gcc/configure.ac    (working copy)
@@ -4715,11 +4715,15 @@  if test x"$enable_plugin" = x"yes"; then

    # Check that we can build shared objects with -fPIC -shared
    saved_LDFLAGS="$LDFLAGS"
+  saved_CFLAGS="$CFLAGS"
    case "${host}" in
      *-*-darwin*)
-      LDFLAGS="$LDFLAGS -fPIC -shared -undefined dynamic_lookup"
+      CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+      CFLAGS="$CFLAGS -fPIC"
+      LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
      ;;
      *)
+      CFLAGS="$CFLAGS -fPIC"
        LDFLAGS="$LDFLAGS -fPIC -shared"
      ;;
    esac
@@ -4733,6 +4737,7 @@  if test x"$enable_plugin" = x"yes"; then
      enable_plugin=no
    fi
    LDFLAGS="$saved_LDFLAGS"
+  CFLAGS="$saved_CFLAGS"

    # If plugin support had been requested but not available, fail.
    if test x"$enable_plugin" = x"no" ; then


Index: gcc/config/x-darwin
===================================================================
--- gcc/config/x-darwin (revision 166060)
+++ gcc/config/x-darwin (working copy)
@@ -1,3 +1,4 @@ 
+PLUGINCFLAGS := $(filter-out -mdynamic-no-pic, $(PLUGINCFLAGS))
  host-darwin.o : $(srcdir)/config/host-darwin.c $(CONFIG_H) $ 
(SYSTEM_H) \
    coretypes.h toplev.h config/host-darwin.h