Bug 149574 - Using 'gcc' for assembler sources
Summary: Using 'gcc' for assembler sources
Status: ASSIGNED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 3.1   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords: bugday
Depends on:
Blocks:
 
Reported: 2006-07-04 09:17 EDT by Vladimir Prus CLA
Modified: 2020-09-04 15:20 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Prus CLA 2006-07-04 09:17:54 EDT
At the moment, default CDT project types (those in org.eclipse.cdt.managedbuilder.gnu.ui) plugin, use 'as' as assembler command. 
As result, input files with extension .S are not automatically preprocessed. I suggest to use the 'gcc' command, that can accept assembler sources just fine and will handle preprocessing of .S files.
Comment 1 Doug Schaefer CLA 2006-07-04 10:27:55 EDT
That's a great point. We'll have to look at doing this.
Comment 2 Torkild Resheim CLA 2006-12-12 09:53:07 EST
Actually, it does not seem that CDT cares about what is in the toolchain when it comes to uppercase "s" files. We've declared our own toolchain that should handle both "s" and "S" files. When building a ".s" file our assembler is called as expected, but when building a ".S" file the output becomes:

cc -E  ../foo.S > ../foo.s
Comment 3 Torkild Resheim CLA 2008-09-16 03:54:01 EDT
See also bug 103530. Letting GCC handled the ".S" files by declaring a content type (in Ganymede) does work.
Comment 4 Dave Korn CLA 2010-03-31 19:03:05 EDT
> See also bug 103530. 

Even better, see bug 278026 for an explanation and possible fix.
Comment 5 Sven Köhler CLA 2015-03-26 11:03:36 EDT
Yes, CDT should use gcc for *.S files. But it doesn't stop there. CDT should also pass the symbols (-D switches) as well as -mcpu and -march options to gcc since they are passed on to the assembler by gcc. These flags decide which instructions are valid and which are not. Beside -march and -mcpu there are also switches like -mfloat-abi=soft have an effect on the .o file generated by the assembler. Each .o contains flags which ABI (endianness, FPU, float-ABI, etc.) they target and the linker checks for compatibility when linking.

Also, CDT should call gcc for *.s files, since, even though they are not preprocessed, the options passed to gcc matter and gcc knows best what options to call the assembler with.

Also, what's the status of this bug? Why is ASSIGNED since 2006, but not much has changes since then?
Comment 6 Elena Laskavaia CLA 2015-03-28 13:46:39 EDT
(In reply to Sven Köhler from comment #5)

> Also, what's the status of this bug? Why is ASSIGNED since 2006, but not
> much has changes since then?

Nobody is working on it. You are welcome to contribute