[Nexus 4 Q&A, Help & Troubleshooting] David:D:
Hey all,

Atm I'm trying to compile a PA based custom rom using the linaro toolchain I got from here: http://releases.linaro.org/13.09/components/android/toolchain/4.8

We solved every strict-aliasing errors and the rom builds fine. But my phone doesn't boot, it's stuck at a black screen.

Logcat shows the following error, including backtrace and everything:

W/Adreno200-GSL( 175): <os_lib_map:1300>: os_lib_map error: dlopen failed: cannot locate symbol "__popcountsi2" referenced by "libsc-a3xx.so"..., on '/system/lib/libsc-a3xx.so'
F/libc ( 175): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 283 (SurfaceFlinger)
I/DEBUG ( 173): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 173): Build fingerprint: 'google/occam/mako:4.3/JSS15J/737497:user/release-keys'
I/DEBUG ( 173): Revision: '11'
I/DEBUG ( 173): pid: 175, tid: 283, name: SurfaceFlinger >>> /system/bin/surfaceflinger <<<
I/DEBUG ( 173): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
I/DEBUG ( 173): r0 00000000 r1 00000000 r2 ffffffe0 r3 00000000
I/DEBUG ( 173): r4 00000001 r5 b6a90798 r6 00000000 r7 0000000e
I/DEBUG ( 173): r8 b6a8feac r9 00000001 sl 00000024 fp b72051e8
I/DEBUG ( 173): ip b6a8fed4 sp b6bb6948 lr b6a85b27 pc b6a85b26 cpsr 60000030
I/DEBUG ( 173): d0 0000000000000000 d1 0000000000000000
I/DEBUG ( 173): d2 0000000000000000 d3 0000000000000000
I/DEBUG ( 173): d4 06b306b206b106b0 d5 06b706b606b506b4
I/DEBUG ( 173): d6 06bb06ba06b906b8 d7 42c8000006bd06bc
I/DEBUG ( 173): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 173): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 173): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 173): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 173): d16 2022326973746e75 d17 636e657265666572
I/DEBUG ( 173): d18 6c22207962206465 d19 7833612d63736269
I/DEBUG ( 173): d20 2e2e2e226f732e78 d21 732f27206e6f202c
I/DEBUG ( 173): d22 696c2f6d65747379 d23 2d637362696c2f62
I/DEBUG ( 173): d24 0000000000000000 d25 404e000000000000
I/DEBUG ( 173): d26 4018000000000000 d27 0000000000000000
I/DEBUG ( 173): d28 0000000000000000 d29 0000000000000000
I/DEBUG ( 173): d30 0000000000000000 d31 4000000000000000
I/DEBUG ( 173): scr 20000010
I/DEBUG ( 173):
I/DEBUG ( 173): backtrace:
I/DEBUG ( 173): #00 pc 00004b26 /system/lib/libgsl.so (gsl_context_destroy+61)
I/DEBUG ( 173): #01 pc 00066995 /system/lib/egl/libGLESv2_adreno200.so (rb_context_destroy+540)
I/DEBUG ( 173): #02 pc 00066d17 /system/lib/egl/libGLESv2_adreno200.so (rb_context_create+738)
I/DEBUG ( 173): #03 pc 00046b81 /system/lib/egl/libGLESv2_adreno200.so (gl2_context_create+280)
I/DEBUG ( 173): #04 pc 000245f5 /system/lib/egl/libGLESv1_CM_adreno200.so (oglCreateContext+44)
I/DEBUG ( 173): #05 pc 000188cc /system/lib/egl/libEGL_adreno200.so (eglCreateClientApiContext+452)
I/DEBUG ( 173): #06 pc 0000f7d8 /system/lib/egl/libEGL_adreno200.so (qeglDrvAPI_eglCreateContext+2088)
I/DEBUG ( 173): #07 pc 00006614 /system/lib/egl/libEGL_adreno200.so (eglCreateContext+16)
I/DEBUG ( 173): #08 pc 0000f1f5 /system/lib/libEGL.so (eglCreateContext+60)
I/DEBUG ( 173): #09 pc 000215e5 /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::createGLContext(void*, void*)+52)
I/DEBUG ( 173): #10 pc 00024be1 /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::readyToRun()+120)
I/DEBUG ( 173): #11 pc 00011cbd /system/lib/libutils.so (android::Thread::_threadLoop(void*)+84)
I/DEBUG ( 173): #12 pc 0000c4ac /system/lib/libc.so (__thread_entry+72)
I/DEBUG ( 173): #13 pc 0000c6f4 /system/lib/libc.so (pthread_create+420)
I/DEBUG ( 173):
I/DEBUG ( 173): stack:
I/DEBUG ( 173): b6bb6908 00180019
I/DEBUG ( 173): b6bb690c 00000008
I/DEBUG ( 173): b6bb6910 b58ff000
I/DEBUG ( 173): b6bb6914 b58ff034
I/DEBUG ( 173): b6bb6918 00001000
I/DEBUG ( 173): b6bb691c b5525000
I/DEBUG ( 173): b6bb6920 b6ed2000 /system/lib/libc.so
I/DEBUG ( 173): b6bb6924 00000006
I/DEBUG ( 173): b6bb6928 00000001
I/DEBUG ( 173): b6bb692c 00000000
I/DEBUG ( 173): b6bb6930 00000000
I/DEBUG ( 173): b6bb6934 0000000e
I/DEBUG ( 173): b6bb6938 b6a8feac /system/lib/libgsl.so
I/DEBUG ( 173): b6bb693c b6a87d43 /system/lib/libgsl.so (os_mutex_lock+10)
I/DEBUG ( 173): b6bb6940 df0027ad
I/DEBUG ( 173): b6bb6944 00000000
I/DEBUG ( 173): #00 b6bb6948 00000001
I/DEBUG ( 173): b6bb694c b7207018 [heap]
I/DEBUG ( 173): b6bb6950 b6a4dbec
I/DEBUG ( 173): b6bb6954 b7208718 [heap]
I/DEBUG ( 173): b6bb6958 b6a48e60 /system/lib/egl/libGLESv2_adreno200.so
I/DEBUG ( 173): b6bb695c b720703c [heap]
I/DEBUG ( 173): b6bb6960 00000001
I/DEBUG ( 173): b6bb6964 b69cb999 /system/lib/egl/libGLESv2_adreno200.so (rb_context_destroy+544)
I/DEBUG ( 173): #01 b6bb6968 b7207018 [heap]
I/DEBUG ( 173): b6bb696c 00000000
I/DEBUG ( 173): b6bb6970 b6a4dbec
I/DEBUG ( 173): b6bb6974 b7207018 [heap]
I/DEBUG ( 173): b6bb6978 00001012
I/DEBUG ( 173): b6bb697c 00000000
I/DEBUG ( 173): b6bb6980 0000000e
I/DEBUG ( 173): b6bb6984 b6ed5310
I/DEBUG ( 173): b6bb6988 b6a90244 /system/lib/libgsl.so
I/DEBUG ( 173): b6bb698c b69cbd1b /system/lib/egl/libGLESv2_adreno200.so (rb_context_create+742)
I/DEBUG ( 173): #02 b6bb6990 00000010
I/DEBUG ( 173): b6bb6994 b6d2e675 /system/lib/libbinder.so (android::Parcel::ipcSetDataReference(unsigned char const*, unsigned int, unsigned int const*, unsigned int, void (*)(android::Parcel*, unsigned char const*, unsigned int, unsigned int const*, unsigned int, void*), void*)+26)
I/DEBUG ( 173): b6bb6998 00000000
I/DEBUG ( 173): b6bb699c b7204278 [heap]
I/DEBUG ( 173): b6bb69a0 b6a4dbe8
I/DEBUG ( 173): b6bb69a4 b7204ae0 [heap]
I/DEBUG ( 173): b6bb69a8 b72042a8 [heap]
I/DEBUG ( 173): b6bb69ac 00000000
I/DEBUG ( 173): b6bb69b0 b7204278 [heap]
I/DEBUG ( 173): b6bb69b4 b6d2bc8d /system/lib/libbinder.so (android::IPCThreadState::waitForResponse(android::Parcel*, int*)+200)
I/DEBUG ( 173): b6bb69b8 00000001
I/DEBUG ( 173): b6bb69bc b6d2b5c9 /system/lib/libbinder.so (android::IPCThreadState::freeBuffer(android::Parcel*, unsigned char const*, unsigned int, unsigned int const*, unsigned int, void*))
I/DEBUG ( 173): b6bb69c0 b7204278 [heap]
I/DEBUG ( 173): b6bb69c4 b6d2b84d /system/lib/libbinder.so (android::IPCThreadState::writeTransactionData(int, unsigned int, int, unsigned int, android::Parcel const&, int*)+140)
I/DEBUG ( 173): b6bb69c8 00000034
I/DEBUG ( 173): b6bb69cc 00000000
I/DEBUG ( 173): ........ ........
I/DEBUG ( 173):
I/DEBUG ( 173): memory near r5:
I/DEBUG ( 173): b6a90778 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a90788 b6a90244 00000000 0000000a 00000000
I/DEBUG ( 173): b6a90798 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a907a8 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a907b8 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a907c8 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a907d8 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a907e8 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a907f8 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a90808 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a90818 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a90828 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a90838 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a90848 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a90858 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b6a90868 00000000 00000000 00000000 00000000
I/DEBUG ( 173):
I/DEBUG ( 173): memory near r8:
I/DEBUG ( 173): b6a8fe8c b6a90798 b6a90738 b6ed5310 b6ed211c
I/DEBUG ( 173): b6a8fe9c b6ed530c b6a907b0 b6a907bc b6a907b8
I/DEBUG ( 173): b6a8feac 00000000 00000000 00000000 b6eae935
I/DEBUG ( 173): b6a8febc b6eae83d b6eaecdd b6eb4989 b6ea7208
I/DEBUG ( 173): b6a8fecc b6e9be69 b6ea5504 b6e98924 b6eac0b1
I/DEBUG ( 173): b6a8fedc b6eaac19 b6e9e4d5 b6eabb91 b6eaac9d
I/DEBUG ( 173): b6a8feec b6eaa5b1 b6e98a08 b6ea5c28 b6e9d34d
I/DEBUG ( 173): b6a8fefc b6eb6981 b6ea53c8 b6eb1341 b6ea549c
I/DEBUG ( 173): b6a8ff0c b6ea53e8 b6eb5e17 b6ea554c b6eb6911
I/DEBUG ( 173): b6a8ff1c b6e9737d b6e98339 b6e98359 b6e98349
I/DEBUG ( 173): b6a8ff2c b6e98369 b6e98379 b6ea7040 b6ea6bd0
I/DEBUG ( 173): b6a8ff3c b6eb176f b6eb1725 b6ea7264 b6ec26bf
I/DEBUG ( 173): b6a8ff4c b6ea7e21 b6eb18df b6eb18a1 b6eae629
I/DEBUG ( 173): b6a8ff5c b6e98628 b6e98680 b6e98718 b6e98d88
I/DEBUG ( 173): b6a8ff6c b6e9863c b6e98af8 b6e98e0c b6e98e4c
I/DEBUG ( 173): b6a8ff7c b6e98e68 b6ea5ee4 b6ec2960 b6ec2a3c
I/DEBUG ( 173):
I/DEBUG ( 173): memory near fp:
I/DEBUG ( 173): b72051c8 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b72051d8 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b72051e8 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b72051f8 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b7205208 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b7205218 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b7205228 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b7205238 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b7205248 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b7205258 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b7205268 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b7205278 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b7205288 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b7205298 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b72052a8 00000000 00000000 00000000 00000000
I/DEBUG ( 173): b72052b8 00000000 00000000 00000000 00000000
I/DEBUG ( 173):
I/DEBUG ( 173): memory near ip:
I/DEBUG ( 173): b6a8feb4 00000000 b6eae935 b6eae83d b6eaecdd
I/DEBUG ( 173): b6a8fec4 b6eb4989 b6ea7208 b6e9be69 b6ea5504
I/DEBUG ( 173): b6a8fed4 b6e98924 b6eac0b1 b6eaac19 b6e9e4d5
I/DEBUG ( 173): b6a8fee4 b6eabb91 b6eaac9d b6eaa5b1 b6e98a08
I/DEBUG ( 173): b6a8fef4 b6ea5c28 b6e9d34d b6eb6981 b6ea53c8
I/DEBUG ( 173): b6a8ff04 b6eb1341 b6ea549c b6ea53e8 b6eb5e17
I/DEBUG ( 173): b6a8ff14 b6ea554c b6eb6911 b6e9737d b6e98339
I/DEBUG ( 173): b6a8ff24 b6e98359 b6e98349 b6e98369 b6e98379
I/DEBUG ( 173): b6a8ff34 b6ea7040 b6ea6bd0 b6eb176f b6eb1725
I/DEBUG ( 173): b6a8ff44 b6ea7264 b6ec26bf b6ea7e21 b6eb18df
I/DEBUG ( 173): b6a8ff54 b6eb18a1 b6eae629 b6e98628 b6e98680
I/DEBUG ( 173): b6a8ff64 b6e98718 b6e98d88 b6e9863c b6e98af8
I/DEBUG ( 173): b6a8ff74 b6e98e0c b6e98e4c b6e98e68 b6ea5ee4
I/DEBUG ( 173): b6a8ff84 b6ec2960 b6ec2a3c b6e9900c b6e99014
I/DEBUG ( 173): b6a8ff94 b6e97970 b6e97a00 b6e97adc b6e97afc
I/DEBUG ( 173): b6a8ffa4 b6eb8239 b6e9cfad b6e97550 b6e9cd59
I/DEBUG ( 173):
I/DEBUG ( 173): memory near sp:
I/DEBUG ( 173): b6bb6928 00000001 00000000 00000000 0000000e
I/DEBUG ( 173): b6bb6938 b6a8feac b6a87d43 df0027ad 00000000
I/DEBUG ( 173): b6bb6948 00000001 b7207018 b6a4dbec b7208718
I/DEBUG ( 173): b6bb6958 b6a48e60 b720703c 00000001 b69cb999
I/DEBUG ( 173): b6bb6968 b7207018 00000000 b6a4dbec b7207018
I/DEBUG ( 173): b6bb6978 00001012 00000000 0000000e b6ed5310
I/DEBUG ( 173): b6bb6988 b6a90244 b69cbd1b 00000010 b6d2e675
I/DEBUG ( 173): b6bb6998 00000000 b7204278 b6a4dbe8 b7204ae0
I/DEBUG ( 173): b6bb69a8 b72042a8 00000000 b7204278 b6d2bc8d
I/DEBUG ( 173): b6bb69b8 00000001 b6d2b5c9 b7204278 b6d2b84d
I/DEBUG ( 173): b6bb69c8 00000034 00000000 00000000 00000000
I/DEBUG ( 173): b6bb69d8 00000000 00000000 000003e8 00000010
I/DEBUG ( 173): b6bb69e8 00000004 b6bb7028 b6bb7038 1a0a1f35
I/DEBUG ( 173): b6bb69f8 00000000 b7204278 b6bb6ad0 00000000
I/DEBUG ( 173): b6bb6a08 b6bb6aa0 00000000 00000002 b6d2bd8d
I/DEBUG ( 173): b6bb6a18 00000002 b6bb6aa0 b6bb6a44 b6bb6aa0
I/DEBUG ( 173):
I/DEBUG ( 173): code around pc:
I/DEBUG ( 173): b6a85b04 e9d16800 19122316 0305eb43 2316e9c1
I/DEBUG ( 173): b6a85b14 f910f002 46314a21 5002f858 f7ff4628
I/DEBUG ( 173): b6a85b24 6804f88e f8d44680 f1b99024 d1060f00
I/DEBUG ( 173): b6a85b34 f7ff4620 4628f9cb 464a4641 2301e00d
I/DEBUG ( 173): b6a85b44 62a36a20 f975f002 f0026a60 6a20fa60
I/DEBUG ( 173): b6a85b54 f95ef002 46282200 f7ff4641 4910f879
I/DEBUG ( 173): b6a85b64 68084479 f904f002 2a006962 6920dd05
I/DEBUG ( 173): b6a85b74 33fff04f f0016821 4631faaf f0014638
I/DEBUG ( 173): b6a85b84 4605fbe1 f0014620 4628fff1 83f8e8bd
I/DEBUG ( 173): b6a85b94 0000a3b0 ffffffe4 0000a686 ffffffe0
I/DEBUG ( 173): b6a85ba4 0000a624 43f0e92d f04fb093 46810848
I/DEBUG ( 173): b6a85bb4 4616460d 46422100 461f4668 edfaf7fe
I/DEBUG ( 173): b6a85bc4 9b1a981c 22104631 90119500 9306a801
I/DEBUG ( 173): b6a85bd4 97052601 f82ef002 22284c0c a807991b
I/DEBUG ( 173): b6a85be4 f828f002 447c490a 46482700 58624643
I/DEBUG ( 173): b6a85bf4 4516e9d2 eb4519a4 21090507 4516e9c2
I/DEBUG ( 173):
I/DEBUG ( 173): code around lr:
I/DEBUG ( 173): b6a85b04 e9d16800 19122316 0305eb43 2316e9c1
I/DEBUG ( 173): b6a85b14 f910f002 46314a21 5002f858 f7ff4628
I/DEBUG ( 173): b6a85b24 6804f88e f8d44680 f1b99024 d1060f00
I/DEBUG ( 173): b6a85b34 f7ff4620 4628f9cb 464a4641 2301e00d
I/DEBUG ( 173): b6a85b44 62a36a20 f975f002 f0026a60 6a20fa60
I/DEBUG ( 173): b6a85b54 f95ef002 46282200 f7ff4641 4910f879
I/DEBUG ( 173): b6a85b64 68084479 f904f002 2a006962 6920dd05
I/DEBUG ( 173): b6a85b74 33fff04f f0016821 4631faaf f0014638
I/DEBUG ( 173): b6a85b84 4605fbe1 f0014620 4628fff1 83f8e8bd
I/DEBUG ( 173): b6a85b94 0000a3b0 ffffffe4 0000a686 ffffffe0
I/DEBUG ( 173): b6a85ba4 0000a624 43f0e92d f04fb093 46810848
I/DEBUG ( 173): b6a85bb4 4616460d 46422100 461f4668 edfaf7fe
I/DEBUG ( 173): b6a85bc4 9b1a981c 22104631 90119500 9306a801
I/DEBUG ( 173): b6a85bd4 97052601 f82ef002 22284c0c a807991b
I/DEBUG ( 173): b6a85be4 f828f002 447c490a 46482700 58624643
I/DEBUG ( 173): b6a85bf4 4516e9d2 eb4519a4 21090507 4516e9c2

So the error is very likely caused by W/Adreno200-GSL( 175): <os_lib_map:1300>: os_lib_map error: dlopen failed: cannot locate symbol "__popcountsi2" referenced by "libsc-a3xx.so"..., on '/system/lib/libsc-a3xx.so'

which causes some function to try to execute code at 0x0 because dlopen returns NULL.

Now, does anyone know how I can solve this error? Are there some wrong ldlags?

You can have a look at the build system here: https://github.com/ModdedPA/android_build branch: linaro. There you should be able to see all linker flags etc.

Any help would be really appreciated!