[CRIU] [PATCH 4/7] compel/x86: clang-3.4 isn't a friend to numbers in macro

Dmitry Safonov dsafonov at virtuozzo.com
Mon Jan 9 09:19:09 PST 2017


It's a workaround to clang-3.4, which doesn't handle numbers
in asm macros rightly:
https://llvm.org/bugs/show_bug.cgi?id=21500

Which resulted in:
  CC       compel/arch/x86/plugins/std/parasite-head.o
<instantiation>:3:2: error: too few operands for instruction
 pushq
 ^
compel/arch/x86/plugins/std/parasite-head.S:26:2: note: while in macro instantiation
 PARASITE_ENTRY
 ^

Fixes: https://travis-ci.org/0x7f454c46/criu/jobs/186099057

Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 compel/arch/x86/plugins/std/parasite-head.S | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/compel/arch/x86/plugins/std/parasite-head.S b/compel/arch/x86/plugins/std/parasite-head.S
index bdb56c877c37..a988de9d4218 100644
--- a/compel/arch/x86/plugins/std/parasite-head.S
+++ b/compel/arch/x86/plugins/std/parasite-head.S
@@ -6,10 +6,10 @@
 # error 64-bit parasite should compile with CONFIG_X86_64
 #endif
 
-.macro PARASITE_ENTRY
+.macro PARASITE_ENTRY num
 	subq	$16, %rsp
 	andq	$~15, %rsp
-	pushq	$0
+	pushq	$\num
 	movq	%rsp, %rbp
 	movl	__export_parasite_cmd(%rip), %edi
 	leaq	__export_parasite_args(%rip), %rsi
@@ -23,7 +23,7 @@ ENTRY(__export_parasite_head_start_compat)
 	jmp	$__USER_CS,$1f
 1:
 .code64
-	PARASITE_ENTRY
+	PARASITE_ENTRY 0
 	pushq	$__USER32_CS
 	pushq	$2f
 	lretq
@@ -43,7 +43,7 @@ END(__export_parasite_head_start_compat)
 #endif
 
 ENTRY(__export_parasite_head_start)
-	PARASITE_ENTRY
+	PARASITE_ENTRY 0
 	int	$0x03
 END(__export_parasite_head_start)
 
-- 
2.11.0



More information about the CRIU mailing list