RESEND: PATCH: Factor common text out of the specs

Michael Meissner meissner@tiktok.cygnus.com
Tue Jul 11 13:02:00 GMT 2000


On Mon, Jul 03, 2000 at 07:13:30PM -0700, Zack Weinberg wrote:
> I'm resending this patch, which has received zero discussion in the
> month since it was posted.  It factors the long runs of common text
> out of the lang-specs files into named specs.  For the original patch
> and a more detailed explanation, see
> http://gcc.gnu.org/ml/gcc-patches/2000-05/msg01342.html .

In general, I like the patch.  I would say that as long as we are commonizing
the specs, the common options in LINK_COMMMAND_SPEC should be done (see the
changes interspersed with the changes below).  If you make these changes, and
it bootstraps, go ahead and check it in.

> zw
> 
>         * gcc.c (LINK_COMMAND_SPEC): Move up with the other
>         target-overriden specs.
>         (cpp_options, cc1_options, asm_options): New named specs.
>         (C specs): Use them.
>         (struct compiler): Get rid of array of four spec strings.
>         (main, lookup_compiler, read_specs, validate_all_switches):
>         No need to deal with array of four spec strings.
>         (do_spec_1): Handle %B.
>         (set_input): Set up for %B.
>         (suffixed_basename_length): New global.
> 
>         * ch/lang-specs.h, cp/lang-specs.h, f/lang-specs.h,
>         java/lang-specs.h, objc/lang-specs.h: Use new named specs to
>         reduce duplicate code.
> 
> ===================================================================
> Index: gcc.c
> --- gcc.c	2000/06/29 10:24:19	1.150
> +++ gcc.c	2000/07/04 02:12:13
> @@ -267,6 +267,7 @@ or with constant text in a single argume
>   %b     substitute the basename of the input file being processed.
>  	This is the substring up to (and not including) the last period
>  	and not including the directory.
> + %B	same as %b, but include the file suffix (text after the last period).

We need a warning in the NEWS file that you cannot use an older gcc driver to
process specs produced by the current compiler.

