Adding dlerr() diagnostics for libicu dlsym errors (#17454)
authorDebayan Ghosh <debayang.qdt@qualcommdatacenter.com>
Mon, 9 Apr 2018 16:03:07 +0000 (21:33 +0530)
committerTarek Mahmoud Sayed <tarekms@microsoft.com>
Mon, 9 Apr 2018 16:03:07 +0000 (09:03 -0700)
src/corefx/System.Globalization.Native/icushim.cpp

index 42193ba..b02bd49 100644 (file)
@@ -254,7 +254,7 @@ extern "C" int32_t GlobalizationNative_LoadICU()
     static_assert((sizeof(#fn) + MaxICUVersionStringLength + 1) <= sizeof(symbolName), "The symbolName is too small for symbol " #fn); \
     sprintf(symbolName, #fn "%s", symbolVersion); \
     fn##_ptr = (decltype(fn)*)dlsym(lib, symbolName); \
-    if (fn##_ptr == NULL) { fprintf(stderr, "Cannot get symbol %s from " #lib "\n", symbolName); abort(); }
+    if (fn##_ptr == NULL) { fprintf(stderr, "Cannot get symbol %s from " #lib "\nError: %s\n", symbolName, dlerror()); abort(); }
 
     FOR_ALL_ICU_FUNCTIONS
 #undef PER_FUNCTION_BLOCK