Skip to content

Commit

Permalink
LD_LIBRARY_PATH might be already well set
Browse files Browse the repository at this point in the history
  • Loading branch information
JingMatrix committed Sep 16, 2024
1 parent db9b97e commit 9c1c638
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions dex2oat/src/main/cpp/dex2oat.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ int main(int argc, char **argv) {
new_argv[argc] = "--inline-max-code-units=0";
new_argv[argc + 1] = NULL;

char const *libenv =
"LD_LIBRARY_PATH=/system/lib64:/system/lib:"
"/apex/com.android.art/lib64:/apex/com.android.art/lib:"
"/apex/com.android.os.statsd/lib64:/apex/com.android.os.statsd/lib";
putenv((char *)libenv);
if (getenv("LD_LIBRARY_PATH") == NULL) {
char const *libenv =
"LD_LIBRARY_PATH=/system/lib64:/system/lib:"
"/apex/com.android.art/lib64:/apex/com.android.art/lib:"
"/apex/com.android.os.statsd/lib64:/apex/com.android.os.statsd/lib";
putenv((char *)libenv);
}
fexecve(stock_fd, (char **)new_argv, environ);
PLOGE("fexecve failed");
return 2;
Expand Down

0 comments on commit 9c1c638

Please sign in to comment.