From 11a78f76702ce0066f1807173bf237b2c0fd340a Mon Sep 17 00:00:00 2001 From: lat9nq Date: Wed, 25 May 2022 21:00:44 -0400 Subject: [PATCH] checkrt: Sort symbols Some systems have out-of-order symbols in libstdc++, which fools the old logic into thinking the installed libstdc++ library is older than the included version. This causes problems with host libraries that need a newer libstdc++ library. Sort the symbols found in the library and use the last one. checkrt: Fix symbol sorting --- checkrt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkrt.c b/checkrt.c index 7607d61..35d2d5a 100644 --- a/checkrt.c +++ b/checkrt.c @@ -61,7 +61,7 @@ void checkrt(char *usr_in_appdir) char *stdcxx_bundle_lib = "./" CXXDIR "/libstdc++.so.6"; char *gcc_bundle_lib = "./" GCCDIR "/libgcc_s.so.1"; - const char *format = "tr '\\0' '\\n' < '%s' | grep -e '%s' | tail -n1"; + const char *format = "tr '\\0' '\\n' < '%s' | grep -e '%s' | sort -V | tail -n1"; if (access(stdcxx_bundle_lib, F_OK) == 0) { f = popen("PATH=\"/sbin:$PATH\" ldconfig -p | grep 'libstdc++.so.6 (" LIBC6_ARCH ")' | awk 'NR==1{print $NF}'", "r");