cmu-sei / pharos

Automated static analysis tools for binary programs
Other
1.57k stars 192 forks source link

Can't build latest master on ubuntu 22.04 #223

Closed rvanlaar closed 2 years ago

rvanlaar commented 2 years ago

The build fails during the scripts/build_prereqs.bash step.

Ran the following from INSTALL.md

$ sudo apt install build-essential wget flex ghostscript bzip2 \
  git subversion automake libtool bison python3 libncurses-dev \
  vim-common sqlite3 libsqlite3-0 libsqlite3-dev zlib1g-dev cmake \
  libyaml-cpp-dev libboost-all-dev libboost-dev libxml2-dev ninja-build
$ ./scripts/build_prereqs.bash

Build log can be found here: https://gist.github.com/rvanlaar/394b70394536f739c3938f768601817a

sei-eschwartz commented 2 years ago

This appears to be the actual error:

/home/roland/projects/scummvm-director/tools/Ghidra/pharos/scripts/swipl-devel/packages/ssl/crypto4pl.c: In function ‘get_padding’:
/home/roland/projects/scummvm-director/tools/Ghidra/pharos/scripts/swipl-devel/packages/ssl/crypto4pl.c:851:69: error: ‘RSA_SSLV23_PADDING’ undeclared (first use in this function); did you mean ‘RSA_X931_PADDING’?
  851 |     else if ( a == ATOM_sslv23  && mode == RSA_MODE )    *padding = RSA_SSLV23_PADDING;
      |                                                                     ^~~~~~~~~~~~~~~~~~
      |                                                                     RSA_X931_PADDING

What distribution are you using? Are you able to compile swipl from the master branch? https://github.com/SWI-Prolog/swipl-devel

It seems like you have a very new version of openssl and SWI prolog's ssl package is using a removed padding method.

sei-eschwartz commented 2 years ago

Just noticed Ubuntu 22.04 in the title

sei-eschwartz commented 2 years ago

You can try a newer version of SWI: https://github.com/sei-eschwartz/pharos/commit/471f67cba254ea0a71c662c82bda4b2c84838327

rvanlaar commented 2 years ago

I tried to use the newer version. It has the same problem.

$ git clone --recursive -b V8.5.12 --depth 1 https://github.com/swi-prolog/swipl-devel
$ cd swipl-devel
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DINSTALL_DOCUMENTATION=off ..
$ make

The problem is the same.

Indeed ubuntu 22.04.

$ openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
sei-eschwartz commented 2 years ago

I just tried this and it worked for me. Are you sure you have commit 5da003d0940ad997500e623b1d9f7c1eba30555c checked out? If you do, please include a full log of the build.

rvanlaar commented 2 years ago

I can't find commit: 5da003d0940ad997500e623b1d9f7c1eba30555c which repo should it be in?

I did a build of swipl-devel with -b V8.5.12

sei-eschwartz commented 2 years ago

5da003d0940ad997500e623b1d9f7c1eba30555c is V8.5.12. Please verify which commit you actually have checked out.

rvanlaar commented 2 years ago

Thank you for your patience. I tried it again. V8.5.12 is buildable.

sei-eschwartz commented 2 years ago

Cool. I'm testing pharos with SWI 8.5.12, but assuming that works (it should), then we'll just update the recommended versions of SWI