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
This commit is contained in:
lat9nq 2022-05-25 21:00:44 -04:00
parent ee8125b637
commit 11a78f7670

View File

@ -61,7 +61,7 @@ void checkrt(char *usr_in_appdir)
char *stdcxx_bundle_lib = "./" CXXDIR "/libstdc++.so.6"; char *stdcxx_bundle_lib = "./" CXXDIR "/libstdc++.so.6";
char *gcc_bundle_lib = "./" GCCDIR "/libgcc_s.so.1"; 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) { 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"); f = popen("PATH=\"/sbin:$PATH\" ldconfig -p | grep 'libstdc++.so.6 (" LIBC6_ARCH ")' | awk 'NR==1{print $NF}'", "r");