[igt-dev] [PATCH i-g-t v2] assembler/gen4asm.h: Remove struct src_operand src_operand variable

Lyude lyude at redhat.com
Thu Mar 19 17:40:39 UTC 2020


From: Lyude Paul <lyude at redhat.com>

Another spot where we fail compilation with -fcommon, due to src_operand
getting included in multiple translation units without being marked as
extern:

/usr/bin/ld:
assembler/1ca89e8@@intel-gen4asm at exe/meson-generated_gram.c.o:assembler/gen4asm.h:119:
multiple definition of `src_operand';
assembler/1ca89e8@@intel-gen4asm at exe/meson-generated_lex.c.o:assembler/gen4asm.h:119:
first defined here
/usr/bin/ld:
assembler/1ca89e8@@intel-gen4asm at exe/main.c.o:assembler/gen4asm.h:119:
multiple definition of `src_operand';
assembler/1ca89e8@@intel-gen4asm at exe/meson-generated_lex.c.o:assembler/gen4asm.h:119:
first defined here

However, we never actually refer to this variable - only its type
definition. So, just remove the declaration entirely.

Changes since v1:
* Don't make src_operand extern - just remove the variable declaration
  entirely, we only ever use the typedef - Chris Wilson

Signed-off-by: Lyude Paul <lyude at redhat.com>
---
 assembler/gen4asm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/assembler/gen4asm.h b/assembler/gen4asm.h
index 6b957e28..9537d457 100644
--- a/assembler/gen4asm.h
+++ b/assembler/gen4asm.h
@@ -116,7 +116,7 @@ struct src_operand {
 	int default_region;
 	uint32_t imm32; /* set if src_operand is expressing a branch offset */
 	char *reloc_target; /* bspec: branching instructions JIP and UIP are source operands */
-} src_operand;
+};
 
 typedef struct {
     enum {
-- 
2.25.1



More information about the igt-dev mailing list