Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating FreeBSD to 12.1 target #467

Merged
merged 1 commit into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ terminate.
| `armv7-unknown-linux-musleabihf` | 1.1.20 | 6.3.0 | | 4.1.0 | ✓ |
| `i586-unknown-linux-gnu` | 2.23 | 5.3.1 | ✓ | N/A | ✓ |
| `i586-unknown-linux-musl` | 1.1.20 | 6.3.0 | | N/A | ✓ |
| `i686-unknown-freebsd` [4] | 12.1 | 6.4.0 | | N/A | ✓ |
| `i686-linux-android` [2] | N/A | 4.9 | ✓ | N/A | ✓ |
| `i686-pc-windows-gnu` | N/A | 7.3.0 | ✓ | N/A | ✓ |
| `i686-unknown-linux-gnu` | 2.15 | 4.6.2 | ✓ | N/A | ✓ |
Expand All @@ -300,6 +301,7 @@ terminate.
| `x86_64-linux-android` [2] | N/A | 4.9 | ✓ | N/A | ✓ |
| `x86_64-pc-windows-gnu` | N/A | 7.3.0 | ✓ | N/A | ✓ |
| `x86_64-sun-solaris` [4] | 2.11 | 5.3.0 | ✓ | N/A | |
| `x86_64-unknown-freebsd` [4] | 12.1 | 6.4.0 | | N/A | ✓ |
| `x86_64-unknown-dragonfly` [4] [3] | 4.6.0 | 5.3.0 | ✓ | N/A | |
| `x86_64-unknown-linux-gnu` | 2.15 | 4.6.2 | ✓ | N/A | ✓ |
| `x86_64-unknown-linux-musl` | 1.1.20 | 6.3.0 | | N/A | ✓ |
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
x86_64-pc-windows-gnu: { TARGET: x86_64-pc-windows-gnu, CPP: 1, STD: 1, RUN: 1 }
i686-pc-windows-gnu: { TARGET: i686-pc-windows-gnu, CPP: 1, STD: 1, RUN: 1 }
# x86_64-unknown-dragonfly: { TARGET: x86_64-unknown-dragonfly, CPP: 1, DYLIB: 1, TOOLCHAIN: nightly }
# i686-unknown-freebsd: { TARGET: i686-unknown-freebsd, DYLIB: 1, STD: 1 }
# x86_64-unknown-freebsd: { TARGET: x86_64-unknown-freebsd, DYLIB: 1, STD: 1 }
i686-unknown-freebsd: { TARGET: i686-unknown-freebsd, DYLIB: 1, STD: 1 }
x86_64-unknown-freebsd: { TARGET: x86_64-unknown-freebsd, DYLIB: 1, STD: 1 }
x86_64-unknown-netbsd: { TARGET: x86_64-unknown-netbsd, CPP: 1, DYLIB: 1, STD: 1 }
sparcv9-sun-solaris: { TARGET: sparcv9-sun-solaris, CPP: 1, DYLIB: 1, STD: 1 }
x86_64-sun-solaris: { TARGET: x86_64-sun-solaris, CPP: 1, DYLIB: 1, STD: 1 }
Expand Down
19 changes: 19 additions & 0 deletions docker/Dockerfile.i686-unknown-freebsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ubuntu:16.04

COPY common.sh /
RUN /common.sh

COPY xargo.sh /
RUN /xargo.sh

COPY freebsd.sh /
RUN /freebsd.sh i686

COPY freebsd-extras.sh /
RUN /freebsd-extras.sh i686

ENV CARGO_TARGET_I686_UNKNOWN_FREEBSD_LINKER=i686-unknown-freebsd12-gcc \
CC_i686_unknown_freebsd=i686-unknown-freebsd12-gcc \
CXX_i686_unknown_freebsd=i686-unknown-freebsd12-g++ \
I686_UNKNOWN_FREEBSD_OPENSSL_DIR=/usr/local/i686-unknown-freebsd12/ \
SQLITE3_LIB_DIR=/usr/local/x86_64-unknown-freebsd12/lib/
19 changes: 19 additions & 0 deletions docker/Dockerfile.x86_64-unknown-freebsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ubuntu:16.04

COPY common.sh /
RUN /common.sh

COPY xargo.sh /
RUN /xargo.sh

COPY freebsd.sh /
RUN /freebsd.sh x86_64

COPY freebsd-extras.sh /
RUN /freebsd-extras.sh x86_64

ENV CARGO_TARGET_X86_64_UNKNOWN_FREEBSD_LINKER=x86_64-unknown-freebsd12-gcc \
CC_x86_64_unknown_freebsd=x86_64-unknown-freebsd12-gcc \
CXX_x86_64_unknown_freebsd=x86_64-unknown-freebsd12-g++ \
X86_64_UNKNOWN_FREEBSD_OPENSSL_DIR=/usr/local/x86_64-unknown-freebsd12/ \
SQLITE3_LIB_DIR=/usr/local/x86_64-unknown-freebsd12/lib/
14 changes: 0 additions & 14 deletions docker/disabled/Dockerfile.i686-unknown-freebsd

This file was deleted.

14 changes: 0 additions & 14 deletions docker/disabled/Dockerfile.x86_64-unknown-freebsd

This file was deleted.

56 changes: 56 additions & 0 deletions docker/freebsd-extras.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash

set -x
set -euo pipefail

