linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vineet Gupta <vineetg76@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Richard Weinberger <richard.weinberger@gmail.com>,
	Chen Gang <gang.chen@asianux.com>,
	Joern Rennecke <joern.rennecke@embecosm.com>,
	James Hogan <james.hogan@imgtec.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Takashi Iwai <tiwai@suse.de>,
	Vineet Gupta <Vineet.Gupta1@synopsys.com>,
	"jeremy.bennett@embecosm.com" <jeremy.bennett@embecosm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com>,
	Francois Bedard <Francois.Bedard@synopsys.com>,
	Sam Ravnborg <sam@ravnborg.org>, Joe Perches <joe@perches.com>,
	"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>
Subject: Re: Portable assmbler code - newline (was Re: [PATCH] kernel/modsign_certificate.S: use real contents instead of macro GLOBAL())
Date: Fri, 25 Oct 2013 10:40:43 +0530	[thread overview]
Message-ID: <5269FD53.6040903@synopsys.com> (raw)
In-Reply-To: <CAMuHMdURxpuWPYYDTU2Sa4eF8WZTb=0ALQ+irtGk9ERtSKz09Q@mail.gmail.com>

On 10/25/2013 01:11 AM, Geert Uytterhoeven wrote:
> On Thu, Oct 24, 2013 at 7:28 PM, Vineet Gupta <vineetg76@gmail.com> wrote:
>> > +CC linux-arch
>> >
>> > On 10/24/2013 11:33 AM, Richard Weinberger wrote:
>>> >> On Thu, Oct 24, 2013 at 7:31 AM, Chen Gang <gang.chen@asianux.com> wrote:
>>>>> >>> > For some architectures, tool chain is not smart enough to recognize the
>>>>> >>> > macro with multiple lines (e.g. arc tool chain), and for common ".S"
>>>>> >>> > file, this kind of macro is also rarely used.
>>> >> Does not "not smart enough" mean than the said toolchain is broken/buggy
>>> >> or is the kernel using an unsupported notation?
>>> >>
>> >
>> > IMHO this is not broken - rather the code is not fully portable - given that gas
>> > ports of arches have differnet notions of what to treat as comment and what newline.
>> >
>> > Looking as binutils/gas/config, I can see that avr, cris,...are likely broken in
>> > the same way as ARC is.
>> >
>> > Historically ARC has had ';' as comment char, which Joern relatively recently
>> > augmented to have '#' as well. However there's legacy codebase which relies on ';'
>> > being a comment and we can't change that fact.
>> >
>> > So can we introduce an ARCH over-ridable newline annotation in linkage.h and other
>> > places after auditing. Since asm/linkage.h preempts linux/linkage.h by way of
>> > #include it shd be pretty strightforward.
>> >
>> > Something like below. I can send the formal patch if people think the approach is OK.
> By what are you gonna override __ARCH_NL on ARC?
> I'm afraid cpp will still turn it into a single line.
> 

Eh ! My untested patch was broken but not because of what you mentioned.

For ARC, the ; negating the newline annotation. So the following works (backquote
is new line for ARC)

diff --git a/arch/arc/include/asm/linkage.h b/arch/arc/include/asm/linkage.h
index 0283e9e44e0d..b3eea2999322 100644
--- a/arch/arc/include/asm/linkage.h
+++ b/arch/arc/include/asm/linkage.h
@@ -9,6 +9,8 @@
 #ifndef __ASM_LINKAGE_H
 #define __ASM_LINKAGE_H

+#define __ARCH_NL      `
+
 #ifdef __ASSEMBLY__


diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index d3e8ad23a8e0..969e70ad231a 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -6,6 +6,10 @@
 #include <linux/export.h>
 #include <asm/linkage.h>

+#ifndef __ARCH_NL
+#define __ARCH_NL      ;
+#endif
+
 #ifdef __cplusplus
 #define CPP_ASMLINKAGE extern "C"
 #else
@@ -75,7 +79,7 @@

 #ifndef ENTRY
 #define ENTRY(name) \
-  .globl name; \
+  .globl name __ARCH_NL \
   ALIGN; \
   name:
 #endif

  reply	other threads:[~2013-10-25  5:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <523FD9E7.3050303@asianux.com>
     [not found] ` <523FDBD7.4040602@asianux.com>
     [not found]   ` <C2D7FE5348E1B147BCA15975FBA2307514DED9@IN01WEMBXA.internal.synopsys.com>
     [not found]     ` <523FE578.5060801@asianux.com>
     [not found]       ` <52672DAC.1030307@asianux.com>
     [not found]         ` <CAMqJFCou4SObPni5Lb_tX=0hQ__kF_9MLDC-6a1opptc9dxT-A@mail.gmail.com>
     [not found]           ` <52673E41.6040606@asianux.com>
     [not found]             ` <5267AF98.1010800@asianux.com>
     [not found]               ` <5268B0B1.9050009@asianux.com>
     [not found]                 ` <CAFLxGvzERDqwZhb_5d=bXKmqz6-Yrema_TLMTM7rjyeFeDJG_w@mail.gmail.com>
2013-10-24 17:28                   ` Portable assmbler code - newline (was Re: [PATCH] kernel/modsign_certificate.S: use real contents instead of macro GLOBAL()) Vineet Gupta
2013-10-24 19:41                     ` Geert Uytterhoeven
2013-10-25  5:10                       ` Vineet Gupta [this message]
2013-10-26 13:38                         ` Chen Gang
2013-10-27  7:28                           ` Portable assmbler code - newline Vineet Gupta
2013-10-27 12:34                             ` Chen Gang
2013-10-27 13:57                               ` Chen Gang

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=5269FD53.6040903@synopsys.com \
    --to=vineetg76@gmail.com \
    --cc=Claudiu.Zissulescu@synopsys.com \
    --cc=Francois.Bedard@synopsys.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=gang.chen@asianux.com \
    --cc=geert@linux-m68k.org \
    --cc=james.hogan@imgtec.com \
    --cc=jeremy.bennett@embecosm.com \
    --cc=joe@perches.com \
    --cc=joern.rennecke@embecosm.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.weinberger@gmail.com \
    --cc=rusty@rustcorp.com.au \
    --cc=sam@ravnborg.org \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).