lkml.org 
[lkml]   [2016]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] kbuild: simpler generation of constants for assembly
On Fri, Jun 3, 2016 at 2:24 AM, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Sat, 21 May 2016 01:27:36 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:
>
>> Instead of showing how cool sed(1) invocation could be, rely on the fact
>> that gcc doesn't really look inside "asm" statement body and more or less
>> directly emits it into assembly. Pretend "#define" is an instruction.
>>
>> %a prints integer as plain integer without '$' or other characters.
>> C++ comment takes care of trailing '#' character nobody asked for.
>>
>> Remove empty lines in generated file while I'm at it.
>>
>> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>> ---
>>
>> NOT compile tested on ia64.
>> Compile tested on arm.
>
> I tried ia64 defconfig and it exploded.

> In file included from include/linux/mm_types.h:14,
> from include/linux/sched.h:27,
> from arch/ia64/kernel/asm-offsets.c:9:
> include/linux/page-flags-layout.h:14:18: error: operator '<' has no left operand
> include/linux/page-flags-layout.h:16:20: error: operator '<=' has no left operand
> include/linux/page-flags-layout.h:18:20: error: operator '<=' has no left operand
> include/linux/page-flags-layout.h:20:20: error: operator '<=' has no left operand
> include/linux/page-flags-layout.h:23:2: error: #error ZONES_SHIFT -- too many zones configured adjust calculation

"%0" :: "i" (x) prints number with $ sign.
"%a0" :: "i" (x) prints number without $ sign.

on ia64:
"%0: prints number without $.
"%a0" prints nothing.

I can add special case for ia64 but other archs can be inconsistent as well.

Alexey

\
 
 \ /
  Last update: 2016-06-10 13:41    [W:0.305 / U:1.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site