Bug 103530 - managed build: File with capital "S" extension not recognized as assembly
Summary: managed build: File with capital "S" extension not recognized as assembly
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 6.0   Edit
Assignee: Chris Recoskie CLA
QA Contact: Doug Schaefer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-12 14:53 EDT by Jeremiah Lott CLA
Modified: 2010-03-23 12:43 EDT (History)
5 users (show)

See Also:


Attachments
A workaround (583 bytes, text/x-diff)
2007-08-21 11:33 EDT, Vladimir Prus CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremiah Lott CLA 2005-07-12 14:53:02 EDT
This "S" extension is not recognized, even though it is declared in the 
plugin.xml for the assembler inputType in the managed build description.  
Apparently this is because it now uses the "content type" system, which 
overrides any file-extension declared in the input type.  The assembler content 
type seems to be defined as ".s" and ".asm", but not ".S".  This extension was 
recognized by the managed builder in CDT 2.0.
Comment 1 Jeremiah Lott CLA 2005-07-12 15:00:44 EDT
Upon further investigation, I should also add that I am unable to add ".S" for 
assembly on the content type preference page.  It appears to be because the 
content type panel is treating the extensions as case-insensitive (I am on 
windows), and sees ".S" as a duplicate of ".s".  The managed build systems 
seems to treat the extensions as case-sensitive, however.
Comment 2 Doug Schaefer CLA 2005-07-12 15:46:35 EDT
That's probably the root of it and the mishandling of .C as well. I guess we
need to add case sensitivity as a toolset option. Yuck...
Comment 3 Leo Treggiari CLA 2005-07-12 22:54:24 EDT
The source content-types are defined in org.eclipse.cdt.core\plugin.xml.

  <extension point="org.eclipse.core.runtime.contentTypes"> 
      <file-association 
       content-type="org.eclipse.cdt.core.cSource"
       file-extensions="c"/>
   </extension> 

   <extension point="org.eclipse.core.runtime.contentTypes"> 
      <file-association 
       content-type="org.eclipse.cdt.core.cxxSource"
       file-extensions="cpp,cxx,cc"/>
   </extension> 

   <extension point="org.eclipse.core.runtime.contentTypes"> 
      <file-association 
       content-type="org.eclipse.cdt.core.asmSource"
       file-extensions="s,asm"/>
   </extension> 

   <extension point="org.eclipse.core.runtime.contentTypes"> 
      <file-association 
       content-type="org.eclipse.cdt.core.cHeader"
       file-extensions="h"/>
   </extension> 

   <extension point="org.eclipse.core.runtime.contentTypes"> 
      <file-association 
       content-type="org.eclipse.cdt.core.cxxHeader"
       file-extensions="hpp,hh,hxx"/>
   </extension> 

There are no uppercase extensions in these lists.  Even if we were to do case 
insensitive compare on Windows, there would still be a problem on other 
platforms.

Questions:

1.  Should "S" and "C" be added?  Note: I can't change cdt-core.
2.  Should the MBS have a tool-chain attribute that states whether file 
extensions are case sensitive?  Windows does give us file names and extensions 
in the case that they were created.  That is, an MBS C project will not compile 
a file with a "C" extension by default.
Comment 4 Jeremiah Lott CLA 2005-07-14 17:26:38 EDT
After doing a little more research, it appears to me that Eclipse content types 
are case-insensitive on all platforms (including windows & linux).  I guess the 
managed build system will have to take that into account somehow.  I base this 
on looking at org.eclipse.core.internal.content.FileSpec, which is used for all 
the ContentType matches.  It turns everything to lower case and/or does case-
insensitive matching.
Comment 5 Vladimir Prus CLA 2007-08-10 14:00:33 EDT
This problem is still present in CDT HEAD as of today. Adding both *.s and *.S
in the "C/C++ General"->"File Types" tab of project properties results in an error.
Comment 6 Vladimir Prus CLA 2007-08-21 11:33:24 EDT
Created attachment 76547 [details]
A workaround

I attach a patch that works around the problem -- the managed builder no longer users Eclipse core, but basically uses a hardcoded list of extensions (s + S).
This is not ideal, because users can't add new extensions, but given that now S extension does not work at all, is probably an improvement over the current situation.
Comment 7 Torkild Resheim CLA 2008-09-16 03:43:42 EDT
I noticed that the "S" extension is still not recognised by the build system and that it is still not declared as a content type. Adding "S" as a "org.eclipse.cdt.core.cSource" content type works nicely as GCC will figure out what to do.

I added the following declaration to our code:

   <extension
         point="org.eclipse.core.runtime.contentTypes">
      <file-association 
       content-type="org.eclipse.cdt.core.cSource"
       file-extensions="S"/>
   </extension>
   
And "S" files are correctly handled by GCC.
Comment 8 Chris Recoskie CLA 2009-05-11 14:07:27 EDT
The content type support in the platform was extended at some point to handle case sensitivity.  Should be easy to just add the uppercase version now.
Comment 9 Chris Recoskie CLA 2009-05-11 14:25:27 EDT
I added .S and .ASM to the content type definition.

Fixed on HEAD.
Comment 10 Harald CLA 2010-03-23 12:43:18 EDT
It looks like it is not fixed in CDT 6.0.

See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=278026