Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 73560 Details for
Bug 113541
New GCC 4.1.0_beta20051123-r1 (pre-release) (unofficial snapshot)- new ebuild + cool fixes and customizations
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
hijack-cflags3.patch
hijack-cflags3.patch (text/plain), 2.43 KB, created by
Alexey Maximov
on 2005-11-25 02:23:52 UTC
(
hide
)
Description:
hijack-cflags3.patch
Filename:
MIME Type:
Creator:
Alexey Maximov
Created:
2005-11-25 02:23:52 UTC
Size:
2.43 KB
patch
obsolete
> gcc/gcc.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 72 insertions(+) > >Index: gcc41/gcc/gcc.c >=================================================================== >--- gcc41.orig/gcc/gcc.c >+++ gcc41/gcc/gcc.c >@@ -334,6 +334,7 @@ static void display_help (void); > static void add_preprocessor_option (const char *, int); > static void add_assembler_option (const char *, int); > static void add_linker_option (const char *, int); >+static void hijack_cflags (int *, const char ***); > static void process_command (int, const char **); > static int execute (void); > static void alloc_args (void); >@@ -3143,6 +3144,76 @@ add_linker_option (const char *option, i > linker_options [n_linker_options - 1] = save_string (option, len); > } > >+static const char ** >+split_string (char *s, const char **vp, int *k, int sz) >+{ >+ int j = 0; >+ while (s [j]) >+ { >+ vp [*k] = &s [j]; >+ while (s [j] && s [j] != ' ') >+ j ++; >+ if (s [j]) >+ { >+ s [j] = '\0'; >+ j ++; >+ while (s [j] && s [j] == ' ') >+ j ++; >+ } >+ (*k) ++; >+ if ((*k) >= sz) >+ { >+ sz += sz; >+ vp = xrealloc (vp, sz * sizeof (char *)); >+ } >+ } >+ vp [*k] = 0; >+ return vp; >+} >+ >+static void >+hijack_cflags (int *argcp, const char ***argvp) >+{ >+ char *s, *t, **sp; >+ const char **vp; >+ int ssz, vsz, nsp, nvp, j, q, skip; >+ >+ s = getenv ("GCC_HIDDEN_CFLAGS"); >+ t = getenv ("GCC_STRIP_CFLAGS"); >+ if (s && s [0]) >+ { >+ ssz = 4; >+ sp = xcalloc (ssz, sizeof (char *)); >+ nsp = 0; >+ if (t && t [0]) >+ sp = (char **) split_string (t, (const char **) sp, &nsp, ssz); >+ else >+ sp [0] = 0; >+ vsz = *argcp + 4; >+ vp = xcalloc (vsz, sizeof (char *)); >+ nvp = q = 0; >+ skip = 0; >+ while (q < *argcp) >+ { >+ for (j = 0; j < nsp; j ++) >+ { >+ if (!strcmp ((*argvp) [q], sp [j])) >+ skip = 1; >+ } >+ if (!skip) >+ { >+ vp [nvp] = (*argvp) [q]; >+ nvp ++; >+ } >+ skip = 0; >+ q ++; >+ } >+ vp = split_string (s, vp, &nvp, vsz); >+ *argcp = nvp; >+ *argvp = vp; >+ } >+} >+ > /* Create the vector `switches' and its contents. > Store its length in `n_switches'. */ > >@@ -6125,6 +6196,7 @@ main (int argc, const char **argv) > Make a table of specified input files (infiles, n_infiles). > Decode switches that are handled locally. */ > >+ hijack_cflags (&argc, &argv); > process_command (argc, argv); > > /* Initialize the vector of specs to just the default.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 113541
:
73558
|
73559
| 73560 |
73561
|
73562