Ubuntu 64-bit compiling Android 4.0 source code
The following errors are specific and some are not encountered. The backups of data copies found on the Internet;
===== Error 1 ======
Host C ++: obbtool <= frameworks/base/tools/obbtool/Main. cpp
: 0: 0: Error: "_ fortify_source" redefined [-werror]
: 0: 0: Note: this is the location of the previous definition
Cc1plus: All warnings being treated as errors
Make: *** [out/host/linux-x86/obj/executables/obbtool_intermediates/Main. O] Error 1
===== Error 2 =====
Solution:
Build/CORE/Combo/HOST_linux-x86.mk line 61:
Put:
Host_global_cflags + =-d_fortify_source = 0
Changed:
Host_global_cflags + =-u_fortify_source-d_fortify_source = 0
Reference: http://code.google.com/p/android/issues/detail? Id = 20795
===== Error 3 ====
Development/tools/emulator/OpenGL/host/libs/Translator/glcommon/gldispatch. cpp: 22: 20: Fatal error: Gl/Glx. h: no such file or directory
Compilation terminated.
Make: *** [out/host/linux-x86/obj/static_libraries/libglcommon_intermediates/gldispatch. O] Error 1
Solution:
Sudo apt-Get install libgl1-mesa-dev
===== Error 4 ====
Frameworks/compile/slang/slang_rs_export_foreach.cpp: 247: 23: Error: Variable 'paramname' set but not used [-werror = Unused-but-set-variable]
Solution:
Vim frameworks/compile/slang/Android. mk
Put:
Local_cflags_for_slang: =-wno-sign-promo-wall-wno-unused-parameter-werror
Changed:
Local_cflags_for_slang: =-wno-sign-promo-wall-wno-unused-Parameter
Reference: http://code.google.com/p/android/issues/detail? Id = 22006 # C0
Reference: http://groups.google.com/group/android-building/browse_thread/thread/0207abb98ed72304
===== Error 5 =====
In file encoded ded from external/oprofile/libpp/arrange_profiles.cpp: 24: 0:
External/oprofile/libpp/format_output.h: 94: 22: Error: Reference 'counts' cannot be declared 'mutable' [-fpermissive]
Make: *** [out/host/linux-x86/obj/static_libraries/liboprofile_pp_intermediates/arrange_profiles.o] Error 1
Solution:
External/oprofile/libpp/format_output.h
Put:
Mutable counts_t & counts;
Changed:
Counts_t & counts;
===== Error 6 =====
External/llvm/lib/support/mutex. cpp: 143: Undefined reference to 'pthread _ mutex_trylock'
Collect2: LD returned 1 exit status
Solution:
Vim external/llvm/llvm-host-build.mk
Local_ldlibs: =-lpthread-LDL
The following solution fails:
VI external/llvm/lib/support/Android. mk
Add
Local_c_includes + = system/CORE/include/cutils
Local_shared_libraries: = libcutil
(Two modules exist. Add the above two sentences to both modules)
Add the threads. h header file to the mutex. cpp file.
VI external/llvm/lib/support/mutex. cpp
Add
# Include
Add the threads. h header file to the threading. cpp file.
VI external/llvm/lib/support/threading. cpp
Add
# Include
===== Error 7 =====
External/gtest/src/../include/gtest/Internal/gtest-param-util.h: 122: 11: Error: 'ptrdiff _ t' does not name a type
Solution:
Vim external/gtest/src/../include/gtest/Internal/gtest-param-util.h
# Include
====================
/Usr/bin/ld: cannot find-LZ
Resolve:
1) Lack of lib32z1-dev, installation can: APT-Get install lib32z1-dev
Lib64z1-dev => 64-bit
---------------------------------------------------------------------------
Solution to android4.0.1 compilation errors in Ubuntu 11.04
Category: Android Ubuntu 3570 people read comments (7) collect reports
1. Error 1: Error: 'ptrdiff _ t' does not name a type
In file encoded ded from external/gtest/src/../include/gtest/gtest-param-test.h: 157: 0,
From external/gtest/src/../include/gtest. h: 69,
From external/gtest/src/gtest_main.cc: 32:
External/gtest/src/../include/gtest/Internal/gtest-param-util.h: 122: 11: Error: 'ptrdiff _ t' does not name a type
In file encoded ded from external/gtest/src/../include/gtest/gtest-param-test.h: 157: 0,
From external/gtest/src/../include/gtest. h: 69,
From external/gtest/src/../src/gtest. CC: 34,
From external/gtest/src/gtest-all.cc: 36:
External/gtest/src/../include/gtest/Internal/gtest-param-util.h: 122: 11: Error: 'ptrdiff _ t' does not name a type
In file encoded ded from external/gtest/src/gtest-all.cc: 38: 0:
Solution:
$ VI external/gtest/src/../include/gtest/Internal/gtest-param-util.h
# Include <cstddef>
2. Error 2: Undefined reference to 'pthread _ mutexattr_destroy'
Host C ++: libgtest_host <= external/gtest/src/gtest-all.cc
True
Host C ++: libgtest_main_host <= external/gtest/src/gtest_main.cc
Out/host/linux-x86/obj/static_libraries/libllvmsupport_intermediates/libllvmsupport. A (signals. O): In function 'printstacktrack ':
/Home/AA/project/android4.0.1/external/llvm/lib/support/Unix/signals. Inc: 219: Undefined reference to 'dladd'
/Home/AA/project/android4.0.1/external/llvm/lib/support/Unix/signals. Inc: 231: Undefined reference to 'dladd'
Out/host/linux-x86/obj/static_libraries/libllvmsupport_intermediates/libllvmsupport. A (threading. o): In function 'llvm: llvm_execute_on_thread (void (*) (void *), void *, unsigned INT )':
/Home/AA/project/android4.0.1/external/llvm/lib/support/threading. cpp: 96: Undefined reference to 'pthread _ create'
/Home/AA/project/android4.0.1/external/llvm/lib/support/threading. cpp: 91: Undefined reference to 'pthread _ attr_setstacksize'
/Home/AA/project/android4.0.1/external/llvm/lib/support/threading. cpp: 100: Undefined reference to 'pthread _ join'
Out/host/linux-x86/obj/static_libraries/libllvmsupport_intermediates/libllvmsupport. A (mutex. O): In function 'muteximpl ':
/Home/AA/project/android4.0.1/external/llvm/lib/support/mutex. cpp: 69: Undefined reference to 'pthread _ mutexattr_init'
/Home/AA/project/android4.0.1/external/llvm/lib/support/mutex. cpp: 75: Undefined reference to 'pthread _ mutexattr_settype'
/Home/AA/project/android4.0.1/external/llvm/lib/support/mutex. cpp: 80: Undefined reference to 'pthread _ mutexattr_setpshared'
/Home/AA/project/android4.0.1/external/llvm/lib/support/mutex. cpp: 89: Undefined reference to 'pthread _ mutexattr_destroy'
Out/host/linux-x86/obj/static_libraries/libllvmsupport_intermediates/libllvmsupport. A (mutex. O): In function 'llvm: SYS: muteximpl: tryacquire ()':
/Home/AA/project/android4.0.1/external/llvm/lib/support/mutex. cpp: 143: Undefined reference to 'pthread _ mutex_trylock'
Collect2: LD returned 1 exit status
Make: *** [out/host/linux-x86/obj/executables/test-librsloader_intermediates/test-librsloader] Error 1
Make: *** waiting for unfinished jobs ....
Solution:
$ VI external/llvm/llvm-host-build.mk
Local_ldlibs: =-lpthread-LDL
The following solution fails and a new error occurs: errors again: Can't Find threads. h file or dir.
$ VI external/llvm/lib/support/Android. mk
Local_c_includes + = system/CORE/include/cutils
Local_shared_libraries: = libcutil
$ VI external/llvm/lib/support/mutex. cpp
# Include <threads. h>
$ VI external/llvm/lib/support/threading. cpp
# Include <threads. h>
3. Error 3: Error: Variable 'paramname' set but not used [-werror = Unused-but-set-variable]
Frameworks/compile/slang/slang_rs_export_foreach.cpp: 247: 23: Error: Variable 'paramname' set but not used [-werror = Unused-but-set-variable]
Cc1plus: All warnings being treated as errors
Solution:
$ VI frameworks/compile/slang/Android. mk
# Local_cflags_for_slang: =-wno-sign-promo-wall-wno-unused-parameter-werror
Local_cflags_for_slang: =-wno-sign-promo-wall-wno-unused-Parameter
These errors include gcc4.6 and android4.0, which are recorded on the official Ubuntu and Android websites. For details, see:
Http://code.google.com/p/android/issues/detail? Id = 22011
Http://code.google.com/p/android/issues/detail? Id = 22006 # C0
Http://groups.google.com/group/android-building/browse_thread/thread/0207abb98ed72304
Https://wiki.edubuntu.org/GCC4.6
------------------------------------------------------------------------------
/Usr/bin/ld: cannot find-lncurses
Collect2: LD returned 1 exit status
Make: *** [out/host/linux-x86/obj/executables/adb_intermediates/ADB] Error 1
This problem blocks me for a few days; because my system is 64-bit; I: sudo apt-Get install libncurses5-dev installed by default is also 64-bit; I don't know. I still need 32 bits each. I'm depressed;
Solution:
Sudo apt-Get install lib32ncurses5-dev
------------------------------------------------------------------------------
LD + LD
: //: Usr/bin/ld: cannot find-lstdc + cannot
Findfind--lstdccollect2: lstdc ++
Collect2: collect2: LD returned 1 exit status
LD returned 1 exit status
LD returned 1 exit statusmake: *** [out/host/linux-x86/obj/executables/aidl_intermediates/aidl] Error 1
Solution:
Sudo apt-Get install gcc-multilib
Sudo apt-Get install g ++-multilib
------------------------------------------------------------------------------
Ubuntu12.04 OMAP kernel compilation error summary:
2012/09/05/3
1: Make menuconfig appears many undefined reference to 'xxxxxxx '???
Resolve:
Sudo apt-Get install libncurses5-dev
2: Drivers/RTC/alarm. C: 16: 27: Fatal error: ASM/Mach/time. h: no such file or directory
Resolve:
ARCH/ARM/include/ASM/Mach/time. h does exist, but this error occurs;
Cp arch/ARM/include/ASM/time. h include/ASM/Mach/time. h
Http://labs.beatcraft.com/en/index.php? Android % 20for % 20x86
3: Sound/soc/soc-core.c: 946: 54: Error: 'Isa _ dma_threshold 'undeclared (first use in this function)
Resolve :???????????
------------------------------
2012/09/06/4
------------------------------
**************************************** **********************************
* Solve all the above three problems: sudo apt-Get install gcc-arm-Linux-gnueabi => cause ;*
* In ubuntu12.04 and later versions, the default cross-compiler downloaded is 4.6.3. The version is too high and the android source should be used *
* Code directory ~ /Prebuild /...... /Arm-eabi-4.4.3 /...... Compiler;
*
**************************************** **********************************
-------------------------------------------------------------------------------
2012/09/07/5
1: omap4boot compilation notes:
A) Only the cross compiler sudo apt-Get install gcc-arm-Linux-gnueabi can be used for mutation;
Bytes ------------------------------------------------------------------------------------