avadhpatel / marss

PTLsim and QEMU based Computer Architecture Research Simulator
http://www.marss86.org
128 stars 63 forks source link

Unable to successfully run scons due to undefined reference to BIT in kvm.c #38

Closed varunkumhar closed 10 years ago

varunkumhar commented 10 years ago

I have a problem while trying to run step 2 of the MARSSx86+DRAMSim2 configuration (Go into the marss folder and type scons dramsim=/full/path/to/DRAMSim2). I have successfully resolved all previous dependency issues by installing necessary packages.

I get an undefined reference to BIT in kvm.c

john@abcd:~/marss.dramsim$ scons dramsim=/home/john/DRAMSim2 scons: Reading SConscript files ... running with -j5 Checking whether the C++ compiler works(cached) yes no yes yes no Checking for C library z... (cached) yes yes Checking for C library X11... (cached) yes yes Checking for C library vdeplug... (cached) no no Checking for C library curses... (cached) yes Checking for C library pthread... (cached) yes yes Checking for C library fdt... (cached) no yes yes yes no yes yes yes yes yes yes Checking for C header file signal.h... (cached) yes Checking for C header file time.h... (cached) yes Checking for C library rt... (cached) yes Checking for C function fdatasync()... (cached) yes yes yes yes yes Checking for C library attr... (cached) no yes yes yes Checking for C library sasl... (cached) no Checking for C header file byteswap.h... (cached) yes Checking for C header file machine/bswap.h... (cached) no Machine 'shared_l2' requires minimum of 2 contexts while you are compiling with 1 contexts. Skipping this machine 'shared_l2'. Machine 'ooo_2_th' requires minimum of 2 contexts while you are compiling with 1 contexts. Skipping this machine 'ooo_2_th'. Machine 'moesi_private_L2' requires minimum of 2 contexts while you are compiling with 1 contexts. Skipping this machine 'moesi_private_L2'. Machine 'private_L2' requires minimum of 2 contexts while you are compiling with 1 contexts. Skipping this machine 'private_L2'. Plugins found : scons: done reading SConscript files. scons: Building targets ... Linking Program ==> qemu/qemu-system-x86_64 qemu/libqemu_common.a(misc.o): In function slirp_connection_info': misc.c:(.text+0x917): warning: memset used with constant zero length parameter; this could be due to transposed parameters qemu/target-i386/kvm.o: In functionkvm_arch_init_vcpu': kvm.c:(.text+0x1ed6): undefined reference to BIT' kvm.c:(.text+0x1ee5): undefined reference toBIT' kvm.c:(.text+0x1f60): undefined reference to BIT' kvm.c:(.text+0x2111): undefined reference toBIT' kvm.c:(.text+0x2181): undefined reference to BIT' qemu/target-i386/kvm.o:kvm.c:(.text+0x21f1): more undefined references toBIT' follow collect2: error: ld returned 1 exit status scons: *\ [qemu/qemu-system-x86_64] Error 1 scons: building terminated because of errors.

fitzfitsahero commented 10 years ago

I believe this error has to do with a new version of GCC. I was able to compile successfully after making a slight change, as seen in commit 221336091ec99e8814b791a9135ae3ea73e14746

It was just moving the #define BIT from qemu/hw/eepro100.c to qemu/qemu-common.h