android2.3.4 fsl imx51编译遇到的问题总结

本文针对Android源码编译过程中常见的几种错误提供了详细的解决方案,包括32位系统编译64位环境问题、模块标签配置错误、编译文件缺失等,并给出了具体的修改步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1,

 

Checking build tools versions...
build/core/main.mk:76: ************************************************************
build/core/main.mk:77: You are attempting to build on a 32-bit system.
build/core/main.mk:78: Only 64-bit build environments are supported beyond froyo/2.2.
build/core/main.mk:79: ************************************************************
build/core/main.mk:80: *** stop.  Stop.


解决方法:

修改build/core/main.mk

#ifneq (64,$(findstring 64,$(build_arch)))
ifneq (i686,$(findstring i686,$(build_arch)))

 

2,

build/core/base_rules.mk:78: *** Module name: libasound
build/core/base_rules.mk:79: *** Makefile location: external/alsa-lib
build/core/base_rules.mk:80: * 
build/core/base_rules.mk:81: * Each module must use a LOCAL_MODULE_TAGS in its
build/core/base_rules.mk:82: * Android.mk. Possible tags declared by a module:
build/core/base_rules.mk:83: * 
build/core/base_rules.mk:84: *     optional, debug, eng, tests, samples
build/core/base_rules.mk:85: * 
build/core/base_rules.mk:86: * If the module is expected to be in all builds
build/core/base_rules.mk:87: * of a product, then it should use the
build/core/base_rules.mk:88: * "optional" tag: 
build/core/base_rules.mk:89: * 
build/core/base_rules.mk:90: *    Add "LOCAL_MODULE_TAGS := optional" in the
build/core/base_rules.mk:91: *    Android.mk for the affected module, and add
build/core/base_rules.mk:92: *    the LOCAL_MODULE value for that component
build/core/base_rules.mk:93: *    into the PRODUCT_PACKAGES section of product
build/core/base_rules.mk:94: *    makefile(s) where it's necessary, if
build/core/base_rules.mk:95: *    appropriate.
build/core/base_rules.mk:96: * 
build/core/base_rules.mk:97: * If the component should be in EVERY build of ALL
build/core/base_rules.mk:98: * products, then add its LOCAL_MODULE value to the
build/core/base_rules.mk:99: * PRODUCT_PACKAGES section of
build/core/base_rules.mk:100: * build/target/product/core.mk
build/core/base_rules.mk:101: * 
build/core/base_rules.mk:102: *** user tag detected on new module - user tags are only supported on legacy modules.  Stop.


解决方法:

      修改hardware/alsa_sound/Android.mk

      在android.mk文件中添加  LOCAL_MODULE_TAGS := optional

   注意:是在每个  include $(BUILD_SHARED_LIBRARY) 的前面添加LOCAL_MODULE_TAGS := optional

              共需要添加四处。

附:

user: 指该模块只在user版本下才编译
eng: 指该模块只在eng版本下才编译
tests: 指该模块只在tests版本下才编译
optional:指该模块在所有版本下都编译

 the BUILDTYPE is one of the following:

BuildtypeUse
userlimited access; suited for production
userdebuglike "user" but with root access and debuggability; preferred for debugging
engdevelopment configuration with additional debugging tools

 

 

3,

/usr/include/gnu/stubs.h:9:27: error: gnu/stubs-64.h: No such file or directory


解决方法:

   A,编译环境为32位系统的:在external/clearsilver/java-jni/Android.mk  文件中

         注译掉这两句:

            #LOCAL_CFLAGS += -m64
            #LOCAL_LDFLAGS += -m64

   B,64位系统+java1.6环境

           安装:

             apt-get install libc6-dev-amd64

             apt-get install g++-multilib lib64stdc++6
             apt-get install lib64z1-dev

 

    C,修改你的编译环境 32位+java1.5

 

4,  

Could not load 'clearsilver-jni'


解决方法:

    修改以下文件

    external/clearsilver/cgi/Android.mk
    external/clearsilver/util/Android.mk
    external/clearsilver/cs/Android.mk

         注译掉这两句:

            #LOCAL_CFLAGS += -m64
            #LOCAL_LDFLAGS += -m64

 

5,在imx51 patch_R10.3包中的default.xml文件有:

 <project path="external/alsa-lib" name="platform/external/alsa-lib" revision="refs/heads/master" />
    <project path="hardware/alsa_sound" name="platform/hardware/alsa_sound" revision="refs/heads/master" />
    <project path="external/alsa-utils" name="platform/external/alsa-utils" revision="refs/heads/master" />
    <project path="external/mtd-utils" name="platform/external/mtd-utils" revision="refs/heads/master" />


 

而原来的git地址:./repo init -u git://android.git.kernel.org/platform/manifest.git -bgingerbread  已不能下载了。

现在的下载地下为:repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.4_r1

上面的那些平台相关包:alsa-lib alsa_sound ...都不能下载了。只能用原来android2.2上的。

 

6,

target arm C++: libaudio <= hardware/alsa_sound/ALSAControl.cpp
target arm C: libasound <= external/alsa-lib/src/alisp/alisp.c
external/alsa-lib/src/alisp/alisp.c: In function 'F_princ':
external/alsa-lib/src/alisp/alisp.c:1716: error: format not a string literal and no format arguments


解决方法:

         alisp.c 1716 
   -   snd_output_printf(instance->out, p1->value.s);
  +   snd_output_printf(instance->out, "%s", p1->value.s);

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值