~ubuntu-branches/ubuntu/raring/gcc-4.7/raring

« back to all changes in this revision

Viewing changes to debian/patches/gcc-ppc64-O3.diff

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2011-12-17 23:19:46 UTC
  • Revision ID: package-import@ubuntu.com-20111217231946-n668coanjbjgqxq7
Tags: 4.7-20111217-1
* GCC-4.7 snapshot build.
  - Including the GFDL documentation; will stay in experimental
    until the 4.7.0 release sometime next year.
* Update patches for the trunk.
* Update symbols files.
* Build libitm packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: Replace -O1 and -O2 with -O3, unless the env var DEB_GCC_NO_O3 is set
 
2
 
 
3
--- a/src/gcc/gcc.c
 
4
+++ b/src/gcc/gcc.c
 
5
@@ -413,6 +413,7 @@
 
6
 static const char *find_file_spec_function (int, const char **);
 
7
 static const char *find_plugindir_spec_function (int, const char **);
 
8
 static const char *print_asm_header_spec_function (int, const char **);
 
9
+static const char *if_env_unset_spec_function (int, const char **);
 
10
 static const char *compare_debug_dump_opt_spec_function (int, const char **);
 
11
 static const char *compare_debug_self_opt_spec_function (int, const char **);
 
12
 static const char *compare_debug_auxbase_opt_spec_function (int, const char **);
 
13
@@ -895,6 +896,7 @@
 
14
 static const char *cpp_options =
 
15
 "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
 
16
  %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\
 
17
+ %{O1:%:if-env-unset(DEB_GCC_NO_O3 -O3)} %{O2:%:if-env-unset(DEB_GCC_NO_O3 -O3)}\
 
18
  %{undef} %{save-temps*:-fpch-preprocess}";
 
19
 
 
20
 /* This contains cpp options which are not passed when the preprocessor
 
21
@@ -908,7 +910,8 @@
 
22
  %1 %{!Q:-quiet} %{!dumpbase:-dumpbase %B} %{d*} %{m*} %{a*}\
 
23
  %{fcompare-debug-second:%:compare-debug-auxbase-opt(%b)} \
 
24
  %{!fcompare-debug-second:%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}}%{!c:%{!S:-auxbase %b}} \
 
25
- %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs}\
 
26
+ %{g*} %{O*} %{O1:%:if-env-unset(DEB_GCC_NO_O3 -O3)} %{O2:%:if-env-unset(DEB_GCC_NO_O3 -O3)}\
 
27
+ %{W*&pedantic*} %{w} %{std*&ansi&trigraphs}\
 
28
  %{v:-version} %{pg:-p} %{p} %{f*} %{undef}\
 
29
  %{Qn:-fno-ident} %{--help:--help}\
 
30
  %{--target-help:--target-help}\
 
31
@@ -1736,6 +1739,7 @@
 
32
   { "if-exists-else",          if_exists_else_spec_function },
 
33
   { "replace-outfile",         replace_outfile_spec_function },
 
34
   { "version-compare",         version_compare_spec_function },
 
35
+  { "if-env-unset",            if_env_unset_spec_function },
 
36
   { "include",                 include_spec_function },
 
37
   { "find-file",               find_file_spec_function },
 
38
   { "find-plugindir",          find_plugindir_spec_function },
 
39
@@ -9105,6 +9109,20 @@
 
40
 }
 
41
 
 
42
 
 
43
+/* %:if-env-unset spec function.  Add the second argument, if
 
44
+   if the environment variable (first argument) is not set. */
 
45
+static const char *
 
46
+if_env_unset_spec_function (int argc, const char**argv)
 
47
+{
 
48
+  if (argc != 2)
 
49
+    abort ();
 
50
+  if (getenv (argv[0]) != NULL)
 
51
+    return NULL;
 
52
+  else
 
53
+    return argv[1];
 
54
+}
 
55
+
 
56
+
 
57
 /* %:print-asm-header spec function.  Print a banner to say that the
 
58
    following output is from the assembler.  */
 
59