public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* the Right place to change a target default for a common compiler flag?
@ 2009-09-23 10:41 IainS
  2009-09-23 11:43 ` Joern Rennecke
  0 siblings, 1 reply; 5+ messages in thread
From: IainS @ 2009-09-23 10:41 UTC (permalink / raw)
  To: GCC Development

Hi,

In the case that a compiler flag in common.opt would best be served  
with different default values on different targets.

I.E. a target-dependent Init()

Where can this be effected in the machinery ?

I can see how to make an override - but not a default.

cheers,
Iain

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: the Right place to change a target default for a common  compiler flag?
  2009-09-23 10:41 the Right place to change a target default for a common compiler flag? IainS
@ 2009-09-23 11:43 ` Joern Rennecke
  0 siblings, 0 replies; 5+ messages in thread
From: Joern Rennecke @ 2009-09-23 11:43 UTC (permalink / raw)
  To: IainS; +Cc: GCC Development

Quoting IainS <developer@sandoe-acoustics.co.uk>:

> Hi,
>
> In the case that a compiler flag in common.opt would best be served
> with different default values on different targets.
>
> I.E. a target-dependent Init()
>
> Where can this be effected in the machinery ?
>
> I can see how to make an override - but not a default.

Set the default to a special value that indicates that the variable
has not been set by a user option.
Then make the override set the variable to the target-specific
default if the variable still has this special value.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: the Right place to change a target default for a common compiler  flag?
  2009-09-23 13:53 ` IainS
@ 2009-09-23 14:47   ` Dominique Dhumieres
  0 siblings, 0 replies; 5+ messages in thread
From: Dominique Dhumieres @ 2009-09-23 14:47 UTC (permalink / raw)
  To: dominiq, developer; +Cc: gcc

With the previous patch, bootstrap failed when building libgomp: -gstrict-dwarf was
not passed during the configure stage. So it is not sufficient to pass it to
BOOT_CFLAGS. Would repeating the trick for CFLAGS_FOR_TARGET have a chance to
work?

Dominique

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: the Right place to change a target default for a common compiler flag?
  2009-09-23 13:42 Dominique Dhumieres
@ 2009-09-23 13:53 ` IainS
  2009-09-23 14:47   ` Dominique Dhumieres
  0 siblings, 1 reply; 5+ messages in thread
From: IainS @ 2009-09-23 13:53 UTC (permalink / raw)
  To: Dominique Dhumieres; +Cc: gcc

Hi Dominique,

I would expect you to need  -gstrict-dwarf in CFLAGS_FOR_TARGET also

but the point of my question is to find a way of having this on by  
default on Darwin (which is what we currently seem to need).

