Changes to cpp_rpc to make it work on Android (+ Hexagon offloading) (#5535)
authorKrzysztof Parzyszek <kparzysz@quicinc.com>
Fri, 8 May 2020 03:36:36 +0000 (22:36 -0500)
committerGitHub <noreply@github.com>
Fri, 8 May 2020 03:36:36 +0000 (11:36 +0800)
commit1b17b73b9310976fc95e1a6af871c5cdc0c0a346
tree8fd4fbee452e7ac348e6c3417d7e84e84bb7f767
parent786dfb6ab62094911202578acb23bea612dd4a91
Changes to cpp_rpc to make it work on Android (+ Hexagon offloading) (#5535)

* Changes to cpp_rpc to make it work on Android (+ Hexagon offloading)

- Implement getNextString to break up std::string into words. stringstream
  just doesn't work on Android.
- string::find_last_of doesn't look for the last substring, but the
  last character from a given string.
- Use SIGTERM to terminate processes (this isn't necessary, but using
  SIGKILL is not a good practice).
- Convert "./rpc" to a full path. When a module is uploaded and offloaded
  to Hexagon, the dlopen on Hexagon needs an absolute path (or a path
  without directories).

* Only set the absolute patch on non-Windows platforms

Windows has different macros for the maximum path length.
apps/cpp_rpc/rpc_env.cc
apps/cpp_rpc/rpc_server.cc