OSDN Git Service
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