(more research is need on the latter - to determine whether the  
problem lies in our emission of debug fragments - or in the tools

cheers,
Iain

On 23 Sep 2009, at 14:42, Dominique Dhumieres wrote:

> Iain,
>
> I am currently bootstrapping on i686-apple-darwin9 with the current  
> patch:
>
> diff -uN /opt/gcc/_gcc_clean/config/mh-intel-darwin /opt/gcc/ 
> gcc-4.5-work/config/mh-intel-darwin
> --- /opt/gcc/_gcc_clean/config/mh-intel-darwin	1970-01-01  
> 01:00:00.000000000 +0100
> +++ /opt/gcc/gcc-4.5-work/config/mh-intel-darwin	2009-09-23  
> 13:47:12.000000000 +0200
> @@ -0,0 +1,3 @@
> +# Set strict-dwarf for Darwin
> +
> +BOOT_CFLAGS += -gstrict-dwarf
> diff -uN /opt/gcc/_gcc_clean/config/mh-ppc-darwin /opt/gcc/gcc-4.5- 
> work/config/mh-ppc-darwin
> --- /opt/gcc/_gcc_clean/config/mh-ppc-darwin	2008-02-25  
> 11:00:23.000000000 +0100
> +++ /opt/gcc/gcc-4.5-work/config/mh-ppc-darwin	2009-09-23  
> 12:07:12.000000000 +0200
> @@ -2,4 +2,4 @@
>  # position-independent-code -- the usual default on Darwin. This  
> fix speeds
>  # compiles by 3-5%.
>
> -BOOT_CFLAGS += -mdynamic-no-pic
> +BOOT_CFLAGS += -mdynamic-no-pic -gstrict-dwarf
> --- /opt/gcc/_gcc_clean/configure	2009-09-22 20:04:27.000000000 +0200
> +++ /opt/gcc/gcc-4.5-work/configure	2009-09-23 13:50:29.000000000  
> +0200
> @@ -3655,6 +3655,12 @@
>    powerpc-*-darwin*)
>      host_makefile_frag="config/mh-ppc-darwin"
>      ;;
> +  i[3456789]86-*-darwin*)
> +    host_makefile_frag="config/mh-intel-darwin"
> +    ;;
> +  x86_64-*-darwin[912]*)
> +    host_makefile_frag="config/mh-intel-darwin"
> +    ;;
>    powerpc-*-aix*)
>      host_makefile_frag="config/mh-ppc-aix"
>      ;;
>
> I am currently at stage 3 and I see -gstrict-dwarf in the log file.
>
> I don't know if it is the Right place, but it seems to work so far.
>
> Cheers,
>
> Dominique

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: the Right place to change a target default for a common compiler  flag?
@ 2009-09-23 13:42 Dominique Dhumieres
  2009-09-23 13:53 ` IainS
  0 siblings, 1 reply; 5+ messages in thread
From: Dominique Dhumieres @ 2009-09-23 13:42 UTC (permalink / raw)
  To: gcc; +Cc: developer

Iain,

I am currently bootstrapping on i686-apple-darwin9 with the current patch:

diff -uN /opt/gcc/_gcc_clean/config/mh-intel-darwin /opt/gcc/gcc-4.5-work/config/mh-intel-darwin
--- /opt/gcc/_gcc_clean/config/mh-intel-darwin	1970-01-01 01:00:00.000000000 +0100
+++ /opt/gcc/gcc-4.5-work/config/mh-intel-darwin	2009-09-23 13:47:12.000000000 +0200
@@ -0,0 +1,3 @@
+# Set strict-dwarf for Darwin
+
+BOOT_CFLAGS += -gstrict-dwarf
diff -uN /opt/gcc/_gcc_clean/config/mh-ppc-darwin /opt/gcc/gcc-4.5-work/config/mh-ppc-darwin
--- /opt/gcc/_gcc_clean/config/mh-ppc-darwin	2008-02-25 11:00:23.000000000 +0100
+++ /opt/gcc/gcc-4.5-work/config/mh-ppc-darwin	2009-09-23 12:07:12.000000000 +0200
@@ -2,4 +2,4 @@
 # position-independent-code -- the usual default on Darwin. This fix speeds
 # compiles by 3-5%.
 
-BOOT_CFLAGS += -mdynamic-no-pic
+BOOT_CFLAGS += -mdynamic-no-pic -gstrict-dwarf
--- /opt/gcc/_gcc_clean/configure	2009-09-22 20:04:27.000000000 +0200
+++ /opt/gcc/gcc-4.5-work/configure	2009-09-23 13:50:29.000000000 +0200
@@ -3655,6 +3655,12 @@
   powerpc-*-darwin*)
     host_makefile_frag="config/mh-ppc-darwin"
     ;;
+  i[3456789]86-*-darwin*)
+    host_makefile_frag="config/mh-intel-darwin"
+    ;;
+  x86_64-*-darwin[912]*)
+    host_makefile_frag="config/mh-intel-darwin"
+    ;;
   powerpc-*-aix*)
     host_makefile_frag="config/mh-ppc-aix"
     ;;

I am currently at stage 3 and I see -gstrict-dwarf in the log file.

I don't know if it is the Right place, but it seems to work so far.

Cheers,

Dominique

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-23 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-23 10:41 the Right place to change a target default for a common compiler flag? IainS
2009-09-23 11:43 ` Joern Rennecke
2009-09-23 13:42 Dominique Dhumieres
2009-09-23 13:53 ` IainS
2009-09-23 14:47   ` Dominique Dhumieres

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).