mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
[1.5] use POSIX regex in libpathrs build
word boundary anchor \> is present only in GNU awk implementation. This
will not work if we are building libpathrs inside a container like
debian/ubuntu which uses mawk. Therefore switch to a POSIX compatible
regex that can be used with all implementations of awk to find the
system libc path
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
(cherry picked from commit 28d5ffbab0)
Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
This commit is contained in:
committed by
Aleksa Sarai
parent
e1c1378fc9
commit
aa17fa3876
@@ -99,7 +99,7 @@ function build_libpathrs() {
|
||||
# /proc/self/maps and parse out the parent directory of the libc.so being
|
||||
# used.
|
||||
local native_libdir libdir=
|
||||
native_libdir="$(awk '$NF ~ /\/libc\>.*\.so/ { print $NF; }' /proc/self/maps |
|
||||
native_libdir="$(awk '$NF ~ /\/libc([.-].*)?\.so/ { print $NF }' /proc/self/maps |
|
||||
sort -u | head -n1 | xargs dirname)"
|
||||
if [[ "$native_libdir" == "$dest/"* ]]; then
|
||||
libdir="$native_libdir"
|
||||
|
||||
Reference in New Issue
Block a user