posted by bluelimn 2013.07.02 13:20

external/mesa3d/src/glsl/linker.cpp: In function ‘void assign_varying_locations(gl_shader_program*, gl_shader*, gl_shader*)’:

external/mesa3d/src/glsl/linker.cpp:1395:8: error: expected primary-expression before ‘,’ token

external/mesa3d/src/glsl/linker.cpp:1395:9: error: ‘varyings’ was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1395:17: error: ‘offsetof’ was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1398:48: error: expected primary-expression before ‘,’ token

external/mesa3d/src/glsl/linker.cpp:1415:47: error: expected primary-expression before ‘,’ token

external/mesa3d/src/glsl/linker.cpp:1415:48: error: ‘position’ was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1417:47: error: expected primary-expression before ‘,’ token

external/mesa3d/src/glsl/linker.cpp:1417:48: error: ‘pointSize’ was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1427:47: error: expected primary-expression before ‘,’ token

external/mesa3d/src/glsl/linker.cpp:1427:48: error: ‘position’ was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1431:47: error: expected primary-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:1434:47: error: expected primary-expression before ‘,’ token

external/mesa3d/src/glsl/linker.cpp:1434:48: error: ‘frontFacingPointCoord’ was not declared in this scope

external/mesa3d/src/glsl/linker.cpp: In function ‘void link_shaders(const gl_context*, gl_shader_program*)’:

external/mesa3d/src/glsl/linker.cpp:1737:49: error: expected primary-expression before ‘,’ token

external/mesa3d/src/glsl/linker.cpp:1737:50: error: ‘fragColor’ was not declared in this scope

external/mesa3d/src/glsl/linker.cpp:1737:59: error: ‘offsetof’ was not declared in this scope

make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1


./external/mesa3d/src/glsl/linker.cpp

linker.cpp 파일에 "#include <stddef.h>" 을 추가하는 것으로 해결할 수 있다.



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)':

/work/john/android-x86/external/llvm/lib/Support/Threading.cpp:96: undefined reference to `pthread_create'

/work/john/android-x86/external/llvm/lib/Support/Threading.cpp:91: undefined reference to `pthread_attr_setstacksize'

/work/john/android-x86/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':

/work/john/android-x86/external/llvm/lib/Support/Mutex.cpp:69: undefined reference to `pthread_mutexattr_init'

/work/john/android-x86/external/llvm/lib/Support/Mutex.cpp:75: undefined reference to `pthread_mutexattr_settype'

/work/john/android-x86/external/llvm/lib/Support/Mutex.cpp:80: undefined reference to `pthread_mutexattr_setpshared'

/work/john/android-x86/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()':

/work/john/android-x86/external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock'


vi external/llvm/lib/Support/Android.mk -> add "LOCAL_C_INCLUDES += system/core/include/cutils" "LOCAL_SHARED_LIBRARIES := libcutil" at 2 positions; 

and add "#include <threads.h>" in "external/llvm/lib/Support/Mutex.cpp,Threading.cpp"




host Executable: test-librsloader (out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader)

out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Signals.o): In function `PrintStackTrace':

/home/yarang/a10_works/gihub/android4.0.1/external/llvm/lib/Support/Unix/Signals.inc:219: undefined reference to `dladdr'

/home/yarang/a10_works/gihub/android4.0.1/external/llvm/lib/Support/Unix/Signals.inc:231: undefined reference to `dladdr'

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/yarang/a10_works/gihub/android4.0.1/external/llvm/lib/Support/Threading.cpp:96: undefined reference to `pthread_create'

/home/yarang/a10_works/gihub/android4.0.1/external/llvm/lib/Support/Threading.cpp:91: undefined reference to `pthread_attr_setstacksize'

/home/yarang/a10_works/gihub/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/yarang/a10_works/gihub/android4.0.1/external/llvm/lib/Support/Mutex.cpp:69: undefined reference to `pthread_mutexattr_init'

/home/yarang/a10_works/gihub/android4.0.1/external/llvm/lib/Support/Mutex.cpp:75: undefined reference to `pthread_mutexattr_settype'

/home/yarang/a10_works/gihub/android4.0.1/external/llvm/lib/Support/Mutex.cpp:80: undefined reference to `pthread_mutexattr_setpshared'

/home/yarang/a10_works/gihub/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/yarang/a10_works/gihub/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] 오류 1


에러에 대한 처리는 -lpthread 옵션을 추가하여 pthread를 참조할 수 있도록 한다.


수정해야할 파일은 /home/yarang/a10_works/gihub/android4.0.1/external/llvm/llvm-host-build.mk 이며, 다음의 내용을 추가한다.


LOCAL_LDLIBS := -lpthread -ldl 





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


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

 #include <vector> 

+#include <cstddef> 

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