From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: genjian zhang <zhanggenjian123@gmail.com>
Cc: rdunlap@infradead.org, linux-mips@vger.kernel.org,
linux-kernel@vger.kernel.org,
Genjian Zhang <zhanggenjian@kylinos.cn>,
k2ci <kernel-bot@kylinos.cn>
Subject: Re: [PATCH v2] fix ___SYNC () build error when PROFILE_ALL_BRANCHES is enabled
Date: Fri, 28 Apr 2023 14:06:18 +0200 [thread overview]
Message-ID: <20230428120618.GA11325@alpha.franken.de> (raw)
In-Reply-To: <CAOd03yTc3+Sa4zsPQCu3dHiJfuUf-kOMxeUH6rm4u4Z6Hv2BQQ@mail.gmail.com>
On Fri, Apr 28, 2023 at 03:13:32PM +0800, genjian zhang wrote:
> On Thu, Apr 27, 2023 at 11:05 PM Genjian <zhanggenjian123@gmail.com> wrote:
> >
> > From: Genjian Zhang <zhanggenjian@kylinos.cn>
> >
> > compiler error (mips-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110):
> >
> > {standard input}: Assembler messages:
> > {standard input}:171: Error: found '(', expected: ')'
> > {standard input}:171: Error: found '(', expected: ')'
> > {standard input}:171: Error: non-constant expression in ".if" statement
> > {standard input}:171: Error: junk at end of line, first unrecognized
> > character is `('
> >
> > Expands ___SYNC() macros. However, 'if' statement will be wrong
> > assembly.This Compilers report a lot of errors like the above.
> > this problem is caused by the #define of if() in
> > include/linux/compiler.h when CONFIG_PROFILE_ALL_BRANCHES
> > is set. Move '.if' into quoted strings to fix it.
> >
> > Reported-by: k2ci <kernel-bot@kylinos.cn>
> > Signed-off-by: Genjian Zhang <zhanggenjian@kylinos.cn>
> > ---
> > arch/mips/include/asm/sync.h | 7 ++++---
> > 1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/mips/include/asm/sync.h b/arch/mips/include/asm/sync.h
> > index aabd097933fe..56a4f6f6cdef 100644
> > --- a/arch/mips/include/asm/sync.h
> > +++ b/arch/mips/include/asm/sync.h
> > @@ -175,7 +175,7 @@
> > */
> > #ifdef CONFIG_CPU_HAS_SYNC
> > # define ____SYNC(_type, _reason, _else) \
> > - .if (( _type ) != -1) && ( _reason ); \
> > + ((_type) != -1) && (_reason); \
> > .set push; \
> > .set MIPS_ISA_LEVEL_RAW; \
> > .rept __SYNC_rpt(_type); \
> > @@ -192,13 +192,14 @@
> > /*
> > * Preprocessor magic to expand macros used as arguments before we insert them
> > * into assembly code.
> > + * In addition,'if' cannot be enabled.
> > */
> > #ifdef __ASSEMBLY__
> > # define ___SYNC(type, reason, else) \
> > - ____SYNC(type, reason, else)
> > + .if ____SYNC(type, reason, else)
> > #else
> > # define ___SYNC(type, reason, else) \
> > - __stringify(____SYNC(type, reason, else))
> > + ".if" __stringify(____SYNC(type, reason, else))
> > #endif
> >
> > #define __SYNC(type, reason) \
> > --
> > 2.25.1
> >
>
> This patch does not take into account the situation that CPU_HAS_SYNC
> is not set. I will revise it later.
please post as a new mail not as a replay to this thread.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
next prev parent reply other threads:[~2023-04-28 12:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-26 12:49 [PATCH] fix ___SYNC () build error when PROFILE_ALL_BRANCHES is enabled Genjian
2023-04-26 13:02 ` genjian zhang
2023-04-27 3:16 ` Randy Dunlap
2023-04-27 7:18 ` genjian zhang
2023-04-27 15:03 ` [PATCH v2] " Genjian
2023-04-28 3:20 ` kernel test robot
2023-04-28 7:13 ` genjian zhang
2023-04-28 12:06 ` Thomas Bogendoerfer [this message]
2023-05-13 20:35 ` kernel test robot
2023-05-13 23:19 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230428120618.GA11325@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=kernel-bot@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=zhanggenjian123@gmail.com \
--cc=zhanggenjian@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.