Fix two issues with hosting on SunOS (#36527)
authorAdeel Mujahid <adeelbm@outlook.com>
Thu, 21 May 2020 04:10:26 +0000 (07:10 +0300)
committerGitHub <noreply@github.com>
Thu, 21 May 2020 04:10:26 +0000 (21:10 -0700)
commit733003c51c5f682f108b367802ec262292601516
tree7ca9f280f7527e90c60ef10a63577717edb76b51
parentab49e0f9dcd56958148827c6b47428b56187b5f8
Fix two issues with hosting on SunOS (#36527)

Fix two issues with hosting on SunOS:
* Compile corehost without use-cxa-atexit with gcc
* Disable RapidJson's 48-bit optimization on SunOS

* Compile without [`use-cxa-atexit`](https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html) in case of gcc
  * libc tries to invoke `pthread_cond_destroy()` in `dlclose()`ed fxr library in the consumer code. PR disables this feature.
  * Backtrace available at http://sprunge.us/bx4dlk. This happens _after_ the main() exits.
* Disable RapidJson's 48-bit pointer optimization on SunOS.
  * This optimization relies on zeros in higher 16-bits, whereas SunOS has 1s. More details at https://github.com/Tencent/rapidjson/issues/1596.
  * The impact here was that `runtimeOptions` key available in `hwapp.runtimeconfig.json` was not located by RapidJson's `FindMember()` API and we were getting `false` from: https://github.com/dotnet/runtime/blob/78b303df8fbb242985d049a277d0d199cafd51b5/src/installer/corehost/cli/runtime_config.cpp#L416-L422

Contributes to: #34944.
src/installer/corehost/CMakeLists.txt
src/installer/corehost/cli/json_parser.h