secilc is using bootstrap Bionic

secilc is a program that is executed very early by init. Mark it as
'bootstrap: true' so that DT_INTERP is set to point to the dynamic
linker for the bootstrap processes. Also RPATH is set to the bootstrap
Bionic path so that this executable can search Bionic libs even before
init makes them visible to the ordinary search path of /system/lib.

Bug: 120266448
Test: m secilc
Inspect DT_INTERP and RPATH with readelf
DT_INTERP: /system/bin/bootstrap/linker64
RPATH: /system/${LIB}/bootstrap

Change-Id: Icb6e2fd37dced18c4cac83fb38e8a28739b34cab
This commit is contained in:
Jiyong Park 2019-01-17 01:45:54 +09:00 committed by Nicolas Geoffray
parent 1633b76f8a
commit af852b9320

View file

@ -11,4 +11,13 @@ cc_binary {
srcs: ["secilc.c"],
static_libs: ["libsepol"],
stl: "none",
// secilc is a program that is executed very early by init.
// Since it is before the mount namespaces are setup, /system/bin/linker
// and /system/lib/libc.so point to the mount points where nothing
// is mounted on yet. Therefore, secilc has to have explicit knowledge about
// the paths where the bootstrap Bionic is. bootstrap:true sets DT_INTERP to
// /system/bin/bootstrap/linker. RPATH is explicitly set to /system/lib/bootstrap
// where the bootstrap libc.so is.
bootstrap: true,
ldflags: ["-Wl,--rpath,/system/${LIB}/bootstrap"],
}