Comments (11)
It's cleaner solution, thank you!
As far as I know *.s
(lower case) files should not be preprocessed. Will gcc
make a decision based on the extension?
from cdt.
As far as I know
*.s
(lower case) files should not be preprocessed. Willgcc
make a decision based on the extension?
Yes.
from cdt.
It's great that issue was being discussed!
I can't see the all the details and possible issues, however I can tell my use case in the hope that it helps to make a decision.
We are developing an embedded UI library which now has some *.S
files for multiple Arm architectures to speed up some critical operations. Mostly we are developing the UI library on PC where the content of the *.S
files should be disabled by an #if ...
.
Generally speaking this issue happens for everyone who adds ASM to speed up some parts of the code on foreign architectures. I don't know how common this use can be.
from cdt.
Hi @kisvegabor, GNU as
does not invoke the C preprocessor. In order to pre-process your test.S
file, you will need to use gcc
as the assembler Command and add -c
to the Assembler flags option:
@jonahgraham and @Torbjorn-Svensson, we should discuss making this the default behaviour.
from cdt.
Great, thank you John!
from cdt.
As far as I know
*.s
(lower case) files should not be preprocessed. Willgcc
make a decision based on the extension?Yes.
Hm. @jld01, do you have any reference where it states that gcc
will make a difference on *.s
and *.S
regarding if preprocessing the content is performed or if the content is sent directly to as
?
from cdt.
@Torbjorn-Svensson I think that this doc covers it, quoted:
For any given input file, the file name suffix determines what kind of compilation is done:
...file.s
Assembler code.file.S
file.sx
Assembler code that must be preprocessed.
This can be manually set with -x language
where language is assembler or assembler-with-cpp
from cdt.
@Torbjorn-Svensson I think that this doc covers it, quoted:
For any given input file, the file name suffix determines what kind of compilation is done:
...
file.s
Assembler code.
file.S
file.sx
Assembler code that must be preprocessed.This can be manually set with
-x language
where language is assembler or assembler-with-cpp
Ah! That explains why our tool preprocesses .s files. Thanks for the clarification!
from cdt.
Hi @kisvegabor, GNU
as
does not invoke the C preprocessor. In order to pre-process yourtest.S
file, you will need to usegcc
as the assembler Command and add-c
to the Assembler flags option:@jonahgraham and @Torbjorn-Svensson, we should discuss making this the default behaviour.
I think it would make sense to use the gcc
binary instead of gas
for *.S
files.
from cdt.
It seems there would be a migration issue to consider for existing projects where the assembler Command option has not been modified by the user but the Assembler flags option has been modified. In such cases, the command
attribute of the assembler <tool>
element is not present in the .cproject
file. So the project would use the new assembler command from the revised toolchain description but would not pick up the new -c
flag. We could probably use an IOptionDefaultValueGenerator
to avoid this issue.
from cdt.
As discussed during the CDT call:
Given that the proposed fix requires a migration which may not be successful for the people who have had (and solved) this issue I ask whether it is smart to do the proposed fix.
Basically there is a known work work around for the CDT provided project types.
Other projectTypes probably do not have this issue.
Given this is about building assembly language files that need the preprocessor to be compiled properly I would expect this to be a rare case.
So I'm wondering: given all the drawbacks of the current proposed fix and given the likely hood of it happening: Is it worth implementing the current proposed fix?
from cdt.
Related Issues (20)
- Switch from "Require-Bundle: org.eclipse.osgi.services" to "Import-Package" directive HOT 1
- Adding new lines above collapsed code breaks the display of collapsed code
- std::optional is not working on Eclipse 4.30.0 HOT 4
- Invalid template Arguments for std::map in Eclipse 2023-12 with GCC version 13.2.0 HOT 5
- Improve workflow for new users when MinGW toolchain not detected HOT 2
- Terminal does not read Eclipse variables used as argument for External Executables HOT 1
- Jenkins CI failing to complete builds HOT 4
- Macro expansion for functions and function pointers
- Add compile-commands.json generation for Managed Build Projects HOT 12
- Remove Build and Clean command fields from Launch Bar Launch Configuration, Build Settings tab
- Fix resource leak warnings for org.eclipse.cdt.core.utils
- Improve localization for `org.eclipse.tools.templates.ui` bundle
- An internal error occurred during: "Launching Eclipse Application". Cannot invoke "java.util.List.stream()" because the return value of "java.util.Map.get(Object)" is null HOT 3
- Binding lookup for Constructor Call vs Method Call
- Platform APIs have been removed breaking CDT build on latest platform dependencies
- NPE after creation of new cmake project
- Enhanced static library presentation within CMake projects
- __attribute__ of declarator is missing from AST
- Element order in project explorer arbitrarily changes if label decoration is involved HOT 5
- Improve indexer support for variadic templates
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cdt.