public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] ARM preprocessor error generating assembly dependencies
@ 2009-08-31  8:39 Dirk Behme
  2009-08-31 10:40 ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: Dirk Behme @ 2009-08-31  8:39 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] ARM preprocessor error generating assembly dependencies
  2009-08-31  8:39 [U-Boot] ARM preprocessor error generating assembly dependencies Dirk Behme
@ 2009-08-31 10:40 ` Wolfgang Denk
  2009-08-31 12:51   ` Dirk Behme
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2009-08-31 10:40 UTC (permalink / raw)
  To: u-boot

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

-- 
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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] ARM preprocessor error generating assembly dependencies
  2009-08-31 10:40 ` Wolfgang Denk
@ 2009-08-31 12:51   ` Dirk Behme
  2009-08-31 13:00     ` Dirk Behme
  0 siblings, 1 reply; 9+ messages in thread
From: Dirk Behme @ 2009-08-31 12:51 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] ARM preprocessor error generating assembly dependencies
  2009-08-31 12:51   ` Dirk Behme
@ 2009-08-31 13:00     ` Dirk Behme
  2009-09-01  6:13       ` Dirk Behme
  0 siblings, 1 reply; 9+ messages in thread
From: Dirk Behme @ 2009-08-31 13:00 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] ARM preprocessor error generating assembly dependencies
  2009-08-31 13:00     ` Dirk Behme
@ 2009-09-01  6:13       ` Dirk Behme
  2009-09-01  6:38         ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: Dirk Behme @ 2009-09-01  6:13 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] ARM preprocessor error generating assembly dependencies
  2009-09-01  6:13       ` Dirk Behme
@ 2009-09-01  6:38         ` Wolfgang Denk
  2009-09-01  6:46           ` Dirk Behme
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2009-09-01  6:38 UTC (permalink / raw)
  To: u-boot

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

-- 
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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] ARM preprocessor error generating assembly dependencies
  2009-09-01  6:38         ` Wolfgang Denk
@ 2009-09-01  6:46           ` Dirk Behme
  2009-09-01  7:34             ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: Dirk Behme @ 2009-09-01  6:46 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] ARM preprocessor error generating assembly dependencies
  2009-09-01  6:46           ` Dirk Behme
@ 2009-09-01  7:34             ` Wolfgang Denk
  2009-09-01  7:57               ` Dirk Behme
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2009-09-01  7:34 UTC (permalink / raw)
  To: u-boot

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

-- 
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] ARM preprocessor error generating assembly dependencies
  2009-09-01  7:34             ` Wolfgang Denk
@ 2009-09-01  7:57               ` Dirk Behme
  0 siblings, 0 replies; 9+ messages in thread
From: Dirk Behme @ 2009-09-01  7:57 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-09-01  7:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-31  8:39 [U-Boot] ARM preprocessor error generating assembly dependencies Dirk Behme
2009-08-31 10:40 ` Wolfgang Denk
2009-08-31 12:51   ` Dirk Behme
2009-08-31 13:00     ` Dirk Behme
2009-09-01  6:13       ` Dirk Behme
2009-09-01  6:38         ` Wolfgang Denk
2009-09-01  6:46           ` Dirk Behme
2009-09-01  7:34             ` Wolfgang Denk
2009-09-01  7:57               ` Dirk Behme

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox