[U-Boot] 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,
In message 4A9B8C3C.7080807@googlemail.com you wrote:
for ARM I'm including
include/asm-arm/assembler.h
in 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
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

Wolfgang Denk wrote:
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

Dirk Behme wrote:
Wolfgang Denk wrote:
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 ;) ).
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

Dirk Behme wrote:
Dirk Behme wrote:
Wolfgang Denk wrote:
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 ;) ).
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.
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,
In message 4A9CBB9D.6030502@googlemail.com you wrote:
Sorry if I'm wrong, but looking into top level rules.mk
...
this doesn't distinguish between .c and .S sources?
No, it does not.
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

Wolfgang Denk wrote:
Dear Dirk Behme,
In message 4A9CBB9D.6030502@googlemail.com you wrote:
Sorry if I'm wrong, but looking into top level rules.mk
...
this doesn't distinguish between .c and .S sources?
No, it does not.
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,
In message 4A9CC333.7020403@googlemail.com you wrote:
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

Dear Wolfgang Denk,
Wolfgang Denk wrote:
Dear Dirk Behme,
In message 4A9CC333.7020403@googlemail.com you wrote:
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.
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
participants (2)
-
Dirk Behme
-
Wolfgang Denk