Skip to content

Commit

Permalink
prepare for misp32 MB
Browse files Browse the repository at this point in the history
  • Loading branch information
rioroll committed Jun 29, 2023
1 parent 3705ede commit 39cf098
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
19 changes: 19 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "Debian",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:bullseye"

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
8 changes: 8 additions & 0 deletions cross-build-tooling.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}
20 changes: 9 additions & 11 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
FROM ghcr.io/cross-rs/mipsel-unknown-linux-musl:main
FROM ghcr.io/cross-rs/mips-unknown-linux-musl:main

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y wget
RUN mkdir -p /opt/vendor && cd /opt/vendor/ && wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1s.tar.gz
RUN cd /opt/vendor/ && tar -xzf openssl-1.1.1s.tar.gz && cd openssl-1.1.1s && ./config shared --prefix=/usr/local/ssl --openssldir=/usr/local/ssl --cross-compile-prefix=mipsel-linux-muslsf- no-asm
# strip the m64 flag from makefile as we targets 32bit build
RUN cd /opt/vendor/openssl-1.1.1s && sed -i "s/-m64//g" Makefile && make && make install
RUN mkdir -p /opt/vendor && cd /opt/vendor/ && wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.7.3.tar.gz
ENV CC=mips-linux-muslsf-gcc
ENV CXX=mips-linux-muslsf-g++
RUN cd /opt/vendor/ && tar -xzf libressl-3.7.3.tar.gz && cd libressl-3.7.3 && ./configure --host=mips-unknown-linux-muslsf --target=mips-unknown-linux-muslsf --disable-shared --disable-check
WORKDIR /opt/vendor/libressl-3.7.3
RUN make install

#RUN rm -rf /usr/lib/libc.so*
#RUN rm -rf /usr/local/mipsel-linux-muslsf/usr/lib/libc.so*
#RUN rm -rf /usr/local/mipsel-linux-muslsf/lib/libc.so*
#RUN cp /usr/local/mipsel-linux-muslsf/lib/libc.a /usr/local/mipsel-linux-muslsf/usr/lib/libc.a
ENV OPENSSL_STATIC=yes
ENV OPENSSL_DIR=/usr/local/ssl
ENV CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_RUSTFLAGS="$CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_RUSTFLAGS -C link-arg=-latomic -C link-arg=-lc -C target-feature=+crt-static -C link-arg=-s -C link-self-contained=yes -L /usr/local/mipsel-linux-muslsf/lib -l static=atomic -l static=c "
ENV CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_RUSTFLAGS="$CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_RUSTFLAGS -C link-arg=-latomic -C link-arg=-lc -C target-feature=+crt-static -C link-arg=-s -C link-self-contained=yes -L /usr/local/mips-linux-muslsf/lib -l static=atomic -l static=c "

0 comments on commit 39cf098

Please sign in to comment.