This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: recognize .sx filename extension


On Windows, where filenames are case-insensitive, some program development tools do not distinguish between .S and .s files. GCC doesn't have this problem, but apparently some versions of make do. The MIPS SDE environment has been using .sx instead of .S for assembly language code to be preprocessed with cpp; this patch makes GCC recognize that naming convention. (I'm not sure .sx is the name I would have chosen for this, but it reflects current practice.) I haven't tested this patch on anything other than MIPS yet, but is it OK in principle? I guess the issue is breakage of anything that depends on files with a .sx extension getting the default treatment (passed through to ld), but best as I can tell, this has not been controversial for additions to default_compilers in the past?

-Sandra


2007-09-03 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com>

	gcc/
	* doc/invoke.texi (Overall Options):  Add .sx file extension
	as a synonym for .S.
	* cppspec.c (known_suffixes): Likewise.
	* gcc.c (default_compilers): Likewise.
Index: gcc/doc/invoke.texi
===================================================================
*** gcc/doc/invoke.texi	(revision 128065)
--- gcc/doc/invoke.texi	(working copy)
*************** package body).  Such files are also call
*** 975,980 ****
--- 975,981 ----
  Assembler code.
  
  @item @var{file}.S
+ @itemx @var{file}.sx
  Assembler code which must be preprocessed.
  
  @item @var{other}
Index: gcc/cppspec.c
===================================================================
*** gcc/cppspec.c	(revision 128065)
--- gcc/cppspec.c	(working copy)
*************** static const char *const known_suffixes[
*** 45,50 ****
--- 45,51 ----
  {
    ".c",  ".C",   ".S",   ".m",
    ".cc", ".cxx", ".cpp", ".cp",  ".c++",
+   ".sx",
    NULL
  };
  
Index: gcc/gcc.c
===================================================================
*** gcc/gcc.c	(revision 128065)
--- gcc/gcc.c	(working copy)
*************** static const struct compiler default_com
*** 1023,1028 ****
--- 1023,1029 ----
    {".s", "@assembler", 0, 1, 0},
    {"@assembler",
     "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 1, 0},
+   {".sx", "@assembler-with-cpp", 0, 1, 0},
    {".S", "@assembler-with-cpp", 0, 1, 0},
    {"@assembler-with-cpp",
  #ifdef AS_NEEDS_DASH_FOR_PIPED_INPUT

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]