OSDN Git Service

Avoid pulling libdrm.so from the AOSP host build
authorAlistair Delva <adelva@google.com>
Fri, 28 Aug 2020 17:28:11 +0000 (10:28 -0700)
committerAlistair Delva <adelva@google.com>
Fri, 28 Aug 2020 20:41:34 +0000 (13:41 -0700)
commit70742d1caa3065b57b72ade546ac254314d874ef
tree74b94055aeecd6ff97c3225a4b083c0f2e3575bc
parent30d997f31d2e7bd542bfdf7676c5715c2b537feb
Avoid pulling libdrm.so from the AOSP host build

When binaries depending on minigbm/gbm on the host are linked to it, it
will cause libdrm.so to be taken from the host build done by the Android
build system (i.e. out/host/linux-x86/lib64/libdrm.so), but usually this
library is used with binary GPU drivers that are built out-of-tree, and
they will use the libdrm.so from the host system
(i.e. /usr/lib/x86_64-linux-gnu/libdrm.so.2). As libdrm uses globals to
store things like the ctx hashtable, only one libdrm.so can be loaded
into memory at the same time, or weird crashes in drmClose() and other
drm API functions will occur.

This workaround is only applied to the host "libgbm.so" target, which is
only used by crosvm currently.

Change-Id: Iedcb65d9a031220d8c095fd54a1b967647eb537c
Android.bp