是否可以提供基于openssl1.1.1版本的编译二进制包
是否可以提供基于openssl1.1.1版本的编译二进制包,或者提供一个centos7中使用openssl1.1.1的编译方案也可以。我现在使用下面的方案进行编译没有通过。FROM centos:7
ENV LANG en_US.utf8
RUN yum install -y epel-release && \
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo && \
yum clean all && \
yum makecache
RUN yum install -y yum-utils && \
RUN yum install -y --skip-broken yum-utils wget diffutils net-tools vim git gcc gcc-c++ automake libtool cmake cmake3 \
make psmisc zlib-devel readline-devel bzip2-devel expat-devel\
bisonflex wget unzip libcurl-devel libevent-devel libffi-devel lz4-devel \
file clang bzip2 libxml2-devel libtirpc libtirpc-devel numactl-devel numactl-libs \
numactl openldap-devel openldap-clients pam-devel valgrind boost-devel \
libzstd libzstd-devel patchelf perl perl-Env perl-JSON perl-Memoize perl-Time-HiRes time libaio-devel libarchive \
ncurses-devel ncurses-libs pam redhat-lsb-core scl-utils-build pkg-config ccache \
jemalloc jemalloc-devel libicu-devel re2-devel redhat-lsb-core rpm* tar libssh \
cyrus-sasl-devel cyrus-sasl-scram
#RUN dnf install -y dnf
RUN dnf install -y gcc-toolset-11 gcc-toolset-11-annobin-plugin-gcc && source /opt/rh/gcc-toolset-11/enable
RUN echo 'source /opt/rh/gcc-toolset-11/enable' >> /root/.bash_profile
#git, https://github.com/git/git/archive/v2.27.0.tar.gz, 下载后重命名为 git-v2.27.0.tar.gz
COPY git-v2.27.0.tar.gz /tmp/
RUN cd /tmp/ && tar -xzvf git-v2.27.0.tar.gz && cd git-2.27.0 && make prefix=/opt/git/ all && make prefix=/opt/git/ install
RUN mv /usr/bin/git /usr/bin/git.bk && ln -s /opt/git/bin/git /usr/bin/git
#patchelf, https://github.com/NixOS/patchelf/archive/refs/tags/0.12.tar.gz, 下载后重命名为 patchelf-0.12.tar.gz
#如果编译过程报错,再手动打补丁 https://github.com/NixOS/patchelf/pull/275/files
COPY patchelf-0.12.tar.gz /tmp/
RUN cd /tmp && tar -xzvf patchelf-0.12.tar.gz && cd patchelf-0.12 && ./bootstrap.sh && ./configure && make && make install
#rpcsvc-proto, https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4/rpcsvc-proto-1.4.tar.gz
COPY rpcsvc-proto-1.4.tar.gz /tmp/rpcsvc-proto-1.4.tar.gz
RUN tar zxvf /tmp/rpcsvc-proto-1.4.tar.gz -C /tmp && cd /tmp/rpcsvc-proto-1.4/ && ./configure && make && make install
RUN rm -fr /tmp/*
COPY openssl-1.1.1v.tar.gz /tmp/openssl-1.1.1v.tar.gz
RUN tar zxvf /tmp/openssl-1.1.1v.tar.gz -C /tmp && cd /tmp/openssl-1.1.1v/ && ./config --prefix=/usr/local/openssl -d shared-fPIC && make -j 4 && make install &&echo '/usr/local/openssl/lib' >> /etc/ld.so.conf &&ldconfig -v
RUN rm -fr /tmp/*
#boost, https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz
COPY boost_1_73_0.tar.gz /opt/
RUN ln -fs /usr/bin/cmake3 /usr/bin/cmake
#!/bin/bash
MAJOR_VERSION=8
MINOR_VERSION=0
PATCH_VERSION=32
RELEASE=24
REVISION=3714067bc8c
GLIBC=`ldd --version | head -n 1 | awk '{print $NF}'`
ARCH=`uname -p`
OS=`grep '^ID=' /etc/os-release | sed 's/.*"\(.*\)".*/\1/ig'`
#OS=Linux
PKG_NAME=GreatSQL-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-${RELEASE}-${OS}-glibc${GLIBC}-${ARCH}
BASE_DIR=/usr/local/mysql
BOOST_VERSION=1_77_0
SOURCE_DIR=greatsql-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-${RELEASE}
CMAKE_EXE_LINKER_FLAGS=""
JOBS=`lscpu | grep '^CPU(s)'|awk '{print $NF}'`
if [ ${JOBS} -ge 16 ] ; then
JOBS=`expr ${JOBS} - 4`
else
JOBS=`expr ${JOBS} - 1`
fi
if [ ${ARCH} = "x86_64" ] ; then
CMAKE_EXE_LINKER_FLAGS=" -ljemalloc "
fi
if [ ${ARCH} = "loongarch64" ] ; then
cd /opt/${SOURCE_DIR}
sed -i 's/\(.*defined.*mips.*\) \\/\1 defined(__loongarch__) || \\/ig' extra/icu/source/i18n/double-conversion-utils.h
fi
cd /opt/${SOURCE_DIR} && \
rm -fr bld && \
mkdir bld && \
cd bld && \
cmake .. -DBOOST_INCLUDE_DIR=/opt/boost_${BOOST_VERSION} \
-DLOCAL_BOOST_DIR=/opt/boost_${BOOST_VERSION} \
-DCMAKE_INSTALL_PREFIX=${BASE_DIR} -DWITH_ZLIB=bundled \
-DWITH_NUMA=ON -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release \
-DOPENSSL_ROOT_DIR=/usr/local/openssl -DOPENSSL_LIBRARIES=/usr/local/openssl/lib-DOPENSSL_CRYPTO_LIBRARY=/usr/local/openssl/lib -DOPENSSL_INCLUDE_DIR=/usr/local/openssl/include \
-DWITH_SSL=/usr/local/openssl \
-DWITH_LIBEVENT=bundled \
-DWITH_TOKUDB=OFF -DWITH_ROCKSDB=OFF \
-DCOMPILATION_COMMENT="${MYSQL} GreatSQL, Release ${RELEASE}, Revision ${REVISION}" \
-DMAJOR_VERSION=${MAJOR_VERSION} -DMINOR_VERSION=${MINOR_VERSION} -DPATCH_VERSION=${PATCH_VERSION} \
-DWITH_NDB=OFF -DWITH_NDBCLUSTER_STORAGE_ENGINE=OFF -DWITH_NDBCLUSTER=OFF \
-DWITH_UNIT_TESTS=OFF-DWITH_SYSTEMD=ON \
>> /tmp/greatsql-automake.log 2>&1 && make -j${JOBS} >> /tmp/greatsql-automake.log 2>&1 && make -j${JOBS} install >> /tmp/greatsql-automake.log 2>&1
我看 greatsql-automake.log 日志中提示:
-- OPENSSL_VERSION (system) is 1.00.02
-- The openssl command does not support zlib
-- OPENSSL_INCLUDE_DIR = /usr/local/openssl/include
-- OPENSSL_LIBRARY = /usr/local/openssl/lib/libssl.so
-- CRYPTO_LIBRARY = /usr/local/openssl/lib/libcrypto.so
-- OPENSSL_LIB_DIR =
-- OPENSSL_VERSION_MAJOR = 1
-- OPENSSL_VERSION_MINOR = 00
-- OPENSSL_FIX_VERSION = 02
-- Looking for SHA512_DIGEST_LENGTH
-- Looking for SHA512_DIGEST_LENGTH - found
-- SSL_LIBRARIES = /usr/local/openssl/lib/libssl.so;/usr/local/openssl/lib/libcrypto.so;dl
...
-- Found OpenSSL: /usr/local/openssl/lib (found version "1.0.2k")
看起来似乎并没有指定正确的openssl版本。
建议直接升级OS层的openssl版本,然后还按标准方式编译应该就可以。 yejr 发表于 2023-9-21 17:18
我看 greatsql-automake.log 日志中提示:
也就是说,把新版本的openssl直接替换覆盖OS原来的openssl版本,而不是安装到/usr/local/openssl目录下。 是用下面的dockfile 和构建脚本可以构建centos7 openssl1.1.1 的greatsql8.0.32
FROM centos:7
ENV LANG en_US.utf8
RUN yum install -y epel-release && \
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo && \
yum clean all && \
yum makecache
RUN yum install -y yum-utils && \
RUN yum install -y --skip-broken yum-utils wget diffutils net-tools vim git gcc gcc-c++ automake libtool cmake cmake3 \
make psmisc zlib-devel readline-devel bzip2-devel expat-devel\
bisonflex wget unzip libcurl-devel libevent-devel libffi-devel lz4-devel \
file clang bzip2 libxml2-devel libtirpc libtirpc-devel numactl-devel numactl-libs \
numactl openldap-devel openldap-clients pam-devel valgrind boost-devel \
libzstd libzstd-devel patchelf perl perl-Env perl-JSON perl-Memoize perl-Time-HiRes time libaio-devel libarchive \
ncurses-devel ncurses-libs pam redhat-lsb-core scl-utils-build pkg-config ccache \
jemalloc jemalloc-devel libicu-devel re2-devel redhat-lsb-core rpm* tar libssh \
cyrus-sasl-devel cyrus-sasl-scram
#RUN dnf install -y dnf
RUN dnf install -y gcc-toolset-11 gcc-toolset-11-annobin-plugin-gcc && source /opt/rh/gcc-toolset-11/enable
RUN echo 'source /opt/rh/gcc-toolset-11/enable' >> /root/.bash_profile
#git, https://github.com/git/git/archive/v2.27.0.tar.gz, 下载后重命名为 git-v2.27.0.tar.gz
COPY git-v2.27.0.tar.gz /tmp/
RUN cd /tmp/ && tar -xzvf git-v2.27.0.tar.gz && cd git-2.27.0 && make prefix=/opt/git/ all && make prefix=/opt/git/ install
RUN mv /usr/bin/git /usr/bin/git.bk && ln -s /opt/git/bin/git /usr/bin/git
#patchelf, https://github.com/NixOS/patchelf/archive/refs/tags/0.12.tar.gz, 下载后重命名为 patchelf-0.12.tar.gz
#如果编译过程报错,再手动打补丁 https://github.com/NixOS/patchelf/pull/275/files
COPY patchelf-0.12.tar.gz /tmp/
RUN cd /tmp && tar -xzvf patchelf-0.12.tar.gz && cd patchelf-0.12 && ./bootstrap.sh && ./configure && make && make install
#rpcsvc-proto, https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4/rpcsvc-proto-1.4.tar.gz
COPY rpcsvc-proto-1.4.tar.gz /tmp/rpcsvc-proto-1.4.tar.gz
RUN tar zxvf /tmp/rpcsvc-proto-1.4.tar.gz -C /tmp && cd /tmp/rpcsvc-proto-1.4/ && ./configure && make && make install
RUN rm -fr /tmp/*
COPY openssl-1.1.1w.tar.gz /tmp/openssl-1.1.1w.tar.gz
RUN tar zxvf /tmp/openssl-1.1.1w.tar.gz -C /tmp && cd /tmp/openssl-1.1.1w/ && ./config && make -j 8 && make install&&ldconfig -v
RUN rm -fr /tmp/*
#boost, https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz
COPY boost_1_77_0.tar.gz /opt/
RUN tar zxvf /opt/boost_1_77_0.tar.gz -C /opt
RUN ln -fs /usr/bin/cmake3 /usr/bin/cmake
#!/bin/bash
MAJOR_VERSION=8
MINOR_VERSION=0
PATCH_VERSION=32
RELEASE=24
REVISION=3714067bc8c
GLIBC=`ldd --version | head -n 1 | awk '{print $NF}'`
ARCH=`uname -p`
OS=`grep '^ID=' /etc/os-release | sed 's/.*"\(.*\)".*/\1/ig'`
#OS=Linux
PKG_NAME=GreatSQL-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-${RELEASE}-${OS}-glibc${GLIBC}-${ARCH}
BASE_DIR=/usr/local/mysql
BOOST_VERSION=1_77_0
SOURCE_DIR=greatsql-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-${RELEASE}
CMAKE_EXE_LINKER_FLAGS=""
JOBS=`lscpu | grep '^CPU(s)'|awk '{print $NF}'`
if [ ${JOBS} -ge 16 ] ; then
JOBS=`expr ${JOBS} - 4`
else
JOBS=`expr ${JOBS} - 1`
fi
if [ ${ARCH} = "x86_64" ] ; then
CMAKE_EXE_LINKER_FLAGS=" -ljemalloc "
fi
if [ ${ARCH} = "loongarch64" ] ; then
cd /opt/${SOURCE_DIR}
sed -i 's/\(.*defined.*mips.*\) \\/\1 defined(__loongarch__) || \\/ig' extra/icu/source/i18n/double-conversion-utils.h
fi
cd /opt/${SOURCE_DIR} && \
rm -fr bld && \
mkdir bld && \
cd bld && \
cmake .. -DBOOST_INCLUDE_DIR=/opt/boost_${BOOST_VERSION} \
-DLOCAL_BOOST_DIR=/opt/boost_${BOOST_VERSION} \
-DCMAKE_INSTALL_PREFIX=${BASE_DIR} -DWITH_ZLIB=bundled \
-DWITH_NUMA=ON -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release \
-DWITH_LIBEVENT=bundled \
-DWITH_TOKUDB=OFF -DWITH_ROCKSDB=OFF \
-DCOMPILATION_COMMENT="${MYSQL} GreatSQL, Release ${RELEASE}, Revision ${REVISION}" \
-DMAJOR_VERSION=${MAJOR_VERSION} -DMINOR_VERSION=${MINOR_VERSION} -DPATCH_VERSION=${PATCH_VERSION} \
-DWITH_NDB=OFF -DWITH_NDBCLUSTER_STORAGE_ENGINE=OFF -DWITH_NDBCLUSTER=OFF \
-DWITH_UNIT_TESTS=OFF-DWITH_SYSTEMD=ON \
-DWITH_AUTHENTICATION_CLIENT_PLUGINS=OFF \
-DWITH_AUTHENTICATION_LDAP=OFF \
-DWITH_SSL=system \
>> /tmp/greatsql-automake.log 2>&1 && make -j${JOBS} >> /tmp/greatsql-automake.log 2>&1 && make -j${JOBS} install >> /tmp/greatsql-automake.log 2>&1
mlovewt 发表于 2023-9-26 09:23
是用下面的dockfile 和构建脚本可以构建centos7 openssl1.1.1 的greatsql8.0.32
感谢分享,手动点赞
页:
[1]