# HG changeset patch # User Tassilo Philipp # Date 1663663149 -7200 # Node ID 1586812f8eede527d7fb4fb0946d09eff7ac4ad9 # Parent 82aa83f0926492d668c134e0186043fa7d428ce9 - test/dynload_plain: fixed libc.so deduction fallback diff -r 82aa83f09264 -r 1586812f8eed test/dynload_plain/Makefile.embedded --- a/test/dynload_plain/Makefile.embedded Tue Sep 20 10:29:23 2022 +0200 +++ b/test/dynload_plain/Makefile.embedded Tue Sep 20 10:39:09 2022 +0200 @@ -13,7 +13,7 @@ # deduce path to default libc.so file, easier to do via shell than in code # (see main() in dynload_plain.c); get from what ${TEST_C_LD} is linked # against, then reinvoke make with actual build - export X=`((ldd ${TEST_C_LD} | awk '/libc\.so/{for(i=1;i<=NF;++i){if($$i ~ "^/")print $$i}}' || ls /lib*/libc.so* || ls /usr/lib/libc.so*) | grep -v '\.a$$' | (sort -V -r || sort -t . -n -k 2)) 2>/dev/null | head -1`; \ + export X=`((ldd ${TEST_C_LD} | awk '/libc\.so/{for(i=1;i<=NF;++i){if($$i~"^/"){print $$i;++r}}}END{exit !r}' || ls /lib*/libc.so* || ls /usr/lib/libc.so*) | grep -v '\.a$$' | (sort -V -r || sort -t . -n -k 2)) 2>/dev/null | head -1`; \ ${MAKE} DEF_C_DYLIB="$$X" ${APP} .PHONY: all clean diff -r 82aa83f09264 -r 1586812f8eed test/dynload_plain/Makefile.generic --- a/test/dynload_plain/Makefile.generic Tue Sep 20 10:29:23 2022 +0200 +++ b/test/dynload_plain/Makefile.generic Tue Sep 20 10:39:09 2022 +0200 @@ -12,7 +12,7 @@ # deduce path to default libc.so file, easier to do via shell than in code # (see main() in dynload_plain.c); get from what ${TEST_C_LD} is linked # against, then reinvoke make with actual build - export X=`((ldd ${TEST_C_LD} | awk '/libc\.so/{for(i=1;i<=NF;++i){if($$i ~ "^/")print $$i}}' || ls /lib*/libc.so* || ls /usr/lib/libc.so*) | grep -v '\.a$$' | (sort -V -r || sort -t . -n -k 2)) 2>/dev/null | head -1`; \ + export X=`((ldd ${TEST_C_LD} | awk '/libc\.so/{for(i=1;i<=NF;++i){if($$i~"^/"){print $$i;++r}}}END{exit !r}' || ls /lib*/libc.so* || ls /usr/lib/libc.so*) | grep -v '\.a$$' | (sort -V -r || sort -t . -n -k 2)) 2>/dev/null | head -1`; \ ${MAKE} DEF_C_DYLIB="$$X" ${APP} ${TEST_C_LD}: # dummy bin built with same toolchain and flags to deduce default c lib this is linked with