3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

opensslのバージョンを下げる時に苦しめられた。

Posted at

概要

openssl のバージョンを1.1.1から1.0.2に落とそうとした時にはまり、
1.0.2を用いてライブラリの関数の一部を構築しようとした時にはまったので備忘録。

出たエラー


bn.hh:47:9: note: suggested alternative: 'BN_print'
         BN_init(&b);
         ^~~~~~~
         BN_print

このようなエラーはopensslのバージョンの違いからくる。
参考 https://github.com/vertcoin-project/vertcoin-core/issues/43
この場合このライブラリは1.0系を使っている。
このため、1.0系へとダウングレードしてみて走るかどうかを検証したかった。

したがって以下のコマンドを実行。

wget http://www.openssl.org/source/openssl-1.0.2a.tar.gz
tar -xvzf openssl-1.0.2a.tar.gz
cd openssl-1.0.2a
./config --prefix=/usr/
make
sudo make install

これで

openssl version

をすると1.0.2系に落とせていることがわかったものの、ライブラリをビルドする時に

/usr/bin/ld: /usr/lib/libcrypto.a(cryptlib.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

このようなエラーに散々悩まされたが、
openssl 1.0.2系のビルドの際に、

make clean
export CFLAGS=-fPIC
./config shared --prefix=/usr

とすることで解決した。

終わり。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?