1
votes

I am trying to install qemu-0.14.1 in ubuntu 15.04 64 bit system. On giving the make command it gives following errors:

../slirp/misc.o: In function memset': /usr/include/x86_64-linux-gnu/bits/string3.h:86: warning: memset used with constant zero length parameter; this could be due to transposed parameters ../qemu-timer.o: In functiondynticks_start_timer': /home/shruti/Downloads/qemu-0.14.1/qemu-timer.c:862: undefined reference to timer_create' ../qemu-timer.o: In functiondynticks_rearm_timer': /home/shruti/Downloads/qemu-0.14.1/qemu-timer.c:901: undefined reference to timer_gettime' /home/shruti/Downloads/qemu-0.14.1/qemu-timer.c:914: undefined reference totimer_settime' ../qemu-timer.o: In function dynticks_stop_timer': /home/shruti/Downloads/qemu-0.14.1/qemu-timer.c:880: undefined reference totimer_delete' collect2: error: ld returned 1 exit status Makefile:347: recipe for target 'qemu-system-arm' failed make[1]: * [qemu-system-arm] Error 1 Makefile:84: recipe for target 'subdir-arm-softmmu' failed make: * [subdir-arm-softmmu] Error 2

Can anyone please guide with correct steps and why this error is coming related to timer object file.

2
Most likely what you're seeing is more recent toolchains being less permissive with regards to compiling code with errors. You are trying to use GCC 4.9 to build source code contemporary with GCC 4.6. You could try installing GCC 4.6 and building with that. - unixsmurf

2 Answers

0
votes

Issue is solved by editing two files, Makefile and Makefile.target by adding

LIBS+=-lz -lrt -lm

0
votes

Check if you have correct GCC/G++ versions installed. My suggestion is to use default gcc 7 for your application.

Installing GCC the C compiler on Ubuntu, step by step instructions

Install multiple C and C++ compiler versions:

$ sudo apt install build-essential
$ sudo apt -y install gcc-7 g++-7 gcc-8 g++-8 gcc-9 g++-9

Use the update-alternatives tool to create list of multiple GCC and G++ compiler alternatives:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9

Check the available C and C++ compilers list on your Ubuntu system and select desired version by entering relevant selection number:

$ sudo update-alternatives --config gcc

There are 3 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path            Priority   Status
------------------------------------------------------------
  0            /usr/bin/gcc-9   9         auto mode
  1            /usr/bin/gcc-7   7         manual mode
* 2            /usr/bin/gcc-8   8         manual mode
  3            /usr/bin/gcc-9   9         manual mode

Press to keep the current choice[*], or type selection number: For C++ compiler execute:

$ sudo update-alternatives --config g++

There are 3 choices for the alternative g++ (providing /usr/bin/g++).

  Selection    Path            Priority   Status
------------------------------------------------------------
* 0            /usr/bin/g++-9   9         auto mode
  1            /usr/bin/g++-7   7         manual mode
  2            /usr/bin/g++-8   8         manual mode
  3            /usr/bin/g++-9   9         manual mode

Press to keep the current choice[*], or type selection number: Each time after switch check your currently selected compiler version:

$ gcc --version
$ g++ --version