[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:
Akhil Mohan
2026-03-24 07:53:59 +05:30
committed by Aleksa Sarai
parent e1c1378fc9
commit aa17fa3876
+1 -1
View File
@@ -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"