From d280e1358d346517b94846e228b1c3db08bf084a Mon Sep 17 00:00:00 2001 From: Jordan Earls Date: Mon, 25 Feb 2019 13:44:10 -0700 Subject: [PATCH 01/19] Update helpers for cleaned up docker --- proto-x86/helpers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto-x86/helpers.sh b/proto-x86/helpers.sh index aa5aaa4..a83108e 100755 --- a/proto-x86/helpers.sh +++ b/proto-x86/helpers.sh @@ -1,6 +1,6 @@ #!/bin/bash function qx86start() { - docker run --rm -v "${PWD}:/root/bind" --name qx86 -d qtumx86 qtum/src/qtumd -regtest -logevents + docker run --rm -v "${PWD}:/root/bind" --name qx86 -d qtumx86 qtum/qtumd -regtest -logevents } export -f qx86start From bd09c742372ed3072371fdbd08e4744543e10a9d Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Tue, 16 Apr 2019 10:48:28 -0500 Subject: [PATCH 02/19] added new simpleABI into the fold Signed-off-by: VoR0220 --- proto-x86/Dockerfile | 9 ++++++--- proto-x86/helpers.sh | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/proto-x86/Dockerfile b/proto-x86/Dockerfile index 729effd..ce246a6 100644 --- a/proto-x86/Dockerfile +++ b/proto-x86/Dockerfile @@ -1,10 +1,10 @@ FROM ubuntu -MAINTAINER earlz +LABEL maintainers "earlz, VoR0220" WORKDIR /root RUN set -emx \ && apt-get update \ - && apt-get install -y -qq --no-install-recommends ca-certificates curl wget apt-utils build-essential git libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils git cmake libboost-all-dev software-properties-common texinfo bison flex libmpc-dev libmpfr-dev libgmp3-dev yasm \ + && apt-get install -y -qq --no-install-recommends ca-certificates curl wget apt-utils build-essential git libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils git cmake libboost-all-dev software-properties-common texinfo bison flex libmpc-dev libmpfr-dev libgmp3-dev yasm golang-go\ && add-apt-repository ppa:bitcoin/bitcoin -y \ && apt-get update \ && apt-get install libdb4.8-dev libdb4.8++-dev -y -qq --no-install-recommends @@ -27,7 +27,7 @@ RUN set -ex \ ENV PREFIX=/opt/cross ENV TARGET=i686-elf ENV SYSROOT=/opt/x86-compiler/sysroot -ENV PATH=${PATH}:${SYSROOT}/bin:$PREFIX/bin:/root/qtum:/root/qtum:/root/qtum-docker/proto-x86/utils +ENV PATH=${PATH}:${SYSROOT}/bin:$PREFIX/bin:/root/qtum:/root/qtum:/root/qtum-docker/proto-x86/utils:/root/go/bin # build the freestanding compiler RUN set -ex \ @@ -123,6 +123,9 @@ RUN set -ex \ && make \ && make deploy +# get simpleabi (this url should change in the future) +RUN go get -u github.com/qtumproject/SimpleABI && go install github.com/qtumproject/SimpleABI + # get docker helpers RUN set -ex \ && git clone $REPO_PREFIX/qtum-docker \ diff --git a/proto-x86/helpers.sh b/proto-x86/helpers.sh index a83108e..040076e 100755 --- a/proto-x86/helpers.sh +++ b/proto-x86/helpers.sh @@ -26,3 +26,8 @@ function qx86make() { } export -f qx86make +function qx86simpleabi() { + docker run -it -v "${PWD}:/root/bind" -w /root/bind qtumx86 SimpleABI -a "$1" -d -e +} + +export -f qx86simpleabi From 74c55600447c2fe8c0d9839e11e8ccaa7a1f6ff5 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Tue, 4 Jun 2019 09:57:06 -0500 Subject: [PATCH 03/19] docker client smooshed to 40mb and separated from toolchain, needs one more change Signed-off-by: VoR0220 --- proto-x86/client/Dockerfile | 29 ++++++++++ proto-x86/client/Dockerfile.build | 2 + proto-x86/client/Dockerfile.dev | 19 +++++++ proto-x86/client/Dockerfile.install | 12 ++++ proto-x86/client/build.sh | 4 ++ proto-x86/client/qtum.conf | 7 +++ proto-x86/toolchain/Dockerfile | 4 ++ proto-x86/toolchain/Dockerfile.build | 17 ++++++ proto-x86/toolchain/Dockerfile.dev | 12 ++++ proto-x86/toolchain/Dockerfile.install | 77 ++++++++++++++++++++++++++ proto-x86/toolchain/build.sh | 4 ++ proto-x86/utils/x86tb | 2 +- 12 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 proto-x86/client/Dockerfile create mode 100644 proto-x86/client/Dockerfile.build create mode 100644 proto-x86/client/Dockerfile.dev create mode 100644 proto-x86/client/Dockerfile.install create mode 100755 proto-x86/client/build.sh create mode 100644 proto-x86/client/qtum.conf create mode 100644 proto-x86/toolchain/Dockerfile create mode 100644 proto-x86/toolchain/Dockerfile.build create mode 100644 proto-x86/toolchain/Dockerfile.dev create mode 100644 proto-x86/toolchain/Dockerfile.install create mode 100755 proto-x86/toolchain/build.sh diff --git a/proto-x86/client/Dockerfile b/proto-x86/client/Dockerfile new file mode 100644 index 0000000..195626a --- /dev/null +++ b/proto-x86/client/Dockerfile @@ -0,0 +1,29 @@ +FROM qtum-alpine-bin as build +LABEL maintainers "earlz, VoR0220" + +FROM alpine + +# +# Copy the binaries from the build to our new container +# +COPY --from=build /usr/local/bin/qtumd /usr/local/bin +COPY --from=build /usr/local/bin/qtum-cli /usr/local/bin +# +# Install all dependencies +# +RUN apk update && apk add boost boost-filesystem \ + boost-program_options \ + boost-system boost-thread \ + boost-random busybox db-c++ \ + libevent libgcc libressl2.7-libcrypto \ + libstdc++ musl + +# +# Copy the qtum.conf file from +# the build context into the container +# +COPY qtum.conf /qtum.conf + +EXPOSE 3888/tcp +ENTRYPOINT ["/usr/local/bin/qtumd"] +CMD ["-conf=/qtum.conf", "-regtest", "-rest=1", "-server=1", "-printtoconsole", "-txindex=1"] \ No newline at end of file diff --git a/proto-x86/client/Dockerfile.build b/proto-x86/client/Dockerfile.build new file mode 100644 index 0000000..f9023ae --- /dev/null +++ b/proto-x86/client/Dockerfile.build @@ -0,0 +1,2 @@ +FROM alpine-dev +RUN git clone https://github.com/qtumproject/qtum --recursive \ No newline at end of file diff --git a/proto-x86/client/Dockerfile.dev b/proto-x86/client/Dockerfile.dev new file mode 100644 index 0000000..afccc21 --- /dev/null +++ b/proto-x86/client/Dockerfile.dev @@ -0,0 +1,19 @@ +FROM alpine:3.9.4 +LABEL maintainers "earlz, VoR0220" + +RUN apk update && apk add git \ + make \ + cmake \ + file \ + autoconf \ + automake \ + build-base \ + libtool \ + db-c++ \ + db-dev \ + boost-system \ + boost-program_options \ + boost-filesystem \ + boost-dev \ + libressl-dev \ + libevent-dev \ No newline at end of file diff --git a/proto-x86/client/Dockerfile.install b/proto-x86/client/Dockerfile.install new file mode 100644 index 0000000..3f6a28b --- /dev/null +++ b/proto-x86/client/Dockerfile.install @@ -0,0 +1,12 @@ +FROM qtum-alpine-build +RUN (cd qtum && ./autogen.sh && \ + ./configure --disable-tests \ + --disable-bench --disable-static \ + --without-gui --disable-zmq \ + --with-incompatible-bdb \ + CFLAGS='-w' CXXFLAGS='-w' && \ + make -j 4 && \ + strip src/qtumd && \ + strip src/qtum-cli && \ + strip src/qtum-tx && \ + make install && make clean && make distclean) diff --git a/proto-x86/client/build.sh b/proto-x86/client/build.sh new file mode 100755 index 0000000..b06cd0d --- /dev/null +++ b/proto-x86/client/build.sh @@ -0,0 +1,4 @@ +docker build -f Dockerfile.dev -t alpine-dev . +docker build -f Dockerfile.build -t qtum-alpine-build . +docker build -f Dockerfile.install -t qtum-alpine-bin . +docker build -f Dockerfile -t qtum-alpine . \ No newline at end of file diff --git a/proto-x86/client/qtum.conf b/proto-x86/client/qtum.conf new file mode 100644 index 0000000..ef8f855 --- /dev/null +++ b/proto-x86/client/qtum.conf @@ -0,0 +1,7 @@ +regtest=1 +server=1 +rpcbind=0.0.0.0:3888 +rpcuser=user +rpcpassword=password +rpcallowip=0.0.0.0/0 +rpcport=3888 \ No newline at end of file diff --git a/proto-x86/toolchain/Dockerfile b/proto-x86/toolchain/Dockerfile new file mode 100644 index 0000000..9aeff6f --- /dev/null +++ b/proto-x86/toolchain/Dockerfile @@ -0,0 +1,4 @@ +FROM qtum-toolchain-alpine-bin as build +LABEL mainainters "earlz, VoR0220" + +FROM alpine \ No newline at end of file diff --git a/proto-x86/toolchain/Dockerfile.build b/proto-x86/toolchain/Dockerfile.build new file mode 100644 index 0000000..4e05f89 --- /dev/null +++ b/proto-x86/toolchain/Dockerfile.build @@ -0,0 +1,17 @@ +FROM alpine-dev +LABEL maintainers "earlz, VoR0220" + +ENV REPO_PREFIX=https://github.com/qtumproject +ENV BRANCH=proto-x86 + +RUN git clone $REPO_PREFIX/x86-toolchain \ + && cd x86-toolchain \ + && git checkout $BRANCH +RUN git clone $REPO_PREFIX/FsLibc && cd FsLibc && git checkout $BRANCH +RUN git clone $REPO_PREFIX/qtum qtum-compile --recursive && cd qtum-compile \ + && git checkout $BRANCH +# get libqtum +RUN set -ex \ + && git clone $REPO_PREFIX/libqtum \ + && cd libqtum \ + && git checkout $BRANCH \ No newline at end of file diff --git a/proto-x86/toolchain/Dockerfile.dev b/proto-x86/toolchain/Dockerfile.dev new file mode 100644 index 0000000..269c6a0 --- /dev/null +++ b/proto-x86/toolchain/Dockerfile.dev @@ -0,0 +1,12 @@ +FROM alpine:3.9.4 +LABEL maintainers "earlz, VoR0220" + +RUN apk update && apk add git \ + make \ + cmake \ + musl \ + alpine-sdk \ + texinfo \ + bison \ + flex \ + yasm \ No newline at end of file diff --git a/proto-x86/toolchain/Dockerfile.install b/proto-x86/toolchain/Dockerfile.install new file mode 100644 index 0000000..4a0c193 --- /dev/null +++ b/proto-x86/toolchain/Dockerfile.install @@ -0,0 +1,77 @@ +FROM qtumtoolchain-alpine-build + +ENV PREFIX=/opt/cross +ENV TARGET=i686-elf +ENV SYSROOT=/opt/x86-compiler/sysroot +ENV PATH=${PATH}:${SYSROOT}/bin:$PREFIX/bin:/root/qtum:/root/qtum:/root/qtum-docker/proto-x86/utils + +# build the freestanding compiler +RUN set -ex \ + && cd x86-toolchain \ + && mkdir build-binutils \ + && cd build-binutils \ + && ../binutils-2.29/configure --target="$TARGET" --prefix="$PREFIX" --disable-werror \ + && make \ + && make install \ + && cd .. \ + && mkdir build-gcc \ + && cd gcc-7.2.0 \ + && ./contrib/download_prerequisites \ + && cd ../build-gcc \ + && ../gcc-7.2.0/configure --target="$TARGET" --prefix="$PREFIX" --enable-languages=c,c++ \ + && make all-gcc -j4 \ + && make all-target-libgcc \ + && make install-gcc \ + && make install-target-libgcc + +ENV TARGET=i686-qtum + +#compile QtumOS compiler and supports +RUN set -ex \ + && ls $PREFIX/bin \ + && i686-elf-gcc -v \ + && cd FsLibc \ + && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=cross-toolchain.cmake -DCMAKE_INSTALL_PREFIX=$SYSROOT/usr . \ + && make -C libc \ + && make -C libc install \ + && cd ~/x86-toolchain/crtfiles \ + && make \ + && cd .. \ + && mkdir -p $SYSROOT/usr/lib \ + && mkdir -p $SYSROOT/usr/include \ + && cp crtfiles/*.o $SYSROOT/usr/lib/ \ + && cp -r includes/* $SYSROOT/usr/include/ \ + && rm -rf build-binutils \ + && mkdir build-binutils \ + && cd build-binutils \ + && ../binutils-2.29/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot="$SYSROOT" --disable-werror \ + && make \ + && make install \ + && cd .. \ + && rm -rf build-gcc \ + && mkdir build-gcc \ + && cd build-gcc \ + && ../gcc-7.2.0/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot="$SYSROOT" --enable-languages=c \ + && make all-gcc -j4 \ + && make all-target-libgcc \ + && make install-gcc \ + && make install-target-libgcc + +# build qtum +RUN set -ex \ + && cd qtum-compile \ + && ./autogen.sh \ + && ./configure --disable-tests --without-gui \ + && make $MAKE_SUFFIX + +# build x86lib utility +RUN set -ex \ + && cd qtum-compile/src/x86lib \ + && make $MAKE_SUFFIX + +# build libqtum +RUN set -ex \ + && cd libqtum \ + && make \ + && make deploy \ + && make deploy \ No newline at end of file diff --git a/proto-x86/toolchain/build.sh b/proto-x86/toolchain/build.sh new file mode 100755 index 0000000..aa9cd7f --- /dev/null +++ b/proto-x86/toolchain/build.sh @@ -0,0 +1,4 @@ +docker build --no-cache -f Dockerfile.dev -t alpine-dev . +docker build --no-cache -f Dockerfile.build -t qtumtoolchain-alpine-build . +docker build --no-cache -f Dockerfile.install -t qtumtoolchain-alpine-bin . +#docker build -f Dockerfile -t qtum-toolchain-alpine . \ No newline at end of file diff --git a/proto-x86/utils/x86tb b/proto-x86/utils/x86tb index e782b2a..fe6a5e9 100755 --- a/proto-x86/utils/x86tb +++ b/proto-x86/utils/x86tb @@ -1,3 +1,3 @@ #!/bin/bash -~/qtum/src/x86testbench "$@"" \ No newline at end of file +~/qtum/src/x86testbench "$@" \ No newline at end of file From 0d651b1e2cc05e4233800a36422cabb7b7189479 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Mon, 10 Jun 2019 16:03:36 -0500 Subject: [PATCH 04/19] split client from main dockerfile Signed-off-by: VoR0220 --- proto-x86/client/Dockerfile | 7 ++++--- proto-x86/client/Dockerfile.build | 2 +- proto-x86/client/Dockerfile.install | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/proto-x86/client/Dockerfile b/proto-x86/client/Dockerfile index 195626a..5539a2f 100644 --- a/proto-x86/client/Dockerfile +++ b/proto-x86/client/Dockerfile @@ -8,6 +8,7 @@ FROM alpine # COPY --from=build /usr/local/bin/qtumd /usr/local/bin COPY --from=build /usr/local/bin/qtum-cli /usr/local/bin +COPY --from=build /qtum/src/x86lib/x86testbench /usr/local/bin/x86testbench # # Install all dependencies # @@ -24,6 +25,6 @@ RUN apk update && apk add boost boost-filesystem \ # COPY qtum.conf /qtum.conf -EXPOSE 3888/tcp -ENTRYPOINT ["/usr/local/bin/qtumd"] -CMD ["-conf=/qtum.conf", "-regtest", "-rest=1", "-server=1", "-printtoconsole", "-txindex=1"] \ No newline at end of file +EXPOSE 3888 3889 13888 13889 +ENV PATH=${PATH}:/usr/local/bin: +CMD ["qtumd", "-conf=/qtum.conf", "-regtest", "-logevents", "-rest=1", "-server=1", "-printtoconsole", "-txindex=1"] \ No newline at end of file diff --git a/proto-x86/client/Dockerfile.build b/proto-x86/client/Dockerfile.build index f9023ae..3bc4bf8 100644 --- a/proto-x86/client/Dockerfile.build +++ b/proto-x86/client/Dockerfile.build @@ -1,2 +1,2 @@ FROM alpine-dev -RUN git clone https://github.com/qtumproject/qtum --recursive \ No newline at end of file +RUN set -ex && git clone https://github.com/qtumproject/qtum.git --recursive && cd qtum && git checkout proto-x86 \ No newline at end of file diff --git a/proto-x86/client/Dockerfile.install b/proto-x86/client/Dockerfile.install index 3f6a28b..e0e7d3f 100644 --- a/proto-x86/client/Dockerfile.install +++ b/proto-x86/client/Dockerfile.install @@ -9,4 +9,5 @@ RUN (cd qtum && ./autogen.sh && \ strip src/qtumd && \ strip src/qtum-cli && \ strip src/qtum-tx && \ - make install && make clean && make distclean) + make install && make clean && make distclean && \ + cd src/x86lib && make) From 20618700ef9c2306825bf96b8713a1403babaa58 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Mon, 10 Jun 2019 16:03:47 -0500 Subject: [PATCH 05/19] split toolchain from main dockerfile Signed-off-by: VoR0220 --- proto-x86/toolchain/Dockerfile | 105 ++++++++++++++++++++++++++- proto-x86/toolchain/Dockerfile.build | 4 +- proto-x86/toolchain/Dockerfile.dev | 14 +++- proto-x86/toolchain/build.sh | 7 +- 4 files changed, 119 insertions(+), 11 deletions(-) diff --git a/proto-x86/toolchain/Dockerfile b/proto-x86/toolchain/Dockerfile index 9aeff6f..bf07720 100644 --- a/proto-x86/toolchain/Dockerfile +++ b/proto-x86/toolchain/Dockerfile @@ -1,4 +1,103 @@ -FROM qtum-toolchain-alpine-bin as build -LABEL mainainters "earlz, VoR0220" +FROM qtumtoolchain-alpine-build -FROM alpine \ No newline at end of file +ENV PREFIX=/opt/cross +ENV TARGET=i686-elf +ENV SYSROOT=/opt/x86-compiler/sysroot +ENV PATH=${PATH}:${SYSROOT}/bin:$PREFIX/bin:/root/qtum:/root/qtum:/root/qtum-docker/proto-x86/utils + +# build the freestanding compiler +RUN set -ex \ + && cd x86-toolchain \ + && mkdir build-binutils \ + && cd build-binutils \ + && ../binutils-2.29/configure --target="$TARGET" --prefix="$PREFIX" --disable-werror \ + && make \ + && make install \ + && cd .. \ + && mkdir build-gcc \ + && cd gcc-7.2.0 \ + && ./contrib/download_prerequisites \ + && cd ../build-gcc \ + && ../gcc-7.2.0/configure --target="$TARGET" --prefix="$PREFIX" --enable-languages=c,c++ \ + && make all-gcc -j4 \ + && make all-target-libgcc \ + && make install-gcc \ + && make install-target-libgcc + +ENV TARGET=i686-qtum + +#compile QtumOS compiler and supports +RUN set -ex \ + && ls $PREFIX/bin \ + && i686-elf-gcc -v \ + && cd FsLibc \ + && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=cross-toolchain.cmake -DCMAKE_INSTALL_PREFIX=$SYSROOT/usr . \ + && make -C libc \ + && make -C libc install \ + && cd /x86-toolchain/crtfiles \ + && make \ + && cd .. \ + && mkdir -p $SYSROOT/usr/lib \ + && mkdir -p $SYSROOT/usr/include \ + && cp crtfiles/*.o $SYSROOT/usr/lib/ \ + && cp -r includes/* $SYSROOT/usr/include/ \ + && rm -rf build-binutils \ + && mkdir build-binutils \ + && cd build-binutils \ + && ../binutils-2.29/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot="$SYSROOT" --disable-werror \ + && make \ + && make install \ + && cd .. \ + && rm -rf build-gcc \ + && mkdir build-gcc \ + && cd build-gcc \ + && ../gcc-7.2.0/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot="$SYSROOT" --enable-languages=c \ + && make all-gcc -j4 \ + && make all-target-libgcc \ + && make install-gcc \ + && make install-target-libgcc + +# build qtum +RUN set -ex \ + && cd qtum-compile \ + && ./autogen.sh \ + && ./configure --disable-tests --without-gui --with-incompatible-bdb\ + && make $MAKE_SUFFIX + +# build x86lib utility +RUN set -ex \ + && cd qtum-compile/src/x86lib \ + && make $MAKE_SUFFIX + +# build libqtum +RUN set -ex \ + && cd libqtum \ + && make \ + && make deploy \ + && make deploy + +FROM alpine:3.9.4 + +RUN apk --no-cache add make \ + musl \ + db-dev \ + boost \ + boost-system \ + boost-program_options \ + boost-filesystem \ + boost-dev + +COPY --from=0 /lib /lib +COPY --from=0 /opt/cross /opt/cross +COPY --from=0 /opt/x86-compiler/sysroot /opt/x86-compiler/sysroot +COPY --from=0 /usr/include /usr/include +COPY --from=qtum-alpine /usr/local/bin/x86testbench ./usr/local/bin + +ENV PATH=${PATH}:/opt/x86-compiler/sysroot/bin:/opt/cross/bin:/root/qtum:/usr/local/bin +ENV CC=i686-qtum-gcc +ENV LD=i686-qtum-ld +ENV CXX=i686-qtum-g++ +ENV CPP=i686-qtum-cpp +ENV AR=i686-qtum-ar +ENV STRIP=i686-qtum-strip +ENV OBJCOPY=i686-qtum-objcopy \ No newline at end of file diff --git a/proto-x86/toolchain/Dockerfile.build b/proto-x86/toolchain/Dockerfile.build index 4e05f89..ff1b1b9 100644 --- a/proto-x86/toolchain/Dockerfile.build +++ b/proto-x86/toolchain/Dockerfile.build @@ -4,9 +4,7 @@ LABEL maintainers "earlz, VoR0220" ENV REPO_PREFIX=https://github.com/qtumproject ENV BRANCH=proto-x86 -RUN git clone $REPO_PREFIX/x86-toolchain \ - && cd x86-toolchain \ - && git checkout $BRANCH +RUN git clone $REPO_PREFIX/x86-toolchain RUN git clone $REPO_PREFIX/FsLibc && cd FsLibc && git checkout $BRANCH RUN git clone $REPO_PREFIX/qtum qtum-compile --recursive && cd qtum-compile \ && git checkout $BRANCH diff --git a/proto-x86/toolchain/Dockerfile.dev b/proto-x86/toolchain/Dockerfile.dev index 269c6a0..ceea859 100644 --- a/proto-x86/toolchain/Dockerfile.dev +++ b/proto-x86/toolchain/Dockerfile.dev @@ -9,4 +9,16 @@ RUN apk update && apk add git \ texinfo \ bison \ flex \ - yasm \ No newline at end of file + yasm \ + perl-utils \ + autoconf \ + automake \ + libtool \ + db-dev \ + boost \ + boost-system \ + boost-program_options \ + boost-filesystem \ + boost-dev \ + openssl-dev \ + libevent-dev \ No newline at end of file diff --git a/proto-x86/toolchain/build.sh b/proto-x86/toolchain/build.sh index aa9cd7f..3868719 100755 --- a/proto-x86/toolchain/build.sh +++ b/proto-x86/toolchain/build.sh @@ -1,4 +1,3 @@ -docker build --no-cache -f Dockerfile.dev -t alpine-dev . -docker build --no-cache -f Dockerfile.build -t qtumtoolchain-alpine-build . -docker build --no-cache -f Dockerfile.install -t qtumtoolchain-alpine-bin . -#docker build -f Dockerfile -t qtum-toolchain-alpine . \ No newline at end of file +docker build -f Dockerfile.dev -t alpine-dev . +docker build -f Dockerfile.build -t qtumtoolchain-alpine-build . +docker build -f Dockerfile -t qtumtoolchain-alpine . \ No newline at end of file From 97d11a7e21ea4d4b73d4e4d5e75b2e039f293057 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Mon, 10 Jun 2019 16:04:05 -0500 Subject: [PATCH 06/19] set up testing for this to work with the original tutorial Signed-off-by: VoR0220 --- proto-x86/test/Makefile | 28 ++++++++++++++++++++++++++++ proto-x86/test/helloworld.c | 13 +++++++++++++ proto-x86/test/helloworld.elf | Bin 0 -> 10136 bytes proto-x86/test/helloworld.o | Bin 0 -> 1680 bytes proto-x86/test/helloworld.qbit | 1 + 5 files changed, 42 insertions(+) create mode 100644 proto-x86/test/Makefile create mode 100644 proto-x86/test/helloworld.c create mode 100755 proto-x86/test/helloworld.elf create mode 100644 proto-x86/test/helloworld.o create mode 100644 proto-x86/test/helloworld.qbit diff --git a/proto-x86/test/Makefile b/proto-x86/test/Makefile new file mode 100644 index 0000000..f1c8885 --- /dev/null +++ b/proto-x86/test/Makefile @@ -0,0 +1,28 @@ +# files to be built +# fill this in as a template +HDRS = +C_SRC = helloworld.c +OUTPUT = helloworld.elf +LIBS = +BYTECODE = helloworld.qbit + +C_OBJS = $(subst .c,.o,$(C_SRC)) + +#these default flags will just remove dead code and give warnings +CFLAGS += -Wall -ffunction-sections -fdata-sections +LDFLAGS += -Wl,--gc-section + + +default: $(BYTECODE) + +$(BYTECODE): $(OUTPUT) + x86testbench -assemble -raw $(OUTPUT) > $(BYTECODE) + +$(OUTPUT): $(C_OBJS) + $(CC) $(LDFLAGS) -o $(OUTPUT) $(C_OBJS) $(LIBS) + +$(C_OBJS): $(HDRS) $(C_SRC) + $(CC) $(CFLAGS) -c $*.c -o $@ + +clean: + rm -f $(C_OBJS) $(OUTPUT) $(BYTECODE) \ No newline at end of file diff --git a/proto-x86/test/helloworld.c b/proto-x86/test/helloworld.c new file mode 100644 index 0000000..9d689c9 --- /dev/null +++ b/proto-x86/test/helloworld.c @@ -0,0 +1,13 @@ +#include + +int onCreate() +{ + qtumEventStringString("Hello World", "Contract creation"); + return 0; +} + +int main() +{ + qtumEventStringString("Hello World", "Execution Success!"); + return 0; +} \ No newline at end of file diff --git a/proto-x86/test/helloworld.elf b/proto-x86/test/helloworld.elf new file mode 100755 index 0000000000000000000000000000000000000000..bd13f42bb2824bc511b432da67361ddf6fca6f5c GIT binary patch literal 10136 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 L&_^%hZxXi+uD-zF literal 0 HcmV?d00001 diff --git a/proto-x86/test/helloworld.qbit b/proto-x86/test/helloworld.qbit new file mode 100644 index 0000000..84893ab --- /dev/null +++ b/proto-x86/test/helloworld.qbit @@ -0,0 +1 @@ +0c0400000004ec030002100007e9200003666666e863010002e88e020002c2000dbc000118200001e8deffffffe8cb010002a1040002d083f801740db80004e884010002cdf0f4b80004e855010002ebf16690669066906690669066906690b81000011000013d1000011000017424b8000485c0741b5589e583ec1468100001100001ffd083c410c9c389f68dbc270004f3c38db42600048dbc270004b81000011000012d100001100001c1f80289c2c1ea1f01d0d1f87428ba000485d2741f5589e583ec105068100001100001ffd283c410c9c38db600048dbf0004f3c38db42600048dbc270004803d100001100002756755a114000110000189e55653bb0c0001100001be08000110000181eb080001100001c1fb0283eb0139d873178d76000183c001a3140001100001ff1486a114000110000139d872ece827ffffffb8000485c0741083ec0c681c130002e8b1eeffff83c410c605100001100001018d65f85b5e5dc3f3c38db42600048dbc270004b8000485c074275589e583ec1068180001100001681c130002e872eeffff83c410c9e909ffffff89f68dbc270004e9fbfeffff5589e583ec0883ec0868ea12000268fc120002e871000383c410b80004c9c38d4c240483e4f0ff71fc5589e55183ec0483ec08680813000268fc120002e844000383c410b800048b4dfcc98d61fcc35589e55dc35589e583ec0c8b45108b551c6a000183e20fc1e00409d00fb6c050ff7518ff7514ff750cff75086a10e83e0003c9c35531c089e557538b7d0c83cbff89d9f2ae8b7d08f7d18d51ff89d9f2ae89c85151f7d06a045248ff750c6a0450ff7508e89cffffff8d65f85b5f5dc35589e55756538b45088b5d0c8b4d108b55148b75188b7d1c8b6d20cd405b5e5f5dc38b442404cdf0faf4669066906690669066906690a1000210000183f8ff74365589e553bb000210000183ec048d7600018dbc27000483eb04ffd08b0383f8ff75f483c4045b5dc38db42600048dbc270004f3c3e809feffffc20002436f6e7472616374206372656174696f6e000148656c6c6f20576f726c640001457865637574696f6e2053756363657373210002140007017a520001017c08011b0c0404880100021c00031c000369feffff220004410e088502420d055ec50c040400022800033c00036bfeffff330004440c01000147100502750001430f03757c06600c01000141c5430c040400011c000368000372feffff050004410e088502420d0541c50c040400021c000388000357feffff2f0004410e088502420d056bc50c04040002240003a8000366feffff3c0004410e088502440d05428703830472c341c741c50c04040005ffffffff0004ffffffff0004 From f896b240265ea85b212ae86feedde8ba3ef7924a Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Mon, 10 Jun 2019 16:07:06 -0500 Subject: [PATCH 07/19] fixups Signed-off-by: VoR0220 --- proto-x86/test/helloworld.elf | Bin 10136 -> 0 bytes proto-x86/test/helloworld.o | Bin 1680 -> 0 bytes proto-x86/test/helloworld.qbit | 1 - proto-x86/toolchain/Dockerfile.install | 77 ------------------------- 4 files changed, 78 deletions(-) delete mode 100755 proto-x86/test/helloworld.elf delete mode 100644 proto-x86/test/helloworld.o delete mode 100644 proto-x86/test/helloworld.qbit delete mode 100644 proto-x86/toolchain/Dockerfile.install diff --git a/proto-x86/test/helloworld.elf b/proto-x86/test/helloworld.elf deleted file mode 100755 index bd13f42bb2824bc511b432da67361ddf6fca6f5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10136 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 L&_^%hZxXi+uD-zF diff --git a/proto-x86/test/helloworld.qbit b/proto-x86/test/helloworld.qbit deleted file mode 100644 index 84893ab..0000000 --- a/proto-x86/test/helloworld.qbit +++ /dev/null @@ -1 +0,0 @@ -0c0400000004ec030002100007e9200003666666e863010002e88e020002c2000dbc000118200001e8deffffffe8cb010002a1040002d083f801740db80004e884010002cdf0f4b80004e855010002ebf16690669066906690669066906690b81000011000013d1000011000017424b8000485c0741b5589e583ec1468100001100001ffd083c410c9c389f68dbc270004f3c38db42600048dbc270004b81000011000012d100001100001c1f80289c2c1ea1f01d0d1f87428ba000485d2741f5589e583ec105068100001100001ffd283c410c9c38db600048dbf0004f3c38db42600048dbc270004803d100001100002756755a114000110000189e55653bb0c0001100001be08000110000181eb080001100001c1fb0283eb0139d873178d76000183c001a3140001100001ff1486a114000110000139d872ece827ffffffb8000485c0741083ec0c681c130002e8b1eeffff83c410c605100001100001018d65f85b5e5dc3f3c38db42600048dbc270004b8000485c074275589e583ec1068180001100001681c130002e872eeffff83c410c9e909ffffff89f68dbc270004e9fbfeffff5589e583ec0883ec0868ea12000268fc120002e871000383c410b80004c9c38d4c240483e4f0ff71fc5589e55183ec0483ec08680813000268fc120002e844000383c410b800048b4dfcc98d61fcc35589e55dc35589e583ec0c8b45108b551c6a000183e20fc1e00409d00fb6c050ff7518ff7514ff750cff75086a10e83e0003c9c35531c089e557538b7d0c83cbff89d9f2ae8b7d08f7d18d51ff89d9f2ae89c85151f7d06a045248ff750c6a0450ff7508e89cffffff8d65f85b5f5dc35589e55756538b45088b5d0c8b4d108b55148b75188b7d1c8b6d20cd405b5e5f5dc38b442404cdf0faf4669066906690669066906690a1000210000183f8ff74365589e553bb000210000183ec048d7600018dbc27000483eb04ffd08b0383f8ff75f483c4045b5dc38db42600048dbc270004f3c3e809feffffc20002436f6e7472616374206372656174696f6e000148656c6c6f20576f726c640001457865637574696f6e2053756363657373210002140007017a520001017c08011b0c0404880100021c00031c000369feffff220004410e088502420d055ec50c040400022800033c00036bfeffff330004440c01000147100502750001430f03757c06600c01000141c5430c040400011c000368000372feffff050004410e088502420d0541c50c040400021c000388000357feffff2f0004410e088502420d056bc50c04040002240003a8000366feffff3c0004410e088502440d05428703830472c341c741c50c04040005ffffffff0004ffffffff0004 diff --git a/proto-x86/toolchain/Dockerfile.install b/proto-x86/toolchain/Dockerfile.install deleted file mode 100644 index 4a0c193..0000000 --- a/proto-x86/toolchain/Dockerfile.install +++ /dev/null @@ -1,77 +0,0 @@ -FROM qtumtoolchain-alpine-build - -ENV PREFIX=/opt/cross -ENV TARGET=i686-elf -ENV SYSROOT=/opt/x86-compiler/sysroot -ENV PATH=${PATH}:${SYSROOT}/bin:$PREFIX/bin:/root/qtum:/root/qtum:/root/qtum-docker/proto-x86/utils - -# build the freestanding compiler -RUN set -ex \ - && cd x86-toolchain \ - && mkdir build-binutils \ - && cd build-binutils \ - && ../binutils-2.29/configure --target="$TARGET" --prefix="$PREFIX" --disable-werror \ - && make \ - && make install \ - && cd .. \ - && mkdir build-gcc \ - && cd gcc-7.2.0 \ - && ./contrib/download_prerequisites \ - && cd ../build-gcc \ - && ../gcc-7.2.0/configure --target="$TARGET" --prefix="$PREFIX" --enable-languages=c,c++ \ - && make all-gcc -j4 \ - && make all-target-libgcc \ - && make install-gcc \ - && make install-target-libgcc - -ENV TARGET=i686-qtum - -#compile QtumOS compiler and supports -RUN set -ex \ - && ls $PREFIX/bin \ - && i686-elf-gcc -v \ - && cd FsLibc \ - && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=cross-toolchain.cmake -DCMAKE_INSTALL_PREFIX=$SYSROOT/usr . \ - && make -C libc \ - && make -C libc install \ - && cd ~/x86-toolchain/crtfiles \ - && make \ - && cd .. \ - && mkdir -p $SYSROOT/usr/lib \ - && mkdir -p $SYSROOT/usr/include \ - && cp crtfiles/*.o $SYSROOT/usr/lib/ \ - && cp -r includes/* $SYSROOT/usr/include/ \ - && rm -rf build-binutils \ - && mkdir build-binutils \ - && cd build-binutils \ - && ../binutils-2.29/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot="$SYSROOT" --disable-werror \ - && make \ - && make install \ - && cd .. \ - && rm -rf build-gcc \ - && mkdir build-gcc \ - && cd build-gcc \ - && ../gcc-7.2.0/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot="$SYSROOT" --enable-languages=c \ - && make all-gcc -j4 \ - && make all-target-libgcc \ - && make install-gcc \ - && make install-target-libgcc - -# build qtum -RUN set -ex \ - && cd qtum-compile \ - && ./autogen.sh \ - && ./configure --disable-tests --without-gui \ - && make $MAKE_SUFFIX - -# build x86lib utility -RUN set -ex \ - && cd qtum-compile/src/x86lib \ - && make $MAKE_SUFFIX - -# build libqtum -RUN set -ex \ - && cd libqtum \ - && make \ - && make deploy \ - && make deploy \ No newline at end of file From 7e42893935e190c50735f91f67dac59d137d32fd Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Thu, 13 Jun 2019 13:31:49 -0500 Subject: [PATCH 08/19] adjust helpers.sh and edit dockerfile Signed-off-by: VoR0220 --- proto-x86/client/Dockerfile | 8 +++++++- proto-x86/client/qtum.conf | 2 +- proto-x86/helpers.sh | 8 ++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/proto-x86/client/Dockerfile b/proto-x86/client/Dockerfile index 5539a2f..a3fc9b7 100644 --- a/proto-x86/client/Dockerfile +++ b/proto-x86/client/Dockerfile @@ -25,6 +25,12 @@ RUN apk update && apk add boost boost-filesystem \ # COPY qtum.conf /qtum.conf +# create data directory +ENV QTUM_DATA /data +RUN mkdir $QTUM_DATA \ + && ln -sfn $QTUM_DATA /.qtum +VOLUME /data + EXPOSE 3888 3889 13888 13889 ENV PATH=${PATH}:/usr/local/bin: -CMD ["qtumd", "-conf=/qtum.conf", "-regtest", "-logevents", "-rest=1", "-server=1", "-printtoconsole", "-txindex=1"] \ No newline at end of file +CMD ["qtumd", "-regtest", "-logevents", "-printtoconsole"] \ No newline at end of file diff --git a/proto-x86/client/qtum.conf b/proto-x86/client/qtum.conf index ef8f855..fb13419 100644 --- a/proto-x86/client/qtum.conf +++ b/proto-x86/client/qtum.conf @@ -1,6 +1,6 @@ regtest=1 server=1 -rpcbind=0.0.0.0:3888 +rpcbind=127.0.0.1:3888 rpcuser=user rpcpassword=password rpcallowip=0.0.0.0/0 diff --git a/proto-x86/helpers.sh b/proto-x86/helpers.sh index 040076e..7eb6354 100755 --- a/proto-x86/helpers.sh +++ b/proto-x86/helpers.sh @@ -1,6 +1,6 @@ #!/bin/bash function qx86start() { - docker run --rm -v "${PWD}:/root/bind" --name qx86 -d qtumx86 qtum/qtumd -regtest -logevents + docker run --rm -v "${PWD}:/root/bind" --name qx86 -d qtum-alpine qtumd -regtest -logevents } export -f qx86start @@ -9,10 +9,10 @@ function qx86stop() { } export -f qx86stop -alias qx86cli='docker exec qx86 qcli' +alias qx86cli='docker exec qx86 qtum-cli -regtest' function qx86deploy() { - docker exec -t qx86 deploy_contract `cat $1` + docker exec -t qx86 qtum-cli -regtest createcontract `cat $1` } export -f qx86deploy @@ -22,7 +22,7 @@ function qx86tb() { export -f qx86tb function qx86make() { - docker run --rm -v "${PWD}:/root/bind" qtumx86 qmake "$@" + docker run --rm -v "${PWD}:/root/bind" -w "/root/bind" qtumtoolchain-alpine make } export -f qx86make From 4449ffe0b4e00ccc695690478c2565f9ba98a345 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Fri, 14 Jun 2019 11:57:26 -0500 Subject: [PATCH 09/19] pushing up the qbit file and some debugging bits Signed-off-by: VoR0220 --- proto-x86/client/Dockerfile.build | 2 +- proto-x86/helpers.sh | 2 +- proto-x86/test/helloworld.qbit | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 proto-x86/test/helloworld.qbit diff --git a/proto-x86/client/Dockerfile.build b/proto-x86/client/Dockerfile.build index 3bc4bf8..52ee073 100644 --- a/proto-x86/client/Dockerfile.build +++ b/proto-x86/client/Dockerfile.build @@ -1,2 +1,2 @@ FROM alpine-dev -RUN set -ex && git clone https://github.com/qtumproject/qtum.git --recursive && cd qtum && git checkout proto-x86 \ No newline at end of file +RUN set -ex && git clone https://github.com/qtumproject/qtum-x86.git --recursive && cd qtum && git checkout qtum-x86 \ No newline at end of file diff --git a/proto-x86/helpers.sh b/proto-x86/helpers.sh index 7eb6354..7a9608d 100755 --- a/proto-x86/helpers.sh +++ b/proto-x86/helpers.sh @@ -1,6 +1,6 @@ #!/bin/bash function qx86start() { - docker run --rm -v "${PWD}:/root/bind" --name qx86 -d qtum-alpine qtumd -regtest -logevents + docker run -v "${PWD}:/root/bind" --name qx86 qtum-alpine qtumd -regtest -logevents -printtoconsole -debug=1 } export -f qx86start diff --git a/proto-x86/test/helloworld.qbit b/proto-x86/test/helloworld.qbit new file mode 100644 index 0000000..84893ab --- /dev/null +++ b/proto-x86/test/helloworld.qbit @@ -0,0 +1 @@ +0c0400000004ec030002100007e9200003666666e863010002e88e020002c2000dbc000118200001e8deffffffe8cb010002a1040002d083f801740db80004e884010002cdf0f4b80004e855010002ebf16690669066906690669066906690b81000011000013d1000011000017424b8000485c0741b5589e583ec1468100001100001ffd083c410c9c389f68dbc270004f3c38db42600048dbc270004b81000011000012d100001100001c1f80289c2c1ea1f01d0d1f87428ba000485d2741f5589e583ec105068100001100001ffd283c410c9c38db600048dbf0004f3c38db42600048dbc270004803d100001100002756755a114000110000189e55653bb0c0001100001be08000110000181eb080001100001c1fb0283eb0139d873178d76000183c001a3140001100001ff1486a114000110000139d872ece827ffffffb8000485c0741083ec0c681c130002e8b1eeffff83c410c605100001100001018d65f85b5e5dc3f3c38db42600048dbc270004b8000485c074275589e583ec1068180001100001681c130002e872eeffff83c410c9e909ffffff89f68dbc270004e9fbfeffff5589e583ec0883ec0868ea12000268fc120002e871000383c410b80004c9c38d4c240483e4f0ff71fc5589e55183ec0483ec08680813000268fc120002e844000383c410b800048b4dfcc98d61fcc35589e55dc35589e583ec0c8b45108b551c6a000183e20fc1e00409d00fb6c050ff7518ff7514ff750cff75086a10e83e0003c9c35531c089e557538b7d0c83cbff89d9f2ae8b7d08f7d18d51ff89d9f2ae89c85151f7d06a045248ff750c6a0450ff7508e89cffffff8d65f85b5f5dc35589e55756538b45088b5d0c8b4d108b55148b75188b7d1c8b6d20cd405b5e5f5dc38b442404cdf0faf4669066906690669066906690a1000210000183f8ff74365589e553bb000210000183ec048d7600018dbc27000483eb04ffd08b0383f8ff75f483c4045b5dc38db42600048dbc270004f3c3e809feffffc20002436f6e7472616374206372656174696f6e000148656c6c6f20576f726c640001457865637574696f6e2053756363657373210002140007017a520001017c08011b0c0404880100021c00031c000369feffff220004410e088502420d055ec50c040400022800033c00036bfeffff330004440c01000147100502750001430f03757c06600c01000141c5430c040400011c000368000372feffff050004410e088502420d0541c50c040400021c000388000357feffff2f0004410e088502420d056bc50c04040002240003a8000366feffff3c0004410e088502440d05428703830472c341c741c50c04040005ffffffff0004ffffffff0004 From 3b74253798278542325aa9265bbf19717b0b629a Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Tue, 18 Jun 2019 13:27:45 -0500 Subject: [PATCH 10/19] change makefile to use qx86codeify and delete unnecessary bash scripts Signed-off-by: VoR0220 --- proto-x86/build_qtumx86 | 2 -- proto-x86/helpers.sh | 2 +- proto-x86/test/Makefile | 2 +- proto-x86/toolchain/Dockerfile | 6 +++++- proto-x86/toolchain/Dockerfile.build | 1 + proto-x86/utils/deploy_contract | 5 ----- proto-x86/utils/qcli | 4 ---- proto-x86/utils/qmake | 13 ------------- proto-x86/utils/start_qtum | 0 proto-x86/utils/stop_qtum | 0 proto-x86/utils/x86tb | 3 --- 11 files changed, 8 insertions(+), 30 deletions(-) delete mode 100755 proto-x86/build_qtumx86 delete mode 100755 proto-x86/utils/deploy_contract delete mode 100755 proto-x86/utils/qcli delete mode 100755 proto-x86/utils/qmake delete mode 100755 proto-x86/utils/start_qtum delete mode 100755 proto-x86/utils/stop_qtum delete mode 100755 proto-x86/utils/x86tb diff --git a/proto-x86/build_qtumx86 b/proto-x86/build_qtumx86 deleted file mode 100755 index 3202e74..0000000 --- a/proto-x86/build_qtumx86 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -docker build -t qtumx86 -f Dockerfile . \ No newline at end of file diff --git a/proto-x86/helpers.sh b/proto-x86/helpers.sh index 7a9608d..ed7e001 100755 --- a/proto-x86/helpers.sh +++ b/proto-x86/helpers.sh @@ -1,6 +1,6 @@ #!/bin/bash function qx86start() { - docker run -v "${PWD}:/root/bind" --name qx86 qtum-alpine qtumd -regtest -logevents -printtoconsole -debug=1 + docker run --rm -v "${PWD}:/root/bind" --name qx86 -d qtum-alpine qtumd -regtest -logevents -printtoconsole -debug=1 } export -f qx86start diff --git a/proto-x86/test/Makefile b/proto-x86/test/Makefile index f1c8885..21b5ae7 100644 --- a/proto-x86/test/Makefile +++ b/proto-x86/test/Makefile @@ -16,7 +16,7 @@ LDFLAGS += -Wl,--gc-section default: $(BYTECODE) $(BYTECODE): $(OUTPUT) - x86testbench -assemble -raw $(OUTPUT) > $(BYTECODE) + qx86-codeify -elf $(OUTPUT) -hex -o $(BYTECODE) $(OUTPUT): $(C_OBJS) $(CC) $(LDFLAGS) -o $(OUTPUT) $(C_OBJS) $(LIBS) diff --git a/proto-x86/toolchain/Dockerfile b/proto-x86/toolchain/Dockerfile index bf07720..2411cd0 100644 --- a/proto-x86/toolchain/Dockerfile +++ b/proto-x86/toolchain/Dockerfile @@ -5,6 +5,10 @@ ENV TARGET=i686-elf ENV SYSROOT=/opt/x86-compiler/sysroot ENV PATH=${PATH}:${SYSROOT}/bin:$PREFIX/bin:/root/qtum:/root/qtum:/root/qtum-docker/proto-x86/utils +RUN set -ex \ + && cd qx86-codeify \ + && make -j4 + # build the freestanding compiler RUN set -ex \ && cd x86-toolchain \ @@ -88,10 +92,10 @@ RUN apk --no-cache add make \ boost-dev COPY --from=0 /lib /lib +COPY --from=0 /qx86-codeify/qx86-codeify /usr/local/bin COPY --from=0 /opt/cross /opt/cross COPY --from=0 /opt/x86-compiler/sysroot /opt/x86-compiler/sysroot COPY --from=0 /usr/include /usr/include -COPY --from=qtum-alpine /usr/local/bin/x86testbench ./usr/local/bin ENV PATH=${PATH}:/opt/x86-compiler/sysroot/bin:/opt/cross/bin:/root/qtum:/usr/local/bin ENV CC=i686-qtum-gcc diff --git a/proto-x86/toolchain/Dockerfile.build b/proto-x86/toolchain/Dockerfile.build index ff1b1b9..d1ec336 100644 --- a/proto-x86/toolchain/Dockerfile.build +++ b/proto-x86/toolchain/Dockerfile.build @@ -8,6 +8,7 @@ RUN git clone $REPO_PREFIX/x86-toolchain RUN git clone $REPO_PREFIX/FsLibc && cd FsLibc && git checkout $BRANCH RUN git clone $REPO_PREFIX/qtum qtum-compile --recursive && cd qtum-compile \ && git checkout $BRANCH +RUN git clone $REPO_PREFIX/qx86-codeify # get libqtum RUN set -ex \ && git clone $REPO_PREFIX/libqtum \ diff --git a/proto-x86/utils/deploy_contract b/proto-x86/utils/deploy_contract deleted file mode 100755 index 35ea59b..0000000 --- a/proto-x86/utils/deploy_contract +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - - -# bytecode, gaslimit, gasprice, senderaddress, broadcast -qcli createcontract "$@" \ No newline at end of file diff --git a/proto-x86/utils/qcli b/proto-x86/utils/qcli deleted file mode 100755 index 067039c..0000000 --- a/proto-x86/utils/qcli +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd ~/bind -~/qtum/qtum-cli -regtest "$@" \ No newline at end of file diff --git a/proto-x86/utils/qmake b/proto-x86/utils/qmake deleted file mode 100755 index 75e6151..0000000 --- a/proto-x86/utils/qmake +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -export CC=i686-qtum-gcc -export LD=i686-qtum-ld -export CXX=i686-qtum-g++ -export CPP=i686-qtum-cpp -export AR=i686-qtum-ar -export STRIP=i686-qtum-strip -export OBJCOPY=i686-qtum-objcopy - -cd ${HOME}/bind - -make "$@" \ No newline at end of file diff --git a/proto-x86/utils/start_qtum b/proto-x86/utils/start_qtum deleted file mode 100755 index e69de29..0000000 diff --git a/proto-x86/utils/stop_qtum b/proto-x86/utils/stop_qtum deleted file mode 100755 index e69de29..0000000 diff --git a/proto-x86/utils/x86tb b/proto-x86/utils/x86tb deleted file mode 100755 index fe6a5e9..0000000 --- a/proto-x86/utils/x86tb +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -~/qtum/src/x86testbench "$@" \ No newline at end of file From cbc01200fa0ba0a34271a335fe383367c16b897e Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Tue, 18 Jun 2019 13:30:37 -0500 Subject: [PATCH 11/19] should not be in the git repo Signed-off-by: VoR0220 --- proto-x86/test/helloworld.qbit | 1 - 1 file changed, 1 deletion(-) delete mode 100644 proto-x86/test/helloworld.qbit diff --git a/proto-x86/test/helloworld.qbit b/proto-x86/test/helloworld.qbit deleted file mode 100644 index 84893ab..0000000 --- a/proto-x86/test/helloworld.qbit +++ /dev/null @@ -1 +0,0 @@ -0c0400000004ec030002100007e9200003666666e863010002e88e020002c2000dbc000118200001e8deffffffe8cb010002a1040002d083f801740db80004e884010002cdf0f4b80004e855010002ebf16690669066906690669066906690b81000011000013d1000011000017424b8000485c0741b5589e583ec1468100001100001ffd083c410c9c389f68dbc270004f3c38db42600048dbc270004b81000011000012d100001100001c1f80289c2c1ea1f01d0d1f87428ba000485d2741f5589e583ec105068100001100001ffd283c410c9c38db600048dbf0004f3c38db42600048dbc270004803d100001100002756755a114000110000189e55653bb0c0001100001be08000110000181eb080001100001c1fb0283eb0139d873178d76000183c001a3140001100001ff1486a114000110000139d872ece827ffffffb8000485c0741083ec0c681c130002e8b1eeffff83c410c605100001100001018d65f85b5e5dc3f3c38db42600048dbc270004b8000485c074275589e583ec1068180001100001681c130002e872eeffff83c410c9e909ffffff89f68dbc270004e9fbfeffff5589e583ec0883ec0868ea12000268fc120002e871000383c410b80004c9c38d4c240483e4f0ff71fc5589e55183ec0483ec08680813000268fc120002e844000383c410b800048b4dfcc98d61fcc35589e55dc35589e583ec0c8b45108b551c6a000183e20fc1e00409d00fb6c050ff7518ff7514ff750cff75086a10e83e0003c9c35531c089e557538b7d0c83cbff89d9f2ae8b7d08f7d18d51ff89d9f2ae89c85151f7d06a045248ff750c6a0450ff7508e89cffffff8d65f85b5f5dc35589e55756538b45088b5d0c8b4d108b55148b75188b7d1c8b6d20cd405b5e5f5dc38b442404cdf0faf4669066906690669066906690a1000210000183f8ff74365589e553bb000210000183ec048d7600018dbc27000483eb04ffd08b0383f8ff75f483c4045b5dc38db42600048dbc270004f3c3e809feffffc20002436f6e7472616374206372656174696f6e000148656c6c6f20576f726c640001457865637574696f6e2053756363657373210002140007017a520001017c08011b0c0404880100021c00031c000369feffff220004410e088502420d055ec50c040400022800033c00036bfeffff330004440c01000147100502750001430f03757c06600c01000141c5430c040400011c000368000372feffff050004410e088502420d0541c50c040400021c000388000357feffff2f0004410e088502420d056bc50c04040002240003a8000366feffff3c0004410e088502440d05428703830472c341c741c50c04040005ffffffff0004ffffffff0004 From 000775de4000b653db69c0450772dd4e73c837c4 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Fri, 21 Jun 2019 14:57:10 -0500 Subject: [PATCH 12/19] add simpleabi, modify helpers, add installation script, take boost out of toolchain, delete old docker Signed-off-by: VoR0220 --- proto-x86/Dockerfile | 147 ---------------------------- proto-x86/client/Dockerfile | 4 +- proto-x86/client/Dockerfile.build | 2 +- proto-x86/client/Dockerfile.install | 7 +- proto-x86/client/build.sh | 2 +- proto-x86/helpers.sh | 9 +- proto-x86/simpleabi/Dockerfile | 11 +++ proto-x86/toolchain/Dockerfile | 13 +-- 8 files changed, 24 insertions(+), 171 deletions(-) delete mode 100644 proto-x86/Dockerfile create mode 100644 proto-x86/simpleabi/Dockerfile diff --git a/proto-x86/Dockerfile b/proto-x86/Dockerfile deleted file mode 100644 index ce246a6..0000000 --- a/proto-x86/Dockerfile +++ /dev/null @@ -1,147 +0,0 @@ -FROM ubuntu -LABEL maintainers "earlz, VoR0220" - -WORKDIR /root -RUN set -emx \ - && apt-get update \ - && apt-get install -y -qq --no-install-recommends ca-certificates curl wget apt-utils build-essential git libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils git cmake libboost-all-dev software-properties-common texinfo bison flex libmpc-dev libmpfr-dev libgmp3-dev yasm golang-go\ - && add-apt-repository ppa:bitcoin/bitcoin -y \ - && apt-get update \ - && apt-get install libdb4.8-dev libdb4.8++-dev -y -qq --no-install-recommends - - -ENV REPO_PREFIX=https://github.com/qtumproject -ENV BRANCH=proto-x86 -ENV MAKE_SUFFIX=-j2 - - -# get x86-toolchain source -RUN set -ex \ - && git clone $REPO_PREFIX/x86-toolchain \ - && cd x86-toolchain \ - && git checkout $BRANCH - - - - -ENV PREFIX=/opt/cross -ENV TARGET=i686-elf -ENV SYSROOT=/opt/x86-compiler/sysroot -ENV PATH=${PATH}:${SYSROOT}/bin:$PREFIX/bin:/root/qtum:/root/qtum:/root/qtum-docker/proto-x86/utils:/root/go/bin - -# build the freestanding compiler -RUN set -ex \ - && cd x86-toolchain \ - && mkdir build-binutils \ - && cd build-binutils \ - && ../binutils-2.29/configure --target="$TARGET" --prefix="$PREFIX" --disable-werror \ - && make \ - && make install \ - && cd .. \ - && mkdir build-gcc \ - && cd build-gcc \ - && ../gcc-7.2.0/configure --target="$TARGET" --prefix="$PREFIX" --enable-languages=c,c++ \ - && make all-gcc \ - && make all-target-libgcc \ - && make install-gcc \ - && make install-target-libgcc - -#get libc -RUN set -ex \ - && git clone $REPO_PREFIX/FsLibc \ - && cd FsLibc \ - && git checkout $BRANCH - -ENV TARGET=i686-qtum - -#compile QtumOS compiler and supports -RUN set -ex \ - && ls $PREFIX/bin \ - && i686-elf-gcc -v \ - && cd FsLibc \ - && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=cross-toolchain.cmake -DCMAKE_INSTALL_PREFIX=$SYSROOT/usr . \ - && make -C libc \ - && make -C libc install \ - && cd ~/x86-toolchain/crtfiles \ - && make \ - && cd .. \ - && mkdir -p $SYSROOT/usr/lib \ - && mkdir -p $SYSROOT/usr/include \ - && cp crtfiles/*.o $SYSROOT/usr/lib/ \ - && cp -r includes/* $SYSROOT/usr/include/ \ - && rm -rf build-binutils \ - && mkdir build-binutils \ - && cd build-binutils \ - && ../binutils-2.29/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot="$SYSROOT" --disable-werror \ - && make \ - && make install \ - && cd .. \ - && rm -rf build-gcc \ - && mkdir build-gcc \ - && cd build-gcc \ - && ../gcc-7.2.0/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot="$SYSROOT" --enable-languages=c \ - && make all-gcc \ - && make all-target-libgcc \ - && make install-gcc \ - && make install-target-libgcc - - - -# get qtum source -RUN set -ex \ - && git clone $REPO_PREFIX/qtum qtum-compile --recursive \ - && cd qtum-compile \ - && git checkout $BRANCH - -# build qtum -RUN set -ex \ - && cd qtum-compile \ - && ./autogen.sh \ - && ./configure --disable-tests --without-gui \ - && make $MAKE_SUFFIX - -# build x86lib utility -RUN set -ex \ - && cd qtum-compile/src/x86lib \ - && make $MAKE_SUFFIX - -#install qtum tools -RUN set -ex \ - && cd qtum-compile \ - && mkdir /root/qtum \ - && cp src/qtumd src/qtum-cli src/qtum-tx src/x86lib/x86testbench /root/qtum - -# get libqtum -RUN set -ex \ - && git clone $REPO_PREFIX/libqtum \ - && cd libqtum \ - && git checkout $BRANCH - -# build libqtum -RUN set -ex \ - && cd libqtum \ - && make \ - && make deploy - -# get simpleabi (this url should change in the future) -RUN go get -u github.com/qtumproject/SimpleABI && go install github.com/qtumproject/SimpleABI - -# get docker helpers -RUN set -ex \ - && git clone $REPO_PREFIX/qtum-docker \ - && cd qtum-docker \ - && git checkout $BRANCH - -#clean up -RUN set -ex \ - && rm -rf qtum-compile \ - && rm -rf x86-toolchain - -# create data directory -ENV QTUM_DATA /data -RUN mkdir $QTUM_DATA \ - && ln -sfn $QTUM_DATA /root/.qtum \ -VOLUME /data - -EXPOSE 3888 3889 13888 13889 -CMD ["qtumd", "-regtest", "-logevents"] diff --git a/proto-x86/client/Dockerfile b/proto-x86/client/Dockerfile index a3fc9b7..0f3cc5a 100644 --- a/proto-x86/client/Dockerfile +++ b/proto-x86/client/Dockerfile @@ -8,7 +8,6 @@ FROM alpine # COPY --from=build /usr/local/bin/qtumd /usr/local/bin COPY --from=build /usr/local/bin/qtum-cli /usr/local/bin -COPY --from=build /qtum/src/x86lib/x86testbench /usr/local/bin/x86testbench # # Install all dependencies # @@ -17,7 +16,8 @@ RUN apk update && apk add boost boost-filesystem \ boost-system boost-thread \ boost-random busybox db-c++ \ libevent libgcc libressl2.7-libcrypto \ - libstdc++ musl + libstdc++ musl \ + gdb # # Copy the qtum.conf file from diff --git a/proto-x86/client/Dockerfile.build b/proto-x86/client/Dockerfile.build index 52ee073..f3e45ad 100644 --- a/proto-x86/client/Dockerfile.build +++ b/proto-x86/client/Dockerfile.build @@ -1,2 +1,2 @@ FROM alpine-dev -RUN set -ex && git clone https://github.com/qtumproject/qtum-x86.git --recursive && cd qtum && git checkout qtum-x86 \ No newline at end of file +RUN set -ex && git clone https://github.com/qtumproject/qtum-x86.git --recursive && cd qtum-x86 && git checkout qtum-x86 \ No newline at end of file diff --git a/proto-x86/client/Dockerfile.install b/proto-x86/client/Dockerfile.install index e0e7d3f..eb16785 100644 --- a/proto-x86/client/Dockerfile.install +++ b/proto-x86/client/Dockerfile.install @@ -1,6 +1,6 @@ FROM qtum-alpine-build -RUN (cd qtum && ./autogen.sh && \ - ./configure --disable-tests \ +RUN (cd qtum-x86 && ./autogen.sh && \ + ./configure --enable-debug --disable-tests \ --disable-bench --disable-static \ --without-gui --disable-zmq \ --with-incompatible-bdb \ @@ -9,5 +9,4 @@ RUN (cd qtum && ./autogen.sh && \ strip src/qtumd && \ strip src/qtum-cli && \ strip src/qtum-tx && \ - make install && make clean && make distclean && \ - cd src/x86lib && make) + make install && make clean && make distclean) diff --git a/proto-x86/client/build.sh b/proto-x86/client/build.sh index b06cd0d..f71b566 100755 --- a/proto-x86/client/build.sh +++ b/proto-x86/client/build.sh @@ -1,4 +1,4 @@ docker build -f Dockerfile.dev -t alpine-dev . docker build -f Dockerfile.build -t qtum-alpine-build . -docker build -f Dockerfile.install -t qtum-alpine-bin . +docker build --no-cache -f Dockerfile.install -t qtum-alpine-bin . docker build -f Dockerfile -t qtum-alpine . \ No newline at end of file diff --git a/proto-x86/helpers.sh b/proto-x86/helpers.sh index ed7e001..a658b86 100755 --- a/proto-x86/helpers.sh +++ b/proto-x86/helpers.sh @@ -1,6 +1,6 @@ #!/bin/bash function qx86start() { - docker run --rm -v "${PWD}:/root/bind" --name qx86 -d qtum-alpine qtumd -regtest -logevents -printtoconsole -debug=1 + docker run --rm -v "${PWD}:/root/bind" --name qx86 -d qtum-alpine qtumd -regtest -logevents -printtoconsole } export -f qx86start @@ -16,18 +16,13 @@ function qx86deploy() { } export -f qx86deploy -function qx86tb() { - docker run --rm -v "${PWD}:/root/bind" qtumx86 x86tb -} -export -f qx86tb - function qx86make() { docker run --rm -v "${PWD}:/root/bind" -w "/root/bind" qtumtoolchain-alpine make } export -f qx86make function qx86simpleabi() { - docker run -it -v "${PWD}:/root/bind" -w /root/bind qtumx86 SimpleABI -a "$1" -d -e + docker run --rm -it -v "${PWD}:/root/bind" -w /root/bind qtum-simpleabi -a "$1" -d -e } export -f qx86simpleabi diff --git a/proto-x86/simpleabi/Dockerfile b/proto-x86/simpleabi/Dockerfile new file mode 100644 index 0000000..ea369ba --- /dev/null +++ b/proto-x86/simpleabi/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.7.3 + +RUN go get -u -v -d github.com/qtumproject/simple-abi && \ + cd /go/src/github.com/qtumproject/simple-abi && \ + CGO_ENABLED=0 GOOS=linux go build -o simple-abi . + +FROM alpine:3.9.4 +LABEL maintainers "earlz, VoR0220" + +COPY --from=0 /go/src/github.com/qtumproject/simple-abi/simple-abi /usr/local/bin +ENTRYPOINT [ "simple-abi" ] \ No newline at end of file diff --git a/proto-x86/toolchain/Dockerfile b/proto-x86/toolchain/Dockerfile index 2411cd0..eb6e30f 100644 --- a/proto-x86/toolchain/Dockerfile +++ b/proto-x86/toolchain/Dockerfile @@ -66,17 +66,17 @@ RUN set -ex \ && cd qtum-compile \ && ./autogen.sh \ && ./configure --disable-tests --without-gui --with-incompatible-bdb\ - && make $MAKE_SUFFIX + && make -j4 # build x86lib utility RUN set -ex \ && cd qtum-compile/src/x86lib \ - && make $MAKE_SUFFIX + && make -j4 # build libqtum RUN set -ex \ && cd libqtum \ - && make \ + && make -j2 \ && make deploy \ && make deploy @@ -84,12 +84,7 @@ FROM alpine:3.9.4 RUN apk --no-cache add make \ musl \ - db-dev \ - boost \ - boost-system \ - boost-program_options \ - boost-filesystem \ - boost-dev + db-dev COPY --from=0 /lib /lib COPY --from=0 /qx86-codeify/qx86-codeify /usr/local/bin From 04aa9f2f4d8773fb91641e03e74fc773247dfb8c Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Fri, 21 Jun 2019 14:58:31 -0500 Subject: [PATCH 13/19] take out gdb and debug symbols Signed-off-by: VoR0220 --- proto-x86/client/Dockerfile | 3 +-- proto-x86/client/Dockerfile.install | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/proto-x86/client/Dockerfile b/proto-x86/client/Dockerfile index 0f3cc5a..92dad8e 100644 --- a/proto-x86/client/Dockerfile +++ b/proto-x86/client/Dockerfile @@ -16,8 +16,7 @@ RUN apk update && apk add boost boost-filesystem \ boost-system boost-thread \ boost-random busybox db-c++ \ libevent libgcc libressl2.7-libcrypto \ - libstdc++ musl \ - gdb + libstdc++ musl # # Copy the qtum.conf file from diff --git a/proto-x86/client/Dockerfile.install b/proto-x86/client/Dockerfile.install index eb16785..e0bedc5 100644 --- a/proto-x86/client/Dockerfile.install +++ b/proto-x86/client/Dockerfile.install @@ -1,6 +1,6 @@ FROM qtum-alpine-build RUN (cd qtum-x86 && ./autogen.sh && \ - ./configure --enable-debug --disable-tests \ + ./configure --disable-tests \ --disable-bench --disable-static \ --without-gui --disable-zmq \ --with-incompatible-bdb \ From 0fcea8f8b23616274693c7489328c3ca7057ad1c Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Mon, 1 Jul 2019 14:58:23 -0500 Subject: [PATCH 14/19] add install.sh Signed-off-by: VoR0220 --- proto-x86/install.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 proto-x86/install.sh diff --git a/proto-x86/install.sh b/proto-x86/install.sh new file mode 100755 index 0000000..4cfb4e6 --- /dev/null +++ b/proto-x86/install.sh @@ -0,0 +1,4 @@ +#!/bin/bash +./client/build.sh +./toolchain/build.sh +cd simpleabi && docker build -t qtum-simpleabi . \ No newline at end of file From 4343d228b61dad5aee808bf8139d199152cb70fc Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Mon, 1 Jul 2019 15:10:02 -0500 Subject: [PATCH 15/19] remove redundancies from old build Signed-off-by: VoR0220 --- proto-x86/toolchain/Dockerfile | 12 ------------ proto-x86/toolchain/Dockerfile.build | 2 -- 2 files changed, 14 deletions(-) diff --git a/proto-x86/toolchain/Dockerfile b/proto-x86/toolchain/Dockerfile index eb6e30f..f0d543f 100644 --- a/proto-x86/toolchain/Dockerfile +++ b/proto-x86/toolchain/Dockerfile @@ -61,18 +61,6 @@ RUN set -ex \ && make install-gcc \ && make install-target-libgcc -# build qtum -RUN set -ex \ - && cd qtum-compile \ - && ./autogen.sh \ - && ./configure --disable-tests --without-gui --with-incompatible-bdb\ - && make -j4 - -# build x86lib utility -RUN set -ex \ - && cd qtum-compile/src/x86lib \ - && make -j4 - # build libqtum RUN set -ex \ && cd libqtum \ diff --git a/proto-x86/toolchain/Dockerfile.build b/proto-x86/toolchain/Dockerfile.build index d1ec336..8a5f1f7 100644 --- a/proto-x86/toolchain/Dockerfile.build +++ b/proto-x86/toolchain/Dockerfile.build @@ -6,8 +6,6 @@ ENV BRANCH=proto-x86 RUN git clone $REPO_PREFIX/x86-toolchain RUN git clone $REPO_PREFIX/FsLibc && cd FsLibc && git checkout $BRANCH -RUN git clone $REPO_PREFIX/qtum qtum-compile --recursive && cd qtum-compile \ - && git checkout $BRANCH RUN git clone $REPO_PREFIX/qx86-codeify # get libqtum RUN set -ex \ From ff2445eb8428e7dffd589c5bca4257aafd0c86cd Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Mon, 1 Jul 2019 15:12:40 -0500 Subject: [PATCH 16/19] add sanity checks to client build Signed-off-by: VoR0220 --- proto-x86/client/Dockerfile.install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto-x86/client/Dockerfile.install b/proto-x86/client/Dockerfile.install index e0bedc5..7fd66e6 100644 --- a/proto-x86/client/Dockerfile.install +++ b/proto-x86/client/Dockerfile.install @@ -1,6 +1,6 @@ FROM qtum-alpine-build RUN (cd qtum-x86 && ./autogen.sh && \ - ./configure --disable-tests \ + ./configure \ --disable-bench --disable-static \ --without-gui --disable-zmq \ --with-incompatible-bdb \ @@ -9,4 +9,4 @@ RUN (cd qtum-x86 && ./autogen.sh && \ strip src/qtumd && \ strip src/qtum-cli && \ strip src/qtum-tx && \ - make install && make clean && make distclean) + make install && make check && make clean && make distclean) From 525fd100cb388a7e7a25ba89a91b6c27d2cf7975 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Mon, 1 Jul 2019 15:42:06 -0500 Subject: [PATCH 17/19] fix of install script Signed-off-by: VoR0220 --- proto-x86/install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proto-x86/install.sh b/proto-x86/install.sh index 4cfb4e6..1b2ca69 100755 --- a/proto-x86/install.sh +++ b/proto-x86/install.sh @@ -1,4 +1,3 @@ #!/bin/bash -./client/build.sh -./toolchain/build.sh +cd client && ./build.sh && cd ../toolchain && ./build.sh cd simpleabi && docker build -t qtum-simpleabi . \ No newline at end of file From ea7d0acb9c7f397b5b7d44501b48398d1c41bb40 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Mon, 1 Jul 2019 16:07:47 -0500 Subject: [PATCH 18/19] ensure output goes through Signed-off-by: VoR0220 --- proto-x86/install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proto-x86/install.sh b/proto-x86/install.sh index 1b2ca69..7220409 100755 --- a/proto-x86/install.sh +++ b/proto-x86/install.sh @@ -1,3 +1,6 @@ #!/bin/bash -cd client && ./build.sh && cd ../toolchain && ./build.sh +cd client +./build.sh +cd ../toolchain +./build.sh cd simpleabi && docker build -t qtum-simpleabi . \ No newline at end of file From c4a13112b1999eee74791d48b70c0e45ce872cb5 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Mon, 1 Jul 2019 17:02:06 -0500 Subject: [PATCH 19/19] fix simple abi portion Signed-off-by: VoR0220 --- proto-x86/install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proto-x86/install.sh b/proto-x86/install.sh index 7220409..7d4369c 100755 --- a/proto-x86/install.sh +++ b/proto-x86/install.sh @@ -3,4 +3,5 @@ cd client ./build.sh cd ../toolchain ./build.sh -cd simpleabi && docker build -t qtum-simpleabi . \ No newline at end of file +cd ../simpleabi +docker build -t qtum-simpleabi . \ No newline at end of file