[Android Q&A, Help & Troubleshooting] Nikiz:
I am trying to port Cyanogenmod 12 to Trend 2 SM-G313HN, but there is a problem loading the video driver and it is stuck in a infinite bootloop. Looks like the library has some unknown calls or something. With CM11 the video worked.

Here is what logcat shows:

I/SurfaceFlinger( 2277): SurfaceFlinger is starting
I/SurfaceFlinger( 2277): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
E/libEGL ( 2277): load_driver(/system/lib/egl/libGLES_hawaii.so): dlopen failed: cannot locate symbol "ucnv_convertEx_51" referenced by "libGLES_hawaii.so"...
F/libEGL ( 2277): couldn't find an OpenGL ES implementation
F/libc ( 2277): Fatal signal 6 (SIGABRT), code -6 in tid 2277 (surfaceflinger)
I/DEBUG ( 1596): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 1596): Build fingerprint: 'samsung/cm_vivaltonfc3g/vivaltonfc3g:5.0.2/LRX22G/7bc057ecca:userdebug/test-keys'
I/DEBUG ( 1596): Revision: '1'
I/DEBUG ( 1596): ABI: 'arm'
I/DEBUG ( 1596): pid: 2277, tid: 2277, name: surfaceflinger >>> /system/bin/surfaceflinger <<<
I/DEBUG ( 1596): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
I/DEBUG ( 1596): Abort message: 'couldn't find an OpenGL ES implementation'
I/DEBUG ( 1596): r0 00000000 r1 000008e5 r2 00000006 r3 00000000
I/DEBUG ( 1596): r4 40012114 r5 00000006 r6 00000002 r7 0000010c
I/DEBUG ( 1596): r8 41a11550 r9 00000000 sl 00000000 fp be93da6c
I/DEBUG ( 1596): ip 000008e5 sp be93d4d8 lr 4002f539 pc 40054c6c cpsr 600f0010
I/DEBUG ( 1596):
I/DEBUG ( 1596): backtrace:
I/DEBUG ( 1596): #00 pc 00038c6c /system/lib/libc.so (tgkill+12)
I/DEBUG ( 1596): #01 pc 00013535 /system/lib/libc.so (pthread_kill+52)
I/DEBUG ( 1596): #02 pc 00014293 /system/lib/libc.so (raise+10)
I/DEBUG ( 1596): #03 pc 00010a75 /system/lib/libc.so (__libc_android_abort+36)
I/DEBUG ( 1596): #04 pc 0000f244 /system/lib/libc.so (abort+4)
I/DEBUG ( 1596): #05 pc 00007611 /system/lib/libcutils.so (__android_log_assert+88)
I/DEBUG ( 1596): #06 pc 00043565 /system/lib/libEGL.so
I/DEBUG ( 1596): #07 pc 00010a75 /system/lib/libEGL.so
I/DEBUG ( 1596): #08 pc 00011259 /system/lib/libEGL.so (eglGetDisplay+24)
I/DEBUG ( 1596): #09 pc 000189b3 /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::init()+70)
I/DEBUG ( 1596): #10 pc 000007e1 /system/bin/surfaceflinger
I/DEBUG ( 1596): #11 pc 0000f101 /system/lib/libc.so (__libc_init+44)
I/DEBUG ( 1596): #12 pc 000008d8 /system/bin/surfaceflinger
D/AT_Distributor( 1615): try to connect RIL
E/AT_Distributor( 1615): connection fail & retry connect(62)
I/DEBUG ( 1596):
I/DEBUG ( 1596): Tombstone written to: /data/tombstones/tombstone_01

SOLVED: I had to patch external/icu/icu4c/source/common/ucnv.c

diff --git a/external/icu/icu4c/source/common/ucnv.c b/external/icu/icu4c/source/common/ucnv.c
index bb4c068..3078368 100755
--- a/external/icu/icu4c/source/common/ucnv.c
+++ b/external/icu/icu4c/source/common/ucnv.c
@@ -2984,6 +2984,74 @@ U_STABLE void U_EXPORT2 UCNV_TO_U_CALLBACK_STOP_48 (
reason, err);
}

+U_CAPI void U_EXPORT2 ucnv_setToUCallBack_51 (UConverter * converter,
+ UConverterToUCallback newAction,
+ const void* newContext,
+ UConverterToUCallback *oldAction,
+ const void** oldContext,
+ UErrorCode * err) {
+ ucnv_setToUCallBack(converter, newAction, newContext,
+ oldAction, oldContext, err);
+}
+
+U_CAPI void U_EXPORT2 ucnv_close_51 (UConverter * converter) {
+ ucnv_close (converter);
+}
+
+U_CAPI void U_EXPORT2
+ucnv_setFromUCallBack_51 (UConverter * converter,
+ UConverterFromUCallback newAction,
+ const void* newContext,
+ UConverterFromUCallback *oldAction,
+ const void** oldContext,
+ UErrorCode * err) {
+
+ ucnv_setFromUCallBack(converter, newAction, newContext, oldAction,
+ oldContext, err);
+}
+
+U_CAPI void U_EXPORT2
+ucnv_convertEx_51 (UConverter *targetCnv, UConverter *sourceCnv,
+ char **target, const char *targetLimit,
+ const char **source, const char *sourceLimit,
+ UChar *pivotStart, UChar **pivotSource,
+ UChar **pivotTarget, const UChar *pivotLimit,
+ UBool reset, UBool flush,
+ UErrorCode *pErrorCode) {
+ ucnv_convertEx(targetCnv, sourceCnv, target, targetLimit, source,
+ sourceLimit, pivotStart, pivotSource,
+ pivotTarget, pivotLimit, reset, flush,
+ pErrorCode);
+}
+
+U_CAPI UConverter* U_EXPORT2
+ucnv_open_51 (const char *name,
+ UErrorCode * err) {
+ return ucnv_open(name, err);
+}
+
+U_STABLE void U_EXPORT2 UCNV_FROM_U_CALLBACK_STOP_51 (
+ const void *context,
+ UConverterFromUnicodeArgs *fromUArgs,
+ const UChar* codeUnits,
+ int32_t length,
+ UChar32 codePoint,
+ UConverterCallbackReason reason,
+ UErrorCode * err) {
+ return UCNV_FROM_U_CALLBACK_STOP(context, fromUArgs, codeUnits,
+ length, codePoint, reason, err);
+}
+
+U_STABLE void U_EXPORT2 UCNV_TO_U_CALLBACK_STOP_51 (
+ const void *context,
+ UConverterToUnicodeArgs *toUArgs,
+ const char* codeUnits,
+ int32_t length,
+ UConverterCallbackReason reason,
+ UErrorCode * err) {
+ return UCNV_TO_U_CALLBACK_STOP(context, toUArgs, codeUnits, length,
+ reason, err);
+}
#endif

/*