lvc / abi-compliance-checker

A tool for checking backward API/ABI compatibility of a C/C++ library
https://lvc.github.io/abi-compliance-checker/
GNU Lesser General Public License v2.1
621 stars 76 forks source link

Is it possible to use the tool on Mac with clang? #91

Open jczhang07 opened 5 years ago

jczhang07 commented 5 years ago

On my Mac, I have

$gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)

Is it still possible to use the tool? Thanks.

jczhang07 commented 5 years ago

My library was compiled with clang. Following instructions, I installed gcc-4.9 and used --gcc-path=gcc-4.9 Here is part of the error message in log.txt:

/usr/local/Cellar/gcc@4.9/4.9.4_1/lib/gcc/4.9/gcc/x86_64-apple-darwin17.3.0/4.9.4/include-fixed/stdint.h:27:32: fatal error: sys/_types/_int8_t.h: No such file or directory
 #include <sys/_types/_int8_t.h>
                                ^
compilation terminated.
lvc commented 5 years ago

Try to add this section of the descriptor:

<add_include_paths>
    /include/path1
    /include/path2
    ....
</add_include_paths>

/include/path1 is a path to sys/_types/_int8_t.h in your system.

jczhang07 commented 5 years ago

That is not feasible. I am supposed to write a script and let other colleagues to use. I don't know what headers are missing on their machine and where they are. I am now trying the ABI_DUMPER approach on Mac. It needs elfutils, but "brew install" can not find it. I tried "spack install elfutils". spack has this package but the installation failed. I am still trying to find a workaround. Thank you.

UPDATE: I tried to install elfutils myself, but failed with errors after errors.

lvc commented 5 years ago

Need to use gobjdump --dwarf=info or dwarfdump instead of elfutils on Mac.