dockerfile: compile libs for barematel x86_32
This commit is contained in:
@ -18,30 +18,34 @@ RUN apt-get update \
|
|||||||
ninja-build \
|
ninja-build \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
|
|
||||||
|
# TODO: Can't find pthread on X86_32
|
||||||
|
# RUN ln -s /usr/lib/x86_64-linux-gnu/libpthread.so.0 /usr/lib/x86_64-linux-gnu/libpthread.so
|
||||||
|
# RUN ln -s /usr/lib32/libpthread.so.0 /usr/lib32/libpthread.so
|
||||||
|
|
||||||
RUN python3 -m pip config set global.break-system-packages true
|
RUN python3 -m pip config set global.break-system-packages true
|
||||||
|
|
||||||
# Clone WAMR
|
# Clone WAMR
|
||||||
RUN git clone https://github.com/bytecodealliance/wasm-micro-runtime \
|
RUN git clone https://gitea.vps.chriphost.de/christoph/wamr \
|
||||||
&& cd wasm-micro-runtime \
|
&& cd wamr \
|
||||||
&& git checkout WAMR-2.4.4
|
&& git checkout WAMR-2.4.4
|
||||||
WORKDIR /wasm-micro-runtime
|
WORKDIR /wamr
|
||||||
|
|
||||||
# Build WAMR iwasm (vmcore standalone interpreter)
|
# Build WAMR iwasm (vmcore standalone interpreter)
|
||||||
RUN cd product-mini/platforms/linux \
|
# RUN cd product-mini/platforms/linux \
|
||||||
&& mkdir build_iwasm && cd build_iwasm \
|
# && mkdir build_iwasm && cd build_iwasm \
|
||||||
&& cmake \
|
# && cmake \
|
||||||
-DWAMR_BUILD_PLATFORM=linux \
|
# -DWAMR_BUILD_PLATFORM=linux \
|
||||||
-DWAMR_BUILD_TARGET=X86_64 \
|
# -DWAMR_BUILD_TARGET=X86_64 \
|
||||||
-DWAMR_BUILD_AOT=0 \
|
# -DWAMR_BUILD_AOT=0 \
|
||||||
-DWAMR_BUILD_WAMR_COMPILER=0 \
|
# -DWAMR_BUILD_WAMR_COMPILER=0 \
|
||||||
-DWAMR_BUILD_INTERP=1 \
|
# -DWAMR_BUILD_INTERP=1 \
|
||||||
-DWAMR_BUILD_FAST_INTERP=0 \
|
# -DWAMR_BUILD_FAST_INTERP=0 \
|
||||||
-DWAMR_BUILD_JIT=0 \
|
# -DWAMR_BUILD_JIT=0 \
|
||||||
-DWAMR_BUILD_FAST_JIT=0 \
|
# -DWAMR_BUILD_FAST_JIT=0 \
|
||||||
-DWAMR_BUILD_LIBC_BUILTIN=1 \
|
# -DWAMR_BUILD_LIBC_BUILTIN=1 \
|
||||||
-DWAMR_BUILD_LIBC_WASI=1 \
|
# -DWAMR_BUILD_LIBC_WASI=1 \
|
||||||
.. \
|
# .. \
|
||||||
&& make -j$(nproc)
|
# && make -j$(nproc)
|
||||||
|
|
||||||
# Build WAMR wamrc (standalone compiler)
|
# Build WAMR wamrc (standalone compiler)
|
||||||
RUN cd wamr-compiler \
|
RUN cd wamr-compiler \
|
||||||
@ -61,31 +65,43 @@ RUN cd wamr-compiler \
|
|||||||
.. \
|
.. \
|
||||||
&& make -j$(nproc)
|
&& make -j$(nproc)
|
||||||
|
|
||||||
|
# The libs might change often, so re-clone the repository each time.
|
||||||
|
# We don't want this for iwasm/wamrc because their builds take longer.
|
||||||
|
ARG CACHE_DATE=1970-01-01
|
||||||
|
|
||||||
|
# Clone WAMR
|
||||||
|
WORKDIR /
|
||||||
|
RUN git clone https://gitea.vps.chriphost.de/christoph/wamr wamrlib \
|
||||||
|
&& cd wamrlib \
|
||||||
|
&& git checkout WAMR-2.4.4
|
||||||
|
WORKDIR /wamrlib
|
||||||
|
|
||||||
# Build WAMR libvmlib (compiler runtime - to compile wasm modules embedded in a native application)
|
# Build WAMR libvmlib (compiler runtime - to compile wasm modules embedded in a native application)
|
||||||
RUN cd wamr-compiler \
|
# RUN cd wamr-compiler \
|
||||||
&& ./build_llvm.sh \
|
# && ./build_llvm.sh \
|
||||||
# && ./build_llvm.sh --extra-cmake-flags "-DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_EXE_LINKER_FLAGS=-m32 -lstdc++" \
|
# # && ./build_llvm.sh --extra-cmake-flags "-DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_EXE_LINKER_FLAGS=-m32 -lstdc++" \
|
||||||
&& mkdir build_libvmlib && cd build_libvmlib \
|
# && mkdir build_libvmlib && cd build_libvmlib \
|
||||||
&& cmake \
|
# && cmake \
|
||||||
-DWAMR_BUILD_PLATFORM=linux \
|
# -DWAMR_BUILD_PLATFORM=baremetal \
|
||||||
-DWAMR_BUILD_TARGET=X86_64 \
|
# -DWAMR_BUILD_TARGET=X86_32 \
|
||||||
-DWAMR_BUILD_AOT=1 \
|
# -DWAMR_BUILD_AOT=1 \
|
||||||
-DWAMR_BUILD_WAMR_COMPILER=0 \
|
# -DWAMR_BUILD_WAMR_COMPILER=0 \
|
||||||
-DWAMR_BUILD_INTERP=0 \
|
# -DWAMR_BUILD_INTERP=0 \
|
||||||
-DWAMR_BUILD_FAST_INTERP=0 \
|
# -DWAMR_BUILD_FAST_INTERP=0 \
|
||||||
-DWAMR_BUILD_JIT=0 \
|
# -DWAMR_BUILD_JIT=0 \
|
||||||
-DWAMR_BUILD_FAST_JIT=0 \
|
# -DWAMR_BUILD_FAST_JIT=0 \
|
||||||
-DWAMR_BUILD_LIBC_BUILTIN=1 \
|
# -DWAMR_BUILD_LIBC_BUILTIN=1 \
|
||||||
-DWAMR_BUILD_LIBC_WASI=0 \
|
# -DWAMR_BUILD_LIBC_WASI=0 \
|
||||||
.. \
|
# -DWAMR_BUILD_SIMD=0 \
|
||||||
&& make -j$(nproc)
|
# .. \
|
||||||
|
# && make -j$(nproc)
|
||||||
|
|
||||||
# Build WAMR libiwasm (vmcore interpreter runtime - to run wasm modules embedded in a native application)
|
# Build WAMR libiwasm (vmcore interpreter runtime - to run wasm modules embedded in a native application)
|
||||||
RUN mkdir build_libiwasm && cd build_libiwasm \
|
RUN mkdir build_libiwasm && cd build_libiwasm \
|
||||||
&& cmake \
|
&& cmake \
|
||||||
-DWAMR_BUILD_PLATFORM=linux \
|
-DWAMR_BUILD_PLATFORM=baremetal \
|
||||||
-DWAMR_BUILD_TARGET=X86_64 \
|
-DWAMR_BUILD_TARGET=X86_32 \
|
||||||
-DWAMR_BUILD_AOT=1 \
|
-DWAMR_BUILD_AOT=0 \
|
||||||
-DWAMR_BUILD_WAMR_COMPILER=0 \
|
-DWAMR_BUILD_WAMR_COMPILER=0 \
|
||||||
-DWAMR_BUILD_INTERP=1 \
|
-DWAMR_BUILD_INTERP=1 \
|
||||||
-DWAMR_BUILD_FAST_INTERP=0 \
|
-DWAMR_BUILD_FAST_INTERP=0 \
|
||||||
@ -93,6 +109,7 @@ RUN mkdir build_libiwasm && cd build_libiwasm \
|
|||||||
-DWAMR_BUILD_FAST_JIT=0 \
|
-DWAMR_BUILD_FAST_JIT=0 \
|
||||||
-DWAMR_BUILD_LIBC_BUILTIN=1 \
|
-DWAMR_BUILD_LIBC_BUILTIN=1 \
|
||||||
-DWAMR_BUILD_LIBC_WASI=0 \
|
-DWAMR_BUILD_LIBC_WASI=0 \
|
||||||
|
-DWAMR_BUILD_SIMD=0 \
|
||||||
.. \
|
.. \
|
||||||
&& make -j$(nproc)
|
&& make -j$(nproc)
|
||||||
|
|
||||||
@ -112,13 +129,17 @@ RUN apt-get update \
|
|||||||
ranger \
|
ranger \
|
||||||
wabt \
|
wabt \
|
||||||
fish \
|
fish \
|
||||||
|
grub-common \
|
||||||
|
xorriso \
|
||||||
|
grub-pc-bin \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
|
|
||||||
COPY --from=wamr-builder /wasm-micro-runtime /opt/wamr
|
COPY --from=wamr-builder /wamr /opt/wamr
|
||||||
|
COPY --from=wamr-builder /wamrlib /opt/wamrlib
|
||||||
RUN ln -sf /opt/wamr/product-mini/platforms/linux/build_iwasm /opt/wamr-iwasm \
|
RUN ln -sf /opt/wamr/product-mini/platforms/linux/build_iwasm /opt/wamr-iwasm \
|
||||||
&& ln -sf /opt/wamr/build_libiwasm /opt/wamr-libiwasm \
|
|
||||||
&& ln -sf /opt/wamr/wamr-compiler/build_wamrc /opt/wamr-wamrc \
|
&& ln -sf /opt/wamr/wamr-compiler/build_wamrc /opt/wamr-wamrc \
|
||||||
&& ln -sf /opt/wamr/wamr-compiler/build_libvmlib /opt/wamr-libvmlib
|
&& ln -sf /opt/wamrlib/wamr-compiler/build_libvmlib /opt/wamr-libvmlib \
|
||||||
|
&& ln -sf /opt/wamrlib/build_libiwasm /opt/wamr-libiwasm
|
||||||
|
|
||||||
COPY ./examples /home/ubuntu/examples
|
COPY ./examples /home/ubuntu/examples
|
||||||
WORKDIR /home/ubuntu/examples
|
WORKDIR /home/ubuntu/examples
|
||||||
|
|||||||
Reference in New Issue
Block a user