Development

Application Binary Interface (ABI) compliance checker

chbae 2023. 4. 20. 05:07
728x90

ABI Compliance Checker (ABICC)

ABI Compliance Checker (ABICC) is a tool for checking backward binary and source-level compatibility of a C/C++ library. The tool checks header files and shared objects of old and new versions and analyzes changes in API and ABI (ABI=API+compiler ABI) that may break binary and/or source compatibility: changes in calling stack, v-table changes, removed symbols, renamed fields, etc.

 

ABICC는 C/C++ library에 대해 binary code, source code의 backward compatibility 를 확인할 수 있는 도구이다.

설치

설치하기 전 필요한 도구

  • G++ (3.0-4.7, 4.8.3 or newer)
  • GNU Binutils (readelf, c++filt, objdump)
  • Perl 5 (5.8 or newer)
  • Ctags (5.8 or newer)

Download: https://github.com/lvc/abi-compliance-checker/

 

GitHub - lvc/abi-compliance-checker: A tool for checking backward API/ABI compatibility of a C/C++ library

A tool for checking backward API/ABI compatibility of a C/C++ library - GitHub - lvc/abi-compliance-checker: A tool for checking backward API/ABI compatibility of a C/C++ library

github.com

 cd abi-compliance-checker-x.y.z/   
 sudo make install prefix=PREFIX [/usr, /usr/local, ...]

 

PREFIX/bin 디렉토리에 abi-compliance-checker 바이너리가 생성된다.

사용법

기본적인 사용법은 아래와 같고 추가 옵션은 abi-compliance-check --help를 이용하면 자세하게 볼 수 있다.

abi-compliance-checker -lib NAME -old V1.xml -new V2.xml

 

위의 실행과정 중 NAME은 라이브러리 이름이고, old와 new 뒤에 비교하고자 하는 대상에 대한 정보를 xml 파일을 다음과 같은 형식으로 넣는다.

 <version>  
   0.3.4  
 </version>  
 <headers>  
   /usr/local/libssh/0.3.4/include/  
 </headers>  
 <libs>  
   /usr/local/libssh/0.3.4/lib/  
 </libs>

 

아래는 ABICC를 사용하여 나온 예제 결과 파일이다.

 

설치 및 사용법에 대한 자세한 내용은 아래 Reference의 소개 link를 가보면 알 수 있고, 오픈 소스 버전 수정에 따른 ABI 변경에 대한 결과는 아래 Opensource Library Upstream Tacker 부분을 보면 알 수 있다.

Reference