Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755874Ab3JXR3E (ORCPT ); Thu, 24 Oct 2013 13:29:04 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:58162 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755564Ab3JXR3B (ORCPT ); Thu, 24 Oct 2013 13:29:01 -0400 Message-ID: <526958D8.6030102@synopsys.com> Date: Thu, 24 Oct 2013 22:58:56 +0530 From: Vineet Gupta Organization: Synopsys User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Richard Weinberger , Chen Gang CC: Joern Rennecke , James Hogan , Rusty Russell , Takashi Iwai , Vineet Gupta , "jeremy.bennett@embecosm.com" , "linux-kernel@vger.kernel.org" , Claudiu Zissulescu , Francois Bedard , Sam Ravnborg , Joe Perches , "linux-arch@vger.kernel.org" Subject: Portable assmbler code - newline (was Re: [PATCH] kernel/modsign_certificate.S: use real contents instead of macro GLOBAL()) References: <523FD9E7.3050303@asianux.com> <523FDBD7.4040602@asianux.com> <523FE578.5060801@asianux.com> <52672DAC.1030307@asianux.com> <52673E41.6040606@asianux.com> <5267AF98.1010800@asianux.com> <5268B0B1.9050009@asianux.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2133 Lines: 67 +CC linux-arch On 10/24/2013 11:33 AM, Richard Weinberger wrote: > On Thu, Oct 24, 2013 at 7:31 AM, Chen Gang 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. -----------------> diff --git a/include/linux/linkage.h b/include/linux/linkage.h index d3e8ad23a8e0..4188c632f2b8 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -6,6 +6,10 @@ #include #include +#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 @@ -83,7 +87,7 @@ #ifndef WEAK #define WEAK(name) \ - .weak name; \ + .weak name; __ARCH_NL \ name: #endif -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/