Android framework build errors fix under Ubuntu 9.04
9/2/2009 11:44:20 PM
issue discription:
------------------------------------------------------------------------------------------------
error type : undeclared or Error 1.
------------------------------------------------------------------------------------------------
host C: emulator <= external/qemu/console.c
host C: emulator <= external/qemu/loader.c
host C: emulator <= external/qemu/sockets.c
external/qemu/sockets.c: In function ‘sock_address_init_resolve’:
external/qemu/sockets.c:637: error: ‘EAI_NODATA’ undeclared (first use in this function)
external/qemu/sockets.c:637: error: (Each undeclared identifier is reported only once
external/qemu/sockets.c:637: error: for each function it appears in.)
make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/sockets.o] Error 1
=========================================================
2.1 Solution:
=========================================================
The 1st way to fix:
Apparently you have to modify the makefile to fix it.
/external/qemu/Makefile.android
# this is needed to build the emulator on 64-bit Linux systems
ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
- MY_CFLAGS += -Wa,--32
+ MY_CFLAGS += -Wa,--32 -D_GNU_SOURCE
endif
ifeq ($(HOST_OS),freebsd)
------------------------------------------------------------------------------------------------
error type : undeclared or Error 1.
------------------------------------------------------------------------------------------------
host C: emulator <= external/qemu/console.c
host C: emulator <= external/qemu/loader.c
host C: emulator <= external/qemu/sockets.c
external/qemu/sockets.c: In function ‘sock_address_init_resolve’:
external/qemu/sockets.c:637: error: ‘EAI_NODATA’ undeclared (first use in this function)
external/qemu/sockets.c:637: error: (Each undeclared identifier is reported only once
external/qemu/sockets.c:637: error: for each function it appears in.)
make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/sockets.o] Error 1
=========================================================
2.1 Solution:
=========================================================
The 1st way to fix:
Apparently you have to modify the makefile to fix it.
/external/qemu/Makefile.android
# this is needed to build the emulator on 64-bit Linux systems
ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
- MY_CFLAGS += -Wa,--32
+ MY_CFLAGS += -Wa,--32 -D_GNU_SOURCE
endif
ifeq ($(HOST_OS),freebsd)
The 2st way to fix:
commenting out the EAI_NODATA line
found in sockets.c file.
err = EHOSTDOWN;
break;
commenting out the EAI_NODATA line
found in sockets.c file.
err = EHOSTDOWN;
break;
- case EAI_NODATA:
+ /* case EAI_NODATA: */
case EAI_NONAME:
err = ENOENT;
break;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2.2 Reference Reading.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2.2.1 The reference link:
http://groups.google.com/group/android-porting/browse_thread/thread/8432b5f2accb718a/8bbec3737be7fc28?lnk=gst&q=external%2Fqemu%2Fsockets.c+%E2%80%98
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2.2.2 key words: qemu
+ /* case EAI_NODATA: */
case EAI_NONAME:
err = ENOENT;
break;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2.2 Reference Reading.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2.2.1 The reference link:
http://groups.google.com/group/android-porting/browse_thread/thread/8432b5f2accb718a/8bbec3737be7fc28?lnk=gst&q=external%2Fqemu%2Fsockets.c+%E2%80%98
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2.2.2 key words: qemu
QEMU is a generic and open source processor emulator which can emulate i386, x86_64, ARM, MIPS, PowerPC and SPARC systems. In case of ARM, it can emulate an Integrator or a Versatile platform. The Versatile one is the most interesting as it includes a hard disk SCSI controller, an Ethernet card and a graphical display.
Using a kernel compiled with the right options, it is possible to install a Debian distribution on such an emulated platform. That makes a cheap development platform. The emulated system running on an Athlon 64 X2 3800+ is around 20% faster than the popular NSLU2 and possibly with much more RAM (my emulated system has 256MiB of RAM).
This howto has been written for a Debian host system, but could be easily adapted for other distributions.
Alternatively prebuilt images are also available.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
本文来自优快云博客,转载请标明出处:
http://blog.youkuaiyun.com/forlong401/archive/2009/06/14/4269107.aspx