您的位置:首页 > 其它

在ubuntu x86_64 GCC4.6上ics编译错误以及解决办法

2012-10-12 16:28 399 查看
问题1:

<command-line>:0:0:warning:"_FORTIFY_SOURCE" redefined [enabled by default]

<built-in>:0:0:note: this is the location of theprevious definition

hostExecutable:mksnapshot(out/host/linux-x86/obj/EXECUTABLES/mksnapshot_intermediates/mksnapshot)

true

Install:out/host/linux-x86/bin/mksnapshot

Install:out/host/linux-x86/bin/mkyaffs2image

host C++:obbtool <=frameworks/base/tools/obbtool/Main.cpp

<command-line>:0:0:error: "_FORTIFY_SOURCE"redefined [-Werror]

<built-in>:0:0:note: this is the location of theprevious definition

cc1plus:all warnings being treated as errors

make:***[out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] Error 1

icscompile fail!

解决办法:参考http://code.google.com/p/android/issues/detail?id=20795

修改build/core/combo/HOST_linux-x86.mk:

-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0

+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE-D_FORTIFY_SOURCE=0

问题2:

make[1]: Leavingdirectory`ics/device/hisilicon/godbox/driver/sdk/msp/android_driver/RT3090_LinuxSTA_V2.3.1.4_20100222'

之后就报错了。看不出什么原因。重新make试试;

->重新make居然就过去了。

问题3:

external/mesa3d/src/glsl/linker.cpp:1394:49: error:expectedprimary-expression before ',' token

external/mesa3d/src/glsl/linker.cpp:1394:50:error:'varyings' was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1394:58:error:'offsetof' was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1395:48: error:expectedprimary-expression before ',' token

external/mesa3d/src/glsl/linker.cpp:1412:47: error:expectedprimary-expression before ',' token

external/mesa3d/src/glsl/linker.cpp:1412:48:error:'position' was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1414:47: error:expectedprimary-expression before ',' token

external/mesa3d/src/glsl/linker.cpp:1414:48:error:'pointSize' was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1424:47: error:expectedprimary-expression before ',' token

external/mesa3d/src/glsl/linker.cpp:1424:48:error:'position' was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1428:47: error:expectedprimary-expression before ',' token

external/mesa3d/src/glsl/linker.cpp:1428:48:error:'frontFacingPointCoord' was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1431:47: error:expectedprimary-expression before ',' token

external/mesa3d/src/glsl/linker.cpp:1431:48:error:'frontFacingPointCoord' was not declared in this scope

external/mesa3d/src/glsl/linker.cpp: In function'voidlink_shaders(const gl_context*, gl_shader_program*)':

external/mesa3d/src/glsl/linker.cpp:1734:49: error:expectedprimary-expression before ',' token

external/mesa3d/src/glsl/linker.cpp:1734:50:error:'fragColor' was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1734:59:error:'offsetof' was not declared in this scope

解决方法参考http://code.google.com/p/android/issues/detail?id=23206

Adding a "#include <stddef.h>" tolinker.cppfixes the issue

The full location of the linker.cpp fileis"external/mesa3d/src/glsl/linker.cpp" from with in yourandroidsource directory.

(Problem comes from host libstdc++. Since version4.6<cstdio> does not include <cstddef> anymore.

Downgrade host package to libstdc++ 4.5 or add'#include<cstddef>' into linker.cpp)

问题4:

external/oprofile/libpp/format_output.h:94:22:error:reference 'counts' cannot be declared 'mutable'

解决办法:http://code.google.com/p/android/issues/detail?id=22003

Fix/Work-around:

-mutable counts_t & counts;

+counts_t & counts;

问题5:

external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11:error:'ptrdiff_t' does not name a type

解决办法:http://code.google.com/p/android/issues/detail?id=22005

external/gtest/include/gtest/internal/gtest-param-util.h

#include<vector>

+#include <cstddef>

#include<gtest/internal/gtest-port.h>

问题6:external/llvm/lib/Support/Mutex.cpp:143:undefinedreference to `pthread_mutex_trylock'

解决方法:http://code.google.com/p/android/issues/detail?id=22011

Add "LOCAL_LDLIBS := -lpthread -ldl"inexternal/llvm/llvm-host-build.mk works for me.

问题7:frameworks/compile/slang/slang_rs_export_foreach.cpp:249:23:error:variable 'ParamName' set but not used

解决办法:

/article/11774435.html

$vimframeworks/compile/slang/Android.mk

将 local_cflags_for_slang 所在行最后的 -Werror 去掉:

#local_cflags_for_slang:=-Wno-sign-promo -Wall -Wno-unused-parameter -Werror

local_cflags_for_slang := -Wno-sign-promo-Wall-Wno-unused-parameter

另外,将gcc版本降低为4.4可以避免ics编译错误:

sudo apt-getinstall gcc-4.4

sudo apt-getinstall g++-4.4

sudo ln -s/usr/bin/gcc-4.4/usr/bin/gcc

sudo ln -s/usr/bin/g++-4.4/usr/bin/g++
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