Dear all,

I've been playing around with gem5 on my Mac and I get an odd linker error (see 
below). This occurs using the stock gcc 4.2.1 from the latest Xcode, and 
happens for ARM_FS and ARM_SE, but no other ISA. I poked around a bit and 
managed to make the link error disappear using two different methods: 1) Remove 
the inline in front of the Unknown::Unknown constructor in decoder.cc, 2) Move 
the implementation of the Unknown::Unknown to the header file decoder.hh. All 
other ISAs work fine, and they all have the definition in the header file. I 
also ran nm on the decoder.o for the three options (broken, 1 and 2) to get an 
idea of what is happening (see below).

I checked with google on c++ templates and inline and overall there seems to be 
a lot of issues. Is this something you have stumbled upon before? Do you have 
any suggestion on how to fix it permanently?

Thanks.

Andreas

----------------------------------------------------------------------

Undefined symbols for architecture x86_64:
  "ArmISAInst::Unknown::Unknown(BitfieldBackend::BitUnionOperators<unsigned 
long long, ArmISA::BitfieldUnderlyingClassesExtMachInst>)", referenced from:
      ArmISA::VstSingleOp::VstSingleOp(char const*, 
BitfieldBackend::BitUnionOperators<unsigned long long, 
ArmISA::BitfieldUnderlyingClassesExtMachInst>, Enums::OpClass, bool, unsigned 
int, unsigned short, unsigned short, unsigned int, unsigned int, unsigned int, 
unsigned int, unsigned short, unsigned int)in macromem.o
      ArmISA::VstMultOp::VstMultOp(char const*, 
BitfieldBackend::BitUnionOperators<unsigned long long, 
ArmISA::BitfieldUnderlyingClassesExtMachInst>, Enums::OpClass, unsigned int, 
unsigned short, unsigned short, unsigned int, unsigned int, unsigned int, 
unsigned int, unsigned short)in macromem.o
      ArmISA::VldSingleOp::VldSingleOp(char const*, 
BitfieldBackend::BitUnionOperators<unsigned long long, 
ArmISA::BitfieldUnderlyingClassesExtMachInst>, Enums::OpClass, bool, unsigned 
int, unsigned short, unsigned short, unsigned int, unsigned int, unsigned int, 
unsigned int, unsigned short, unsigned int)in macromem.o
      ArmISA::VldMultOp::VldMultOp(char const*, 
BitfieldBackend::BitUnionOperators<unsigned long long, 
ArmISA::BitfieldUnderlyingClassesExtMachInst>, Enums::OpClass, unsigned int, 
unsigned short, unsigned short, unsigned int, unsigned int, unsigned int, 
unsigned int, unsigned short)in macromem.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
scons: *** [build/ARM_FS/gem5.opt] Error 1
scons: building terminated because of errors.
Child returned 2
When attemping to execute: scons --ignore-style  build/ARM_FS/m5.opt 
build/ARM_FS/tests/opt/quick

----------------------------------------------------------------------

nm decoder.o | grep Unknown

Out-of-box gem5 with Unknown::Unknown in .cc and inline - BROKEN

                 U __ZTVN10ArmISAInst7UnknownE

----------------------------------------------------------------------

nm decoder.o | grep Unknown

Removing inline but keep Unknown::Unknown in .cc - WORKING

000000000063ae10 s 
__GLOBAL__I__ZN10ArmISAInst7UnknownC2EN15BitfieldBackend17BitUnionOperatorsIyN6ArmISA36BitfieldUnderlyingClassesExtMachInstEEE
00000000007a0788 s 
__GLOBAL__I__ZN10ArmISAInst7UnknownC2EN15BitfieldBackend17BitUnionOperatorsIyN6ArmISA36BitfieldUnderlyingClassesExtMachInstEEE.eh
0000000000001d3c T 
__ZN10ArmISAInst7UnknownC1EN15BitfieldBackend17BitUnionOperatorsIyN6ArmISA36BitfieldUnderlyingClassesExtMachInstEEE
00000000007d64e8 S 
__ZN10ArmISAInst7UnknownC1EN15BitfieldBackend17BitUnionOperatorsIyN6ArmISA36BitfieldUnderlyingClassesExtMachInstEEE.eh
0000000000000000 T 
__ZN10ArmISAInst7UnknownC2EN15BitfieldBackend17BitUnionOperatorsIyN6ArmISA36BitfieldUnderlyingClassesExtMachInstEEE
00000000007a0750 S 
__ZN10ArmISAInst7UnknownC2EN15BitfieldBackend17BitUnionOperatorsIyN6ArmISA36BitfieldUnderlyingClassesExtMachInstEEE.eh
                 U __ZTVN10ArmISAInst7UnknownE

----------------------------------------------------------------------

nm decoder.o | grep Unknown

Move Unknown::Unknown to .hh like other ISAs - WORKING

00000000006eb1cc S 
__ZN10ArmISAInst7UnknownC1EN15BitfieldBackend17BitUnionOperatorsIyN6ArmISA36BitfieldUnderlyingClassesExtMachInstEEE
00000000007cea40 S 
__ZN10ArmISAInst7UnknownC1EN15BitfieldBackend17BitUnionOperatorsIyN6ArmISA36BitfieldUnderlyingClassesExtMachInstEEE.eh
                 U __ZTVN10ArmISAInst7UnknownE

----------------------------------------------------------------------

-- IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium.  Thank you.

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to