@@ -13,12 +13,12 @@ OLD_VARS=_old_vars.txt
1313NEW_VARS=_new_vars.txt
1414
1515# Extract function symbols from the old and new libraries
16- nm -C --defined-only $OLD_LIB | c++filt | awk ' $2 ~ /[TW ]/ {print substr($0, index($0,$3))}' | sort > $OLD_FUNCS
17- nm -C --defined-only $NEW_LIB | c++filt | awk ' $2 ~ /[TW ]/ {print substr($0, index($0,$3))}' | sort > $NEW_FUNCS
16+ nm -C --defined-only $OLD_LIB | c++filt | awk ' $2 ~ /[TWt ]/ {print substr($0, index($0,$3))}' | sort > $OLD_FUNCS
17+ nm -C --defined-only $NEW_LIB | c++filt | awk ' $2 ~ /[TWt ]/ {print substr($0, index($0,$3))}' | sort > $NEW_FUNCS
1818
1919# Extract variable symbols from the old and new libraries
20- nm -C --defined-only $OLD_LIB | c++filt | awk ' $2 ~ /[BDG ]/ {print substr($0, index($0,$3))}' | sort > $OLD_VARS
21- nm -C --defined-only $NEW_LIB | c++filt | awk ' $2 ~ /[BDG ]/ {print substr($0, index($0,$3))}' | sort > $NEW_VARS
20+ nm -C --defined-only $OLD_LIB | c++filt | awk ' $2 ~ /[BDGVs ]/ {print substr($0, index($0,$3))}' | sort > $OLD_VARS
21+ nm -C --defined-only $NEW_LIB | c++filt | awk ' $2 ~ /[BDGVs ]/ {print substr($0, index($0,$3))}' | sort > $NEW_VARS
2222
2323# Initialize error flag and message
2424error_flag=0
@@ -28,29 +28,29 @@ error_message=""
2828removed_funcs=$( comm -23 $OLD_FUNCS $NEW_FUNCS )
2929if [ -n " $removed_funcs " ]; then
3030 error_flag=1
31- error_message+=" [Removed Functions]\n$removed_funcs \n"
31+ error_message+=" [Removed Functions]\n$removed_funcs \n\n "
3232fi
3333
3434# Check for removed variable symbols
3535removed_vars=$( comm -23 $OLD_VARS $NEW_VARS )
3636if [ -n " $removed_vars " ]; then
3737 error_flag=1
38- error_message+=" [Removed Variables]\n$removed_vars \n"
38+ error_message+=" [Removed Variables]\n$removed_vars \n\n "
3939fi
4040
4141# Check for added variable symbols
4242added_vars=$( comm -13 $OLD_VARS $NEW_VARS )
4343if [ -n " $added_vars " ]; then
4444 error_flag=1
45- error_message+=" [Added Variables]\n$added_vars \n"
45+ error_message+=" [Added Variables]\n$added_vars \n\n "
4646fi
4747
4848# Remove temporary files
4949rm -f $NEW_FUNCS $OLD_FUNCS $OLD_VARS $NEW_VARS
5050
5151# Display error messages if any
5252if [ " $error_flag " -eq 1 ]; then
53- echo -e " $error_message "
53+ echo -en " $error_message "
5454 echo " ABI compatibility check failed."
5555 exit 1
5656fi
0 commit comments