Cryptopp make ARM 32bit shared library

Viewed 172

I'm new in Linux and Ubuntu and I need to build cryptopp library by ARM32.
I've been following ARM Embedded(Command Line)'s Install the Package, Set the Environment, Build the Library section

Belows are what I did

git clone cryptopp

$> git clone https://github.com/weidai11/cryptopp.git
$> cd cryptopp

Install the Package section

$> sudo apt-get update
$> sudo apt-get install g++-arm-linux-gnueabi gcc-arm-linux-gnueabi

Set the Environment section
I opened ./cryptopp/TestScript/setenv-embedded.sh and modified below values

ARM_EMBEDDED_CXXFLAGS="-|/usr/arm-linux-gnueabi/include/c++/7.5.0 -|/usr/arm-linux-gnueabi/include/c++/7.5.0/arm-linux-gnueabi"
ARM_EMBEDDED_SYSROOT="/usr/arm-linux-gnueabi"
ARM_EMBEDDED_TOOLCHAIN_VERSION="7.5.0"

Build the Library section

$> run source ./TestScript/setenv-embedded.sh
$> sudo make -f GNUmakefile-cross static dynamic cryptest.exe

I tried above, however, build runs with g++ not arm-linux-gnueabi-g++ like below

g++ -DNDEBUG -g2 -O3 - fPIC - pipe -c cryptlib.cpp
g++ -DNDEBUG -g2 -O3 - fPIC - pipe -c cpu.cpp
...

and result shared library was '64bit x86-64' version. I'd like to make cryptopp shared library with 32bit arm architecture.

Anyone help me or share helpful link please?

Solved

I referred to @Anton Malyshev's answer and solved it.

As he said, changing g++ to arm-linux-gnueabi-g++ is perfectly worked. For how, this is my solution(If there is better things, please share it)

  1. Open GNUmakefile-cross file and add CXX := arm-linux-gnueabi-g++
  2. Run sudo make -f GNUmakefile-cross static dynamic cryptest.exe that's it.

But I don't know why it didn't work even I had followed cryptopp's wiki

1 Answers

Most probably you just need to use g++-arm-linux-gnueabi instead of g++.

Related