From 28d5ffbab09070ed7cf233fe5ea550a0b398eee6 Mon Sep 17 00:00:00 2001 From: Akhil Mohan Date: Tue, 24 Mar 2026 07:53:59 +0530 Subject: [PATCH] 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 Signed-off-by: Aleksa Sarai --- script/build-libpathrs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build-libpathrs.sh b/script/build-libpathrs.sh index 28bdc67f4..721e611f7 100755 --- a/script/build-libpathrs.sh +++ b/script/build-libpathrs.sh @@ -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"