>   %gSUFFIX
>  	substitute a file name that has suffix SUFFIX and is chosen
>  	once per compilation, and mark the argument a la %d.  To reduce
> @@ -496,6 +497,34 @@ proper position among the other output f
>  #define LINKER_NAME "collect2"
>  #endif
>  
> +/* Here is the spec for running the linker, after compiling all files.  */
> +
> +/* -u* was put back because both BSD and SysV seem to support it.  */
> +/* %{static:} simply prevents an error message if the target machine
> +   doesn't handle -static.  */
> +/* We want %{T*} after %{L*} and %D so that it can be used to specify linker
> +   scripts which exist in user specified directories, or in standard
> +   directories.  */
> +#ifndef LINK_COMMAND_SPEC
> +#ifdef LINK_LIBGCC_SPECIAL
> +/* Don't generate -L options.  */
> +#define LINK_COMMAND_SPEC "\
> +%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
> +    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}\
> +    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
> +    %{static:} %{L*} %o %{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
> +    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
> +#else
> +/* Use -L.  */
> +#define LINK_COMMAND_SPEC "\
> +%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
> +    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}\
> +    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
> +    %{static:} %{L*} %D %o %{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
> +    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
> +#endif
> +#endif
> +

This should be done something like:

#ifndef LINK_COMMAND_SPEC
#define LINK_COMMAND_SPEC "\
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}\
    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
    %{static:} %{L*} %(link_libgcc_spec) %o %{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
#endif

#ifndef LINK_LIBGCC_SPEC
#ifdef LINK_LIBGCC_SPECIAL
/* Don't generate -L options */
#define LINK_LIBGCC_SPEC ""
#else
/* Generate -L. options */
#define LINK_LIBGCC_SPEC "%D"
#endif
#endif

>  static const char *cpp_spec = CPP_SPEC;
>  static const char *cpp_predefines = CPP_PREDEFINES;
>  static const char *cc1_spec = CC1_SPEC;
> @@ -510,6 +539,38 @@ static const char *endfile_spec = ENDFIL
>  static const char *startfile_spec = STARTFILE_SPEC;
>  static const char *switches_need_spaces = SWITCHES_NEED_SPACES;
>  static const char *linker_name_spec = LINKER_NAME;
> +static const char *link_command_spec = LINK_COMMAND_SPEC;

And then add
static const char *link_libgcc_sspec = LINK_LIBGCC_SPEC;

> +/* Standard options to cpp, cc1, and as, to reduce duplication in specs.
> +   There should be no need to override these.  */

Please change the above comment to something like:
/* Standard options to cpp, cc1, and as, to reduce duplication in specs.
   There should be no need to override these in target dependent files,
   but we need to copy them to the specs file so that newer versions
   of the GCC driver can correctly compiler tool chains when using the
   appropriate -B options.  */

> +static const char *cpp_options =
> +"%{C:%{!E:%eGNU C does not support -C without using -E}}\
> + %{std*} %{nostdinc*}\
> + %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
> + %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
> + %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
> + %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
> + %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
> + %{ffast-math:-D__FAST_MATH__}\
> + %{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
> + %{traditional} %{ftraditional:-traditional}\
> + %{traditional-cpp:-traditional}\
> + %{fshow-column} %{fno-show-column}\
> + %{fleading-underscore} %{fno-leading-underscore}\
> + %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z %i\
> + %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}";
> +
> +static const char *cc1_options =
> +"%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
> + %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*}\
> + %{g*} %{O*} %{W*} %{w} %{pedantic*} %{std*} %{ansi}\
> + %{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
> + %{aux-info*} %{Qn:-fno-ident} %{--help:--help}\
> + %{S:%W{o*}%{!o*:-o %b.s}}";
> +
> +static const char *asm_options =
> +"%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
>  
>  /* Some compilers have limits on line lengths, and the multilib_select
>     and/or multilib_matches strings can be very long, so we build them at
> @@ -583,8 +644,7 @@ struct compiler
>    const char *suffix;		/* Use this compiler for input files
>  				   whose names end in this suffix.  */
>  
> -  const char *spec[4];		/* To use this compiler, concatenate these
> -				   specs and pass to do_spec.  */
> +  const char *spec;		/* To use this compiler, run this spec.  */
>  };
>  
>  /* Pointer to a vector of `struct compiler' that gives the spec for
> @@ -610,156 +670,52 @@ static struct compiler default_compilers
>       were not present when we built the driver, we will hit these copies
>       and be given a more meaningful error than "file not used since
>       linking is not done".  */
> -  {".m", {"#Objective-C"}},
> -  {".cc", {"#C++"}}, {".cxx", {"#C++"}}, {".cpp", {"#C++"}},
> -  {".c++", {"#C++"}}, {".C", {"#C++"}},
> -  {".ads", {"#Ada"}}, {".adb", {"#Ada"}}, {".ada", {"#Ada"}},
> -  {".f", {"#Fortran"}}, {".for", {"#Fortran"}}, {".F", {"#Fortran"}},
> -  {".fpp", {"#Fortran"}},
> -  {".p", {"#Pascal"}}, {".pas", {"#Pascal"}},
> +  {".m",  "#Objective-C"},
> +  {".cc", "#C++"}, {".cxx", "#C++"}, {".cpp", "#C++"},
> +  {".c++", "#C++"}, {".C", "#C++"},
> +  {".ads", "#Ada"}, {".adb", "#Ada"}, {".ada", "#Ada"},
> +  {".f", "#Fortran"}, {".for", "#Fortran"}, {".F", "#Fortran"},
> +  {".fpp", "#Fortran"}, {".r", "#Ratfor"},
> +  {".p", "#Pascal"}, {".pas", "#Pascal"},
> +  {".ch", "#Chill"}, {".chi", "#Chill"},
> +  {".java", "#Java"}, {".class", "#Java"},
> +  {".zip", "#Java"}, {".jar", "#Java"},
>    /* Next come the entries for C.  */
> -  {".c", {"@c"}},
> +  {".c", "@c"},
>    {"@c",
> -   {
>  #if USE_CPPLIB
> -     "%{E|M|MM:cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
> -	%{C} %{v} %{A*} %{I*} %{P} %{$} %I\
> -	%{C:%{!E:%eGNU C does not support -C without using -E}}\
> -	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
> -        %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
> -	%{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
> -        %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
> -	%{ffast-math:-D__FAST_MATH__}\
> -	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
> -        %{traditional} %{ftraditional:-traditional}\
> -        %{traditional-cpp:-traditional}\
> -	%{fleading-underscore} %{fno-leading-underscore}\
> -	%{fshow-column} %{fno-show-column}\
> -	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
> -        %i %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}\n}\
> -      %{!E:%{!M:%{!MM:cc1 %i %1 \
> -                  %{std*} %{nostdinc*} %{A*} %{I*} %I\
> -                  %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
> -                  %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
> -                  %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
> -		  %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
> -                  %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
> -		  %{ffast-math:-D__FAST_MATH__}\
> -		  %{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
> -		  %{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
> -                  %{H} %C %{D*} %{U*} %{i*} %Z\
> -                  %{ftraditional:-traditional}\
> -                  %{traditional-cpp:-traditional}\
> -		  %{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
> -		  %{aux-info*} %{Qn:-fno-ident}\
> -		  %{--help:--help}\
> -		  %{g*} %{O*} %{W*} %{w} %{pedantic*}\
> -		  %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
> -		  %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
> -                  %{!S:as %a %Y\
> -		     %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
> -                     %{!pipe:%g.s} %A\n }}}}"
> +     "%{E|M|MM:cpp -lang-c %{ansi:-std=c89} %(cpp_options)}\
> +      %{!E:%{!M:%{!MM:cc1 -lang-c %{ansi:-std=c89} %(cpp_options)\
> +			  %(cc1_options) %{!S:-o %{|!pipe:%g.s} |\n\
> +      as %(asm_options) %{!pipe:%g.s} %A }}}}"
>  #else /* ! USE_CPPLIB */
> -    "cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
> -	%{C} %{v} %{A*} %{I*} %{P} %{$} %I\
> -	%{C:%{!E:%eGNU C does not support -C without using -E}}\
> -	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
> -        %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
> -	%{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
> -        %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
> -	%{ffast-math:-D__FAST_MATH__}\
> -	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
> -        %{traditional} %{ftraditional:-traditional}\
> -        %{traditional-cpp:-traditional}\
> -	%{fshow-column} %{fno-show-column}\
> -	%{fleading-underscore} %{fno-leading-underscore}\
> -	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
> -        %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
> -   "%{!M:%{!MM:%{!E:cc1 %{!pipe:%g.i} %1 \
> -		   %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
> -		   %{g*} %{O*} %{W*} %{w} %{pedantic*} %{std*}\
> -		   %{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
> -		   %{aux-info*} %{Qn:-fno-ident}\
> -		   %{--help:--help} \
> -		   %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
> -		   %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
> -              %{!S:as %a %Y\
> -		      %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
> -                      %{!pipe:%g.s} %A\n }}}}"
> +     "cpp -lang-c %{ansi:-std=c89} %(cpp_options)\
> +      %{!M:%{!MM:%{!E:%{!pipe:%g.i} |\n cc1 %{!pipe:%g.i} %(cc1_options)\
> +      %{!S:-o %{|!pipe:%g.s} |\n as %(asm_options) %{!pipe:%g.s} %A }}}}\n"
>  #endif /* ! USE_CPPLIB */
> -  }},
> +  },
>    {"-",
> -   {"%{E:cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
> -	%{C} %{v} %{A*} %{I*} %{P} %{$} %I\
> -	%{C:%{!E:%eGNU C does not support -C without using -E}}\
> -	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
> -        %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
> -	%{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
> -        %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
> -	%{ffast-math:-D__FAST_MATH__}\
> -	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
> -        %{traditional} %{ftraditional:-traditional}\
> -        %{traditional-cpp:-traditional}\
> -	%{fshow-column} %{fno-show-column}\
> -	%{fleading-underscore} %{fno-leading-underscore}\
> -	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
> -        %i %W{o*}}\
> -    %{!E:%e-E required when input is from standard input}"}},
> -  {".h", {"@c-header"}},
> +   "%{!E:%e-E required when input is from standard input}\
> +    cpp -lang-c %{ansi:-std=c89} %(cpp_options)"},
> +     
> +  {".h", "@c-header"},
>    {"@c-header",
> -   {"%{!E:%eCompilation of header file requested} \
> -    cpp %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
> -	%{C:%{!E:%eGNU C does not support -C without using -E}}\
> -	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
> -        %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
> -	%{!undef:%{!std=*:%p}%{std=gnu*:%p} %P} %{trigraphs}\
> -        %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
> -	%{ffast-math:-D__FAST_MATH__}\
> -	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
> -	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
> -        %{traditional} %{ftraditional:-traditional}\
> -        %{traditional-cpp:-traditional}\
> -	%{fshow-column} %{fno-show-column}\
> -	%{fleading-underscore} %{fno-leading-underscore}\
> -	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
> -        %i %W{o*}"}},
> -  {".i", {"@cpp-output"}},
> +   "%{!E:%eCompilation of header file requested} \
> +    cpp -lang-c %{ansi:-std=c89} %(cpp-options)"},
> +  {".i", "@cpp-output"},
>    {"@cpp-output",
> -   {"%{!M:%{!MM:%{!E:cc1 %i %1 %{!Q:-quiet} %{d*} %{m*} %{a*}\
> -			%{g*} %{O*} %{W*} %{w} %{pedantic*} %{std*}\
> -			%{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
> -			%{aux-info*} %{Qn:-fno-ident} -fpreprocessed\
> -			%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
> -			%{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
> -		     %{!S:as %a %Y\
> -			     %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
> -			     %{!pipe:%g.s} %A\n }}}}"}},
> -  {".s", {"@assembler"}},
> +   "%{!M:%{!MM:%{!E:cc1 %i %(cc1_options)\
> +                     %{!S:|\n as %(asm_options) %{!pipe:%g.s} %A }}}}"},
> +  {".s", "@assembler"},
>    {"@assembler",
> -   {"%{!M:%{!MM:%{!E:%{!S:as %a %Y\
> -		            %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
> -			    %i %A\n }}}}"}},
> -  {".S", {"@assembler-with-cpp"}},
> +   "%{!M:%{!MM:%{!E:%{!S:as %(asm_options) %i %A }}}}"},
> +  {".S", "@assembler-with-cpp"},
>    {"@assembler-with-cpp",
> -   {"cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
> -	%{C:%{!E:%eGNU C does not support -C without using -E}}\
> -	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} %{trigraphs}\
> -        -$ %{!undef:%p %P} -D__ASSEMBLER__ \
> -        %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
> -	%{ffast-math:-D__FAST_MATH__}\
> -	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
> -        %{traditional} %{ftraditional:-traditional}\
> -        %{traditional-cpp:-traditional}\
> -	%{fshow-column} %{fno-show-column}\
> -	%{fleading-underscore} %{fno-leading-underscore}\
> -	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
> -        %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
> -    "%{!M:%{!MM:%{!E:%{!S:as %a %Y\
> -                    %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
> -		    %{!pipe:%g.s} %A\n }}}}"}},
> +   "cpp -lang-asm %(cpp_options) %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}\
> +     %{!M:%{!MM:%{!E:%{!S:|\n as %(asm_options) %{!pipe:%g.s} %A }}}}"},
>  #include "specs.h"
>    /* Mark end of table */
> -  {0, {0}}
> +  {0, 0}
>  };
>  
>  /* Number of elements in default_compilers, not counting the terminator.  */
> @@ -767,47 +723,6 @@ static struct compiler default_compilers
>  static int n_default_compilers
>    = (sizeof default_compilers / sizeof (struct compiler)) - 1;
>  
> -/* Here is the spec for running the linker, after compiling all files.  */
> -
> -/* -u* was put back because both BSD and SysV seem to support it.  */
> -/* %{static:} simply prevents an error message if the target machine
> -   doesn't handle -static.  */
> -/* We want %{T*} after %{L*} and %D so that it can be used to specify linker
> -   scripts which exist in user specified directories, or in standard
> -   directories.  */
> -#ifdef LINK_COMMAND_SPEC
> -/* Provide option to override link_command_spec from machine specific
> -   configuration files.  */
> -static const char *link_command_spec = 
> -	LINK_COMMAND_SPEC;
> -#else
> -#ifdef LINK_LIBGCC_SPECIAL
> -/* Don't generate -L options.  */
> -static const char *link_command_spec = "\
> -%{!fsyntax-only: \
> - %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
> -			%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
> -			%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
> -			%{static:} %{L*} %o\
> -			%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
> -			%{!A:%{!nostdlib:%{!nostartfiles:%E}}}\
> -			%{T*}\
> -			\n }}}}}}";
> -#else
> -/* Use -L.  */
> -static const char *link_command_spec = "\
> -%{!fsyntax-only: \
> - %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
> -			%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
> -			%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
> -			%{static:} %{L*} %D %o\
> -			%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
> -			%{!A:%{!nostdlib:%{!nostartfiles:%E}}}\
> -			%{T*}\
> -			\n }}}}}}";
> -#endif
> -#endif
> -
>  /* A vector of options to give to the linker.
>     These options are accumulated by %x,
>     and substituted into the linker command with %X.  */
> @@ -1141,8 +1056,11 @@ static struct spec_list static_specs[] =
>  {
>    INIT_STATIC_SPEC ("asm",			&asm_spec),
>    INIT_STATIC_SPEC ("asm_final",		&asm_final_spec),
> +  INIT_STATIC_SPEC ("asm_options",		&asm_options),
>    INIT_STATIC_SPEC ("cpp",			&cpp_spec),
> +  INIT_STATIC_SPEC ("cpp_options",		&cpp_options),
>    INIT_STATIC_SPEC ("cc1",			&cc1_spec),
> +  INIT_STATIC_SPEC ("cc1_options",		&cc1_options),
>    INIT_STATIC_SPEC ("cc1plus",			&cc1plus_spec),
>    INIT_STATIC_SPEC ("endfile",			&endfile_spec),
>    INIT_STATIC_SPEC ("link",			&link_spec),

Then add in:

  INIT_STATIC_SPEC ("link_libgcc",	&link_libgcc_spec);

(no comments on the rest of the changes).

-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482


More information about the Gcc-patches mailing list