Qemu configure throws zlib,pthread and kvm missing errors - zlib

I have been trying to get my qemu version running on a new machine. I installed zlib1g-dev, zlib-bin etc. When I do a whereis zlib, I get
zlib: /usr/include/zlib.h /usr/share/man/man3/zlib.3.gz
I tried compiling and installing zlib from source too, but the same issue was present.
The exact error I get is
big/little test failed
Error: zlib check failed
Make sure to have the zlib libs and headers installed.
Additionally, if I comment out the the exit due to this, I get
Error: pthread check failed
and
ERROR: User requested feature kvm
ERROR: configure was not able to find it
kvm modules are enabled and the machine supports hardware virtualization. I had checked it using kvm-ok. lsmod shows kvm and kvm_intel modules.
I am really stumped about these errors. Any help or pointers would be greatly appreciated.

I am still not sure of the actual dependencies that caused the problem, but all the issues were fixed by using
sudo apt-get depmod qemu
After this, I am now able to configure qemu

Related

How to cross-build luajit-5.1 for an ARM Linux device? (Trying to build LÖVE framework)

I'm trying to cross-build LÖVE (https://love2d.org) for an ARM Linux device (Rockchip RK3066) from Ubuntu 16.04.
As the documentation says, I installed all dependencies on Ubuntu and was able to build it (for Ubuntu, as a test). Now I'm going for the cross-build.
Before building, I have to run ./configure. So far I've been able to get the toolchain's gcc compiler to be accepted, but when it looks for the dependencies, I get this error:
checking for luajit5.1... no
checking for luajit51... no
checking for luajit... no
configure: error: Package requirements (luajit) were not met:
No package 'luajit' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables lua_CFLAGS
and lua_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Could this be fixed by cross-building luajit for the device and add it to the toolchain binaries, or could I just try to make the ./configure script look for the luajit I installed in Ubuntu?
If it's the latter, would someone kindly point me on the right direction? I've opened like 20 pages already with a similar error message and none of them had a valid answer.
Thanks a lot in advance.

cpufreq_stats.c error on kernel compilation

Whenever I try to compile a kernel, I get this error: http://pastebin.com/fKE3M47v
How do I get around this? I can't find a patch online that works. I've tried changing the configuration with config and menuconfig, but the changes have no effect. I'm building on Ubuntu Mate 15.10 with Linux kernel 4.2.0, if that matters.
This is the kernel I am building: http://github.com/FireLord1/android_kernel_samsung_logan2g/tree/cm-13-testing

Yocto Build - loadlocale.c #130

So I've upgraded to a newer version of Linux kernel using Yocto. The new kernel version is for 4.1.15 and runs on an iMX6 chip. I've also included openssh-server, tools-sdk, and tools-debug for development recipes. The problem is that when I connect to build I get the following error:
loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof
(_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))'
failed
Now if I type into the command prompt sh -c "LANG=en_US" I get the same error as above. If I type in sh -c "LANG=/usr/lib/locale/en_US" then I do not get an error. When I type locale everything is listed as POSIX and when I type locale -a I get:
C
POSIX
en_GB
en_US
The last two are stored under /usr/lib/locale. My version of gcc is 5.2 and my glibc is v2.22. I've looked all over the internet for other solutions but they are either for Ubuntu where the package manager comes in handy or it's some really specific fix like editing a file that I don't have in my Yocto build.
Edit:
The machine is for a SMARC-FiMX6 SoM and the instructions are here. I'm not sure what branch of Yocto is being pulled down.
After troubleshooting the problem is from the glibc library. A patch, #114739, is on the openembedded website which details what to do to fix this issue. Just patch the file, rebuild, and the issue is fixed. See here for details, the patch is at the bottom of the page.

Compiling embedded linux drivers

This might have passed to the unix and linux stack exchange, but since it involves compiling, i am posting it here.
I want to compile usbserial, usb-wwan, and/or qcserial drivers for 2.6.35-9 Debian for ARMv7.
First problem, there is no 2.6.35-9 driver in the apt-get repos. I tried to compile with 2.6.32-kirkwood, while compilation works, insmod / modprobe, including -f, respectively --force switch fails, with the message :
insmod: error inserting 'usbserial.ko': -1 Invalid module format
I have looked up this and this. In this question, I was pointed to Debian 2.6.35-9 headers, but they did not install, for some dependency problem (Error message : Couldn't resolve dependency, without a list of missing dependencies). So I opened the .deb with ar, but it does not contain anything besides under data.tar.gz a /usr/share/doc ... etc - so no usable header files (or am I missing something?)
I am doing the compilation on the target machine (A Mirabox from Marvell) itself.
So, my question is,
Can I download the Ubuntu 2.6.35 headers? Ubuntu uses Debian core, and the linux kernel is the same, with adaptions to the distro, or it is a fatal error? Is there any Armv7 header for a 2.6.35-9 at all?
If not, then what do I do? Where do I get the correct header files?
Also, 2.6.35 code for usbserial / qcserial is buggy anyway. I was using the code from the 3.2 kernel, thinking the errors might have been fixed. Was it a bad choice? If so, what to do

Problems with macports

I was having some other problems with some ports building for the wrong CPU architecture, and I'm trying to rebuild everything as universal.
I've done: sudo port upgrade outdated +universal, which ran for a long time, and seemed to install a lot of stuff I didn't need. But it didn't fail.
Then I tried with one of the libraries I was previously having problems with:
$ sudo port install cairo +universal
Password:
---> Building libpixman
Error: Target org.macports.build returned: shell command failed (see log for details)
Log for libpixman is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_libpixman/libpixman/main.log
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade libpixman failed
To report a bug, see <http://guide.macports.org/#project.tickets>
Log is here http://hpaste.org/56449
(OSX 10.6.8, Intel Core i5)
sudo port upgrade outdated +universal will only upgrade ports which have changed since you installed them so if a port has not changed it will not be installed/recompiled.
The first step is not strictly required but will remove some issues when you have multiple version of a particular port. This step is to remove all inactive ports sudo port uninstall inactive
To recompile all your ports use sudo port upgrade --force installed +universal the keyword installed will get all your ports and the -force will make sure all are rebuilt.
To make things easier in the future you should change the macports configuration to build universal without having to do that on the port command. You do this by adding +universal to /opt/local/etc/macports/variants.conf
The problem is you've specified +universal, so it's trying to build for both 32 and 64 bit architectures (x86_64 and i386)...
:info:build ---> Building libpixman for architecture x86_64
...and then later...
:info:build ---> Building libpixman for architecture i386
but failing in the 32 bit build
:info:build ld: warning: in /opt/local/lib/libpng14.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
It's failing in the 32 bit build because libpng is built for 64 bit and can't link with the 32 bit version.
If you don't need a universal build, remove the +universal and the problem should go away!
If you do need a universal build... well, macports should figure it out. I believe the issue is that libpixman does not declare dependencies on anything (libpng appears to be an optional dep). Macports can't know it has to build a 32 bit version of libpng. That's my best guess anyway.
Here is exactly your bug. Unfortunately the maintainer's conclusion was that you should manually force recompile libpng as 32 bit. This is a crappy solution as it breaks automated universal builds up to gtk2 and beyond. The real problem is the missing dependency and that Macports can't know to rebuild libpng without it.

Resources