root@ubuntu:/home# qemu-system-arm -M vexpress-a9 -m 512M -kernel linux-4.4/arch/arm/boot/zImage -nographic -append "console=ttyAMA0"
(process:8559): GLib-WARNING **: /build/glib2.0-8EA4QF/glib2.0-2.48.1/./glib/gmem.c:483: custom memory allocation vtable not supported
這個在編譯安裝QEMU的時候就因爲glibc的一個庫函數調用g_mem_set_vtable
產生了警告,導致編譯終止,後來忽略掉編譯警告才編譯完成,qemu安裝的還是有問題。網上看了很多解決方法,包括關smm off都沒有解決。
網上搜了這個函數:g_mem_set_vtable
has been deprecated since version 2.46 and should not be used in newly-written code.
Use other memory profiling tools instead
This function used to let you override the memory allocation function. However, its use was incompatible with the use of global constructors in GLib and GIO, because those use the GLib allocators
before main is reached. Therefore this function is now deprecated and is just a stub.
在glibc中查看該函數的聲明和定義:glib.h->ghash.h->glist.h->glib.h->gmem.h
GLIB_DEPRECATED_IN_2_46
void g_mem_set_vtable (GMemVTable *vtable);
GLIB_DEPRECATED_IN_2_46
gboolean g_mem_is_system_malloc (void);
大概的意思,就是這個函數由於跟glibc的不兼容等問題,從2.46版本就將這個函數標記爲GLIB_DEPRECATED_IN_2_46,再加上make編譯參數的warnning設置,導致編譯失敗。這樣,接下來,解決的思路大致有兩個:
1.downgradding glibc,但是可能會對系統造成影響,導致向下兼容的一些新版本軟件可能存在問題
2.使用新版本的qemu,從qemu2.0,更新到qemu2.7,patch這個漏洞,新版本的qemu源碼中應該使用其它函數實現這個內存定位的功能。結果使用QEMU2.7版本,編譯順利通過,但是最新的版本貌似不再支持mini2440,對vexpress支持更加完善。
對於方法1,做好庫備份,有興趣的可以去實驗一下。