@@ -13,12 +13,12 @@ OLD_VARS=_old_vars.txt
13
13
NEW_VARS=_new_vars.txt
14
14
15
15
# 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
18
18
19
19
# 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
22
22
23
23
# Initialize error flag and message
24
24
error_flag=0
@@ -28,29 +28,29 @@ error_message=""
28
28
removed_funcs=$( comm -23 $OLD_FUNCS $NEW_FUNCS )
29
29
if [ -n " $removed_funcs " ]; then
30
30
error_flag=1
31
- error_message+=" [Removed Functions]\n$removed_funcs \n"
31
+ error_message+=" [Removed Functions]\n$removed_funcs \n\n "
32
32
fi
33
33
34
34
# Check for removed variable symbols
35
35
removed_vars=$( comm -23 $OLD_VARS $NEW_VARS )
36
36
if [ -n " $removed_vars " ]; then
37
37
error_flag=1
38
- error_message+=" [Removed Variables]\n$removed_vars \n"
38
+ error_message+=" [Removed Variables]\n$removed_vars \n\n "
39
39
fi
40
40
41
41
# Check for added variable symbols
42
42
added_vars=$( comm -13 $OLD_VARS $NEW_VARS )
43
43
if [ -n " $added_vars " ]; then
44
44
error_flag=1
45
- error_message+=" [Added Variables]\n$added_vars \n"
45
+ error_message+=" [Added Variables]\n$added_vars \n\n "
46
46
fi
47
47
48
48
# Remove temporary files
49
49
rm -f $NEW_FUNCS $OLD_FUNCS $OLD_VARS $NEW_VARS
50
50
51
51
# Display error messages if any
52
52
if [ " $error_flag " -eq 1 ]; then
53
- echo -e " $error_message "
53
+ echo -en " $error_message "
54
54
echo " ABI compatibility check failed."
55
55
exit 1
56
56
fi
0 commit comments