abi-compliance-checker
abi-compliance-checker copied to clipboard
Errors not detected by abi-compliance-checker
Good afternoon, I did some tests with abi-compliance-checker, and I am surprised to see that it did not detect some changes I performed:
- Changed the return type of a public method
- Moved a class out of a namespace
- Changed a method signature (added parameters)
I am probably doing something really wrong, as these changes are not compatible and should be detected.
I used: abi-dumper-1.1 and vtable-dumper-1.2 to generate the dump files Then abi-compliance-checker-2.3 to compare them, no error nor warnings are detected.
I attached the two dump files generated from a small test library, were we can see the differences between versions. Cheers
Hi,
All symbols are detected as private for some reason.
Does abi-compliance-checker --test
show SUCCESS
on your system?
Could you please post declarations from TestABI_lib.h
too?
Thank you.
The test passed:
Verifying detectable C library changes /local/nmagnin/workspace_ARM7/TestABI_lib/libsample_c/libsample.v1 /local/nmagnin/workspace_ARM7/TestABI_lib/libsample_c/libsample.v2 Preparing, please wait ... Using GCC 4.8.5 (x86_64-redhat-linux, target: x86_64) Checking header(s) 1.0 ... Checking the code for C++ keywords Using C++ compatibility mode Checking header(s) 2.0 ... Checking the code for C++ keywords Using C++ compatibility mode Comparing ABIs ... Comparing APIs ... Creating compatibility report ... Binary compatibility: 56.4% Source compatibility: 79.4% Total binary compatibility problems: 79, warnings: 59 Total source compatibility problems: 38, warnings: 57 Report: compat_reports/libsample_c/1.0_to_2.0/compat_report.html Test result: SUCCESS (117 problems found)
Verifying detectable C++ library changes /local/nmagnin/workspace_ARM7/TestABI_lib/libsample_cpp/libsample.v1 /local/nmagnin/workspace_ARM7/TestABI_lib/libsample_cpp/libsample.v2 Preparing, please wait ... Using GCC 4.8.5 (x86_64-redhat-linux, target: x86_64) Checking header(s) 1.0 ... Checking header(s) 2.0 ... Comparing ABIs ... Comparing APIs ... Creating compatibility report ... Binary compatibility: 50.2% Source compatibility: 76.4% Total binary compatibility problems: 140, warnings: 75 Total source compatibility problems: 79, warnings: 45 Report: compat_reports/libsample_cpp/1.0_to_2.0/compat_report.html Test result: SUCCESS (219 problems found)
Here is the header, very simple test code:
namespace TestABI_lib {
class TestABI {
public: TestABI(double factor);
double getProduct(double value);
private: double factor; };
} // namespace TestABI_lib
FYI, the tests I did were using cross-compilation. I will try to use the host GCC to see if it works better...
OK it works fine using host GCC. Symbols are not private anymore. Can I pass a link to GCC used to compile the library to abi-dumper.pl ?
Looks like a problem with abi-dumper. It takes only compiled library objects as parameter.
Please dump debug info by the following command:
abi-dumper your_lib.so -extra-info ./debug-info
tar -cJf debug-info.txz ./debug-info
And send debug-info.txz archive here.
Thank you.
Done. FYI, I see this warning: WARNING: incompatible build option detected: -O0 (required -Og for better analysis) or WARNING: the object should be compiled with -Og option for better analysis
But apparently my GCC do not accept option -Og. I use -g -O0...
FYI, I tried to run abi-compliance-checker.pl --test on the target system (SLC6), and I got this error:
Using GCC 4.4.7 (x86_64-redhat-linux, target: x86_64)
Verifying detectable C library changes /nfs/nmagnin-cc7-tn/local/nmagnin/workspace_ARM7/TestABI_lib/libsample_c/libsample.v1 ERROR: can't compile libsample_c v.1: 'libsample_c/libsample.v1/build-log.txt'
file libsample_c/libsample.v1/build-log.txt contains:
cc1: error: invalid option argument -Og
I had no problem on target CC7 (GCC 4.8.5)
WARNING: incompatible build option detected: -O0 (required -Og for better analysis)
I have a similar problem - I'm able to run the compiler with the -Og
option but to avoid making a separate CMake build type for checking ABI (debugging with -Og
doesn't work well for me), I would like to keep it running with -O0
. So the question is how serious the warning is? Will I miss some ABI/API issue?