[PATCH v2 21/22] Use __ASSEMBLY__ as the assembly macros

Simon Goldschmidt simon.k.r.goldschmidt at gmail.com
Wed Apr 15 06:48:27 CEST 2020


Am 14.04.2020 um 23:04 schrieb Tom Rini:
> On Tue, Apr 14, 2020 at 10:38:47PM +0200, Simon Goldschmidt wrote:
>> Masahiro Yamada <masahiroy at kernel.org> schrieb am Di., 14. Apr. 2020, 17:34:
>>
>>> Hi Simon,
>>>
>>> On Tue, Apr 14, 2020 at 11:41 PM Simon Glass <sjg at chromium.org> wrote:
>>>>
>>>> Hi Masahiro,
>>>>
>>>> On Mon, 13 Apr 2020 at 11:10, Masahiro Yamada <masahiroy at kernel.org>
>>> wrote:
>>>>>
>>>>> On Fri, Apr 10, 2020 at 5:18 AM Simon Glass <sjg at chromium.org> wrote:
>>>>>>
>>>>>> Some places use __ASSEMBLER__ instead which does not work since the
>>>>>> Makefile does not define it. Fix them.
>>>>>
>>>>>
>>>>> In my understanding,
>>>>> __ASSEMBLER__ is passed by the compiler
>>>>> while building *.S files.
>>>>>
>>>>> On which compiler didn't this work for you?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> Signed-off-by: Simon Glass <sjg at chromium.org>
>>>>>> ---
>>>>>>
>>>>>> Changes in v2:
>>>>>> - Add new patch to fix occurances of __ASSEMBLER__
>>>>>>
>>>>
>>>> I think I hit this with device tree, but I would need to go back and
>>>> check. Anyway I think we should be consistent.
>>>
>>>
>>> DT files are pre-processed with  '-x assembler-with-cpp'.
>>>
>>> So, __ASSEMBLER__ is pre-defined by the compiler.
>>>
>>
>> I have just seen this thread now. It touches socfpga headers but we're not
>> in CC (possibly the maintainers file needs updating).
>>
>> Anyway, why do we have 2 defines for assembler? If one is predefined by the
>> compiler, why don't we use that? Can you explain that for someone not too
>> deeply involved?
> 
> Generally and broadly speaking, the assembler will set __ASSEMBLER__.
> That said, the Linux kernel has been setting __ASSEMBLY__ for
> practically forever and we've copied that behavior also practically for
> forever.  In both trees there are a handful of __ASSEMBLER__ tests and a
> vast majority of __ASSEMBLY__ tests.  It doesn't normally matter which
> is used as the only non-compiler in the Linux kernel that might care is
> handled as shown above.  Under the assumption that the feature
> Yamada-san pointed out in binman is used, it should also define
> __ASSEMBLER__ I believe, to match other tooling.  Thanks!

Ok, thanks for the explanation.

Regards,
Simon


More information about the U-Boot mailing list