From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PATCH kvm-unit-tests] x86: fix build (macro R interpreted as raw string) Date: Fri, 13 Mar 2015 17:48:04 +0100 Message-ID: <1426265284-29107-1-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Paolo Bonzini , Marcelo Tosatti To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:34292 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751247AbbCMQtD (ORCPT ); Fri, 13 Mar 2015 12:49:03 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2DGn34n006250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 13 Mar 2015 12:49:03 -0400 Sender: kvm-owner@vger.kernel.org List-ID: GCC 5.0.0 enables raw strings by default and they have higher priority than macros, thus R"[...]" is interpreted incorrectly: lib/x86/isr.c:112:30: error: invalid character ')' in raw string deli= miter lib/x86/isr.c:112:8: error: stray =E2=80=98R=E2=80=99 in program lib/x86/isr.c:112:26: error: expected =E2=80=98:=E2=80=99 or =E2=80=98= )=E2=80=99 before string constant "orl $0x200, (%%"R"sp)\n\t" =46ix it by putting a space between macro R and a string literal. (We already do that somewhere.) Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 --- I think it would be better to replace "[...]"R "ax [...]" with "[...]" ASM_AX "[...]" lib/x86/desc.c | 16 ++++++++-------- lib/x86/isr.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/x86/desc.c b/lib/x86/desc.c index 7fbe77455430..32377780c86b 100644 --- a/lib/x86/desc.c +++ b/lib/x86/desc.c @@ -114,22 +114,22 @@ asm (".pushsection .text \n\t" "push %r15; push %r14; push %r13; push %r12 \n\t" "push %r11; push %r10; push %r9; push %r8 \n\t" #endif - "push %"R"di; push %"R"si; push %"R"bp; sub $"S", %"R"sp \n\t" - "push %"R"bx; push %"R"dx; push %"R"cx; push %"R"ax \n\t" + "push %"R "di; push %"R "si; push %"R "bp; sub $"S", %"R "sp \n\t= " + "push %"R "bx; push %"R "dx; push %"R "cx; push %"R "ax \n\t" #ifdef __x86_64__ - "mov %"R"sp, %"R"di \n\t" + "mov %"R "sp, %"R "di \n\t" #else - "mov %"R"sp, %"R"ax \n\t" + "mov %"R "sp, %"R "ax \n\t" #endif "call do_handle_exception \n\t" - "pop %"R"ax; pop %"R"cx; pop %"R"dx; pop %"R"bx \n\t" - "add $"S", %"R"sp; pop %"R"bp; pop %"R"si; pop %"R"di \n\t" + "pop %"R "ax; pop %"R "cx; pop %"R "dx; pop %"R "bx \n\t" + "add $"S", %"R "sp; pop %"R "bp; pop %"R "si; pop %"R "di \n\t" #ifdef __x86_64__ "pop %r8; pop %r9; pop %r10; pop %r11 \n\t" "pop %r12; pop %r13; pop %r14; pop %r15 \n\t" #endif - "add $"S", %"R"sp \n\t" - "add $"S", %"R"sp \n\t" + "add $"S", %"R "sp \n\t" + "add $"S", %"R "sp \n\t" "iret"W" \n\t" ".popsection"); =20 diff --git a/lib/x86/isr.c b/lib/x86/isr.c index 833564ad5862..9b1d5054801e 100644 --- a/lib/x86/isr.c +++ b/lib/x86/isr.c @@ -109,7 +109,7 @@ void handle_external_interrupt(int vector) "push %[sp]\n\t" #endif "pushf\n\t" - "orl $0x200, (%%"R"sp)\n\t" + "orl $0x200, (%%"R "sp)\n\t" "push $%c[cs]\n\t" "call *%[entry]\n\t" : --=20 2.3.2