main() {
local arch="${1}"

local sqlite_ver=3.33.0,1 \
openssl_ver=1.1.1h,1 \
target="${arch}-unknown-freebsd12"

local td
td="$(mktemp -d)"

mkdir "${td}"/{openssl,sqlite}

pushd "${td}"

local bsd_arch=
case "${arch}" in
x86_64)
bsd_arch=amd64
;;
i686)
bsd_arch=i386
;;
esac

# Adding openssl lib
curl --retry 3 -sSfL "https://pkg.freebsd.org/FreeBSD:12:${bsd_arch}/quarterly/All/openssl-${openssl_ver}.txz" -O
tar -C "${td}/openssl" -xJf openssl-${openssl_ver}.txz /usr/local/lib /usr/local/include/

# Adding sqlite3
curl --retry 3 -sSfL "https://pkg.freebsd.org/FreeBSD:12:${bsd_arch}/quarterly/All/sqlite3-${sqlite_ver}.txz" -O
tar -C "${td}/sqlite" -xJf sqlite3-${sqlite_ver}.txz /usr/local/lib

# Copy the linked library
local destdir="/usr/local/${target}"
cp -r "${td}/openssl/usr/local/include" "${destdir}"
cp "${td}/openssl/usr/local/lib"/lib{crypto,ssl}.a "${destdir}/lib"
cp "${td}/openssl/usr/local/lib"/lib{crypto,ssl}.so.11 "${destdir}/lib"
cp "${td}/openssl/usr/local/lib"/lib{crypto,ssl}.so "${destdir}/lib"
cp "${td}/sqlite/usr/local/lib/libsqlite3.a" "${destdir}/lib"
cp "${td}/sqlite/usr/local/lib/libsqlite3.so.0.8.6" "${destdir}/lib"
cp "${td}/sqlite/usr/local/lib/libsqlite3.so" "${destdir}/lib"
cp "${td}/sqlite/usr/local/lib/libsqlite3.so.0" "${destdir}/lib"

# clean up
popd

rm -rf "${td}"
rm "${0}"
}

main "${@}"
23 changes: 12 additions & 11 deletions docker/freebsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ set -euo pipefail
main() {
local arch="${1}"

local binutils=2.25.1 \
gcc=5.3.0 \
target="${arch}-unknown-freebsd10"
local base_release=12.1 \
binutils=2.32 \
gcc=6.4.0 \
target="${arch}-unknown-freebsd12"

local dependencies=(
bzip2
ca-certificates
curl
g++
Expand All @@ -34,11 +34,11 @@ main() {

mkdir "${td}"/{binutils,gcc}{,-build} "${td}/freebsd"

curl --retry 3 -sSfL "https://ftp.gnu.org/gnu/binutils/binutils-${binutils}.tar.bz2" -O
tar -C "${td}/binutils" --strip-components=1 -xjf "binutils-${binutils}.tar.bz2"
curl --retry 3 -sSfL "https://ftp.gnu.org/gnu/binutils/binutils-${binutils}.tar.gz" -O
tar -C "${td}/binutils" --strip-components=1 -xf "binutils-${binutils}.tar.gz"

curl --retry 3 -sSfL "https://ftp.gnu.org/gnu/gcc/gcc-${gcc}/gcc-${gcc}.tar.bz2" -O
tar -C "${td}/gcc" --strip-components=1 -xjf "gcc-${gcc}.tar.bz2"
curl --retry 3 -sSfL "https://ftp.gnu.org/gnu/gcc/gcc-${gcc}/gcc-${gcc}.tar.gz" -O
tar -C "${td}/gcc" --strip-components=1 -xf "gcc-${gcc}.tar.gz"

pushd "${td}"

Expand All @@ -57,7 +57,7 @@ main() {
;;
esac

curl --retry 3 -sSfL "http://ftp.freebsd.org/pub/FreeBSD/releases/${bsd_arch}/10.2-RELEASE/base.txz" -O
curl --retry 3 -sSfL "http://ftp.freebsd.org/pub/FreeBSD/releases/${bsd_arch}/${base_release}-RELEASE/base.txz" -O
tar -C "${td}/freebsd" -xJf base.txz ./usr/include ./usr/lib ./lib

cd binutils-build
Expand All @@ -71,7 +71,7 @@ main() {
cp -r "${td}/freebsd/usr/include" "${destdir}"
cp "${td}/freebsd/lib/libc.so.7" "${destdir}/lib"
cp "${td}/freebsd/lib/libm.so.5" "${destdir}/lib"
cp "${td}/freebsd/lib/libthr.so.3" "${destdir}/lib/libpthread.so"
cp "${td}/freebsd/lib/libthr.so.3" "${destdir}/lib"
cp "${td}/freebsd/lib/libutil.so.9" "${destdir}/lib"
cp "${td}/freebsd/usr/lib/libc++.so.1" "${destdir}/lib"
cp "${td}/freebsd/usr/lib/libc++.a" "${destdir}/lib"
Expand All @@ -85,10 +85,12 @@ main() {
ln -s libm.so.5 "${destdir}/lib/libm.so"
ln -s librt.so.1 "${destdir}/lib/librt.so"
ln -s libutil.so.9 "${destdir}/lib/libutil.so"
ln -s libthr.so.3 "${destdir}/lib/libpthread.so"

cd gcc-build
../gcc/configure \
--disable-libada \
--disable-libcilkrt \
--disable-libcilkrts \
--disable-libgomp \
--disable-libquadmath \
Expand All @@ -97,7 +99,6 @@ main() {
--disable-libssp \
--disable-libvtv \
--disable-lto \
--disable-multilib \
--disable-nls \
--enable-languages=c,c++ \
--target="${target}"
Expand Down