OK, I found the cause of the error: when I modified the Makefile for generating libapr, I added the -fPIC
parameter to the command for generating the target file instead of the command for generating the library. In fact,we can use the ./configure to specify the parameter. Therefore, the correct replacement command should be as follows:
su -
# create the installation directory
mkdir /usr/local/apr
# get the tarball
cd /usr/local/src
wget https://github.com/apache/apr/archive/refs/tags/1.7.0.tar.gz
tar -zcvf 1.7.0.tar.gz
# install
cd 1.7.0.tar.gz
./buildconf
./configure --prefix=/usr/local/apr CFLAGS="-fPIC" CXXFLAGS="-fPIC"
make && make install
# replace
cp /usr/local/apr/lib/libapr-1* /home/meyok/Project/oceanbase/deps/3rd/usr/local/oceanbase/deps/devel/lib