abi-compliance-checker icon indicating copy to clipboard operation
abi-compliance-checker copied to clipboard

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

Open jczhang07 opened this issue 5 years ago • 4 comments

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 avatar May 16 '19 15:05 jczhang07

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/[email protected]/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.

jczhang07 avatar May 16 '19 16:05 jczhang07

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.

lvc avatar May 17 '19 05:05 lvc

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.

jczhang07 avatar May 17 '19 14:05 jczhang07

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

lvc avatar Jul 06 '19 06:07 lvc