ARM preprocessor error generating assembly dependencies
Hi,
for ARM I'm including
include/asm-arm/assembler.h
in an assembly file. Doing this, I get preprocessor error message
include/asm/assembler.h:17:2: error: #error "Only include this from assembly code"
This is due to __ASSEMBLY__ not defined, but It seems to me that this message comes from *dependency* generation, not from compilation.
For compilation, -D__ASSEMBLY__ is set and it compiles fine.
Doing
#define __ASSEMBLY__
#include <asm/assembler.h>
in assembly file fixes the error while generating dependencies, but results in __ASSEMBLY__ redefined message while compilation.
Any expert here could have look to which options are taken for ARM's assembly dependency generation? It seems to me that -D__ASSEMBLY__ is missing there?
Many thanks and best regards
Dirk
Dear Dirk Behme,
Quoted 6 lines · In message <[email protected]> you wrote:
for ARM I'm including
include/asm-arm/assembler.hin an assembly file. Doing this, I get preprocessor error message
Hm... I get this:
-> ls include/asm-arm/assembler.h
ls: cannot access include/asm-arm/assembler.h: No such file or directory
Quoted 3 lines
Any expert here could have look to which options are taken for ARM's assembly dependency generation? It seems to me that -D__ASSEMBLY__ is missing there?
I have no clue what you are talking about...
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Real programmers don't comment their code. It was hard to write, it should be hard to understand.
Quoted 5 lines · Wolfgang Denk
Quoted 3 lines
Any expert here could have look to which options are taken for ARM's assembly dependency generation? It seems to me that -D__ASSEMBLY__ is missing there?
I have no clue what you are talking about...
It seems to me that dependencies for ARM assembly files are generated with different (incomplete?) options than the compilation is done. That is, it seems to me that for ARM assembly file compilation, -D__ASSEMBLY__ is set, while for dependency generation it isn't.
I'm asking if anybody can give me a hint where I have to look for the (compiler/assembler) options used for dependency generation (for lib_arm/*.S for lib_arm/.depend) or if any expert likes to have a look to this (most probably being faster than me then ;) ).
Best regards
Dirk
Quoted 12 lines · Dirk Behme
Quoted 5 lines · Wolfgang Denk
Quoted 3 lines
Any expert here could have look to which options are taken for ARM's assembly dependency generation? It seems to me that -D__ASSEMBLY__ is missing there?
I have no clue what you are talking about...
It seems to me that dependencies for ARM assembly files are generated with different (incomplete?) options than the compilation is done. That is, it seems to me that for ARM assembly file compilation, -D__ASSEMBLY__ is set, while for dependency generation it isn't.
Quoted 4 lines
I'm asking if anybody can give me a hint where I have to look for the (compiler/assembler) options used for dependency generation (for lib_arm/*.S for lib_arm/.depend) or if any expert likes to have a look to this (most probably being faster than me then ;) ).
Example: Put
#ifndef __ASSEMBLY__
#error "Foo"
#endif
into a lib_arm/*.S file you like (and which is build ;)) and test what happens. I would assume, if -D__ASSEMBLY__ is used everywhere correctly, no error message should be given.
Best regards
Dirk
Quoted 20 lines · Dirk Behme
Quoted 12 lines · Dirk Behme
Quoted 5 lines · Wolfgang Denk
Quoted 3 lines
Any expert here could have look to which options are taken for ARM's assembly dependency generation? It seems to me that -D__ASSEMBLY__ is missing there?
I have no clue what you are talking about...
It seems to me that dependencies for ARM assembly files are generated with different (incomplete?) options than the compilation is done. That is, it seems to me that for ARM assembly file compilation, -D__ASSEMBLY__ is set, while for dependency generation it isn't.
Quoted 4 lines
I'm asking if anybody can give me a hint where I have to look for the (compiler/assembler) options used for dependency generation (for lib_arm/*.S for lib_arm/.depend) or if any expert likes to have a look to this (most probably being faster than me then ;) ).
Example: Put
Quoted 7 lines
#ifndef
__ASSEMBLY__
#error "Foo"
#endifinto a lib_arm/*.S file you like (and which is build ;)) and test what happens. I would assume, if -D__ASSEMBLY__ is used everywhere correctly, no error message should be given.
Sorry if I'm wrong, but looking into top level rules.mk
_depend: $(obj).depend
$(obj).depend: $(src)Makefile $(TOPDIR)/config.mk $(SRCS)
@rm -f $@ @for f in $(SRCS); do \ g=`basename $$f | sed -e 's/\(.*\)\.\w/\1.o/'`; \ $(CC) -M $(HOSTCFLAGS) $(CPPFLAGS) -MQ $(obj)$$g $$f >> $@ ; \ done
this doesn't distinguish between .c and .S sources?
That is, it doesn't use AFLAGS set in config.mk to generate assembly dependencies? So setting -D__ASSEMBLY__ while generating assembly dependencies is missing here?
Best regards
Dirk
Dear Dirk Behme,
Quoted 2 lines · In message <[email protected]> you wrote:
Sorry if I'm wrong, but looking into top level rules.mk
...
Quoted 1 line
this doesn't distinguish between .c and .S sources?
No, it does not.
Quoted 3 lines
That is, it doesn't use AFLAGS set in config.mk to generate assembly dependencies? So setting -D__ASSEMBLY__ while generating assembly dependencies is missing here?
It's not needed. At least for none of the files in mainline.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de If it has syntax, it isn't user friendly.
Quoted 7 lines · Wolfgang Denk
Dear Dirk Behme,
Quoted 1 line · In message <[email protected]> you wrote:
Sorry if I'm wrong, but looking into top level rules.mk
...
Quoted 1 line
this doesn't distinguish between .c and .S sources?
Quoted 7 lines
No, it does not.
Quoted 3 lines
That is, it doesn't use AFLAGS set in config.mk to generate assembly dependencies? So setting -D__ASSEMBLY__ while generating assembly dependencies is missing here?
It's not needed. At least for none of the files in mainline.
Does this mean you will accept a patch that removes -D__ASSEMBLY__ from AFLAGS in config.mk?
Best regards
Dirk
Dear Dirk Behme,
Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 6 lines
Quoted 4 lines
That is, it doesn't use AFLAGS set in config.mk to generate assembly dependencies? So setting -D__ASSEMBLY__ while generating assembly dependencies is missing here?
It's not needed. At least for none of the files in mainline.
Does this mean you will accept a patch that removes -D__ASSEMBLY__ from AFLAGS in config.mk?
Probablky not, as this seems to be bogus and would most probably break a ton of things.
What I mean is that I am not aware of any __ASSEMBLY__ related issues with dependency generation in mainline code, so I fail to understand which exact problem you are trying to solve.
Your original posting mentioned some file include/asm-arm/assembler.h but this not part of mainline, so 1) I cannot comment on it and 2) if adding this file causes problems I would tend to assume that there are problems with that file, but not necessarily with the rest of the system.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Men don't talk peace unless they're ready to back it up with war. -- Col. Green, "The Savage Curtain", stardate 5906.4
Dear Wolfgang Denk,
Quoted 10 lines · Wolfgang Denk
Dear Dirk Behme,
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 4 lines
Quoted 3 lines
That is, it doesn't use AFLAGS set in config.mk to generate assembly dependencies? So setting -D__ASSEMBLY__ while generating assembly dependencies is missing here?
It's not needed. At least for none of the files in mainline.
Does this mean you will accept a patch that removes -D__ASSEMBLY__ from AFLAGS in config.mk?
Quoted 6 lines
Probablky not, as this seems to be bogus and would most probably break a ton of things.
What I mean is that I am not aware of any
__ASSEMBLY__related issues with dependency generation in mainline code, so I fail to understand which exact problem you are trying to solve.
I think it's not a good idea to calculate dependencies with different options than used for compilation. So the exact problem I'm looking for is to use same options for (assembly file) dependency generation and compilation. Just to be clean here, independent of a discussion whether it might be necessary or not (which would be obsolete then).
Best regards
Dirk