From 19ebc849d1d04c05611006ec48b2dd58e1a614b6 Mon Sep 17 00:00:00 2001 From: ShengguangXiao Date: Wed, 2 Jun 2021 10:38:22 +0000 Subject: [PATCH 1/2] Using clang 11 to compile on linux and MacOS --- contrib/dockerfiles/x86_64-apple-darwin11.dockerfile | 9 +++++++-- contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile | 9 +++++++-- make.sh | 7 +++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/contrib/dockerfiles/x86_64-apple-darwin11.dockerfile b/contrib/dockerfiles/x86_64-apple-darwin11.dockerfile index f34b56a9ce..e9ef9388a0 100644 --- a/contrib/dockerfiles/x86_64-apple-darwin11.dockerfile +++ b/contrib/dockerfiles/x86_64-apple-darwin11.dockerfile @@ -14,10 +14,15 @@ RUN apt update && apt dist-upgrade -y RUN apt install -y software-properties-common build-essential libtool autotools-dev automake \ pkg-config bsdmainutils python3 libssl-dev libevent-dev libboost-system-dev \ libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev \ -libminiupnpc-dev libzmq3-dev libqrencode-dev \ +libminiupnpc-dev libzmq3-dev libqrencode-dev wget \ curl cmake \ python3-dev python3-pip libcap-dev libbz2-dev libz-dev fonts-tuffy librsvg2-bin libtiff-tools imagemagick +# install clang 11 +RUN wget https://apt.llvm.org/llvm.sh +RUN chmod +x llvm.sh +RUN ./llvm.sh 11 + # For Berkeley DB - but we don't need as we do a depends build. # RUN apt install -y libdb-dev @@ -46,7 +51,7 @@ COPY . . RUN ./autogen.sh # XREF: #make-configure -RUN ./configure --prefix=`pwd`/depends/${TARGET} +RUN ./configure CC=clang-11 CXX=clang++-11 --prefix=`pwd`/depends/${TARGET} ARG BUILD_VERSION= diff --git a/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile b/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile index bda63b01bc..a85c7aaf5b 100644 --- a/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile +++ b/contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile @@ -16,9 +16,14 @@ RUN apt-get install -y apt-transport-https RUN apt install -y software-properties-common build-essential libtool autotools-dev automake \ pkg-config bsdmainutils python3 libssl-dev libevent-dev libboost-system-dev \ libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev \ -libminiupnpc-dev libzmq3-dev libqrencode-dev \ +libminiupnpc-dev libzmq3-dev libqrencode-dev wget \ curl cmake +# install clang 11 +RUN wget https://apt.llvm.org/llvm.sh +RUN chmod +x llvm.sh +RUN ./llvm.sh 11 + # For Berkeley DB - but we don't need as we do a depends build. # RUN apt install -y libdb-dev @@ -47,7 +52,7 @@ COPY . . RUN ./autogen.sh # XREF: #make-configure -RUN ./configure --prefix=`pwd`/depends/${TARGET} +RUN ./configure CC=clang-11 CXX=clang++-11 --prefix=`pwd`/depends/${TARGET} ARG BUILD_VERSION= diff --git a/make.sh b/make.sh index d127584dec..132712304c 100755 --- a/make.sh +++ b/make.sh @@ -84,7 +84,7 @@ build() { popd >/dev/null ./autogen.sh # XREF: #make-configure - ./configure --prefix="$(pwd)/depends/${target}" ${extra_build_opts} + ./configure CC=clang-11 CXX=clang++-11 --prefix="$(pwd)/depends/${target}" ${extra_build_opts} make $extra_make_args } @@ -324,8 +324,11 @@ pkg_install_deps() { sudo apt install -y software-properties-common build-essential libtool autotools-dev automake \ pkg-config bsdmainutils python3 libssl-dev libevent-dev libboost-system-dev \ libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev \ - libminiupnpc-dev libzmq3-dev libqrencode-dev \ + libminiupnpc-dev libzmq3-dev libqrencode-dev wget \ curl cmake + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 11 } pkg_ensure_mac_sdk() { From 89db8a9f534767efbf0334b8d02efba99323908b Mon Sep 17 00:00:00 2001 From: ShengguangXiao Date: Wed, 2 Jun 2021 15:34:50 +0000 Subject: [PATCH 2/2] Revert change to make apple darwin build pass --- contrib/dockerfiles/x86_64-apple-darwin11.dockerfile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/contrib/dockerfiles/x86_64-apple-darwin11.dockerfile b/contrib/dockerfiles/x86_64-apple-darwin11.dockerfile index e9ef9388a0..f34b56a9ce 100644 --- a/contrib/dockerfiles/x86_64-apple-darwin11.dockerfile +++ b/contrib/dockerfiles/x86_64-apple-darwin11.dockerfile @@ -14,15 +14,10 @@ RUN apt update && apt dist-upgrade -y RUN apt install -y software-properties-common build-essential libtool autotools-dev automake \ pkg-config bsdmainutils python3 libssl-dev libevent-dev libboost-system-dev \ libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev \ -libminiupnpc-dev libzmq3-dev libqrencode-dev wget \ +libminiupnpc-dev libzmq3-dev libqrencode-dev \ curl cmake \ python3-dev python3-pip libcap-dev libbz2-dev libz-dev fonts-tuffy librsvg2-bin libtiff-tools imagemagick -# install clang 11 -RUN wget https://apt.llvm.org/llvm.sh -RUN chmod +x llvm.sh -RUN ./llvm.sh 11 - # For Berkeley DB - but we don't need as we do a depends build. # RUN apt install -y libdb-dev @@ -51,7 +46,7 @@ COPY . . RUN ./autogen.sh # XREF: #make-configure -RUN ./configure CC=clang-11 CXX=clang++-11 --prefix=`pwd`/depends/${TARGET} +RUN ./configure --prefix=`pwd`/depends/${TARGET} ARG BUILD_VERSION=