Skip to content

Commit 8f38035

Browse files
committed
Add some missing files. Get 1.27.0 and 1.28.0 in
1 parent 8f513b9 commit 8f38035

File tree

10 files changed

+146
-3
lines changed

10 files changed

+146
-3
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- src/libstd/build.rs.orig 2018-03-25 14:26:14 UTC
2+
+++ src/libstd/build.rs
3+
@@ -42,9 +42,13 @@ fn main() {
4+
} else if target.contains("freebsd") {
5+
println!("cargo:rustc-link-lib=execinfo");
6+
println!("cargo:rustc-link-lib=pthread");
7+
- } else if target.contains("dragonfly") || target.contains("bitrig") ||
8+
- target.contains("netbsd") || target.contains("openbsd") {
9+
+ } else if target.contains("bitrig") || target.contains("netbsd") ||
10+
+ target.contains("openbsd") {
11+
println!("cargo:rustc-link-lib=pthread");
12+
+ } else if target.contains("dragonfly") {
13+
+ println!("cargo:rustc-link-lib=pthread");
14+
+ println!("cargo:rustc-link-search=native=/usr/lib");
15+
+ println!("cargo:rustc-link-lib=static=execinfo");
16+
} else if target.contains("solaris") {
17+
println!("cargo:rustc-link-lib=socket");
18+
println!("cargo:rustc-link-lib=posix4");
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- src/llvm/cmake/modules/HandleLLVMOptions.cmake.orig 2018-03-10 02:51:13 UTC
2+
+++ src/llvm/cmake/modules/HandleLLVMOptions.cmake
3+
@@ -146,6 +146,7 @@ endif()
4+
# build might work on ELF but fail on MachO/COFF.
5+
if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32 OR CYGWIN OR
6+
${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
7+
+ ${CMAKE_SYSTEM_NAME} MATCHES "DragonFly" OR
8+
${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") AND
9+
NOT LLVM_USE_SANITIZER)
10+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- src/llvm/lib/Support/Unix/Path.inc.orig 2018-04-04 15:39:54 UTC
2+
+++ src/llvm/lib/Support/Unix/Path.inc
3+
@@ -68,13 +68,13 @@
4+
5+
#include <sys/types.h>
6+
#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && \
7+
- !defined(__linux__)
8+
+ !defined(__DragonFly__) && !defined(__linux__)
9+
#include <sys/statvfs.h>
10+
#define STATVFS statvfs
11+
#define FSTATVFS fstatvfs
12+
#define STATVFS_F_FRSIZE(vfs) vfs.f_frsize
13+
#else
14+
-#if defined(__OpenBSD__) || defined(__FreeBSD__)
15+
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
16+
#include <sys/mount.h>
17+
#include <sys/param.h>
18+
#elif defined(__linux__)

1.28.0/build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
# Must be set to the directory where a recent rust snapshot can be found.
4+
#BOOTSTRAP_DIR=
5+
6+
RUSTC_BOOTSTRAP_VERSION=1.27.0
7+
CARGO_BOOTSTRAP_VERSION=0.28.0
8+
RUST_VERSION=1.28.0
9+
10+
BASE=`pwd`
11+
DEST=$1
12+
LLVM_ROOT=""
13+
14+
. ../checksums.sh
15+
. ../common.sh
16+
17+
RUN info clean extract prepatch config xbuild xdist inst 2>&1
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- src/llvm/cmake/modules/HandleLLVMOptions.cmake.orig 2018-03-10 02:51:13 UTC
2+
+++ src/llvm/cmake/modules/HandleLLVMOptions.cmake
3+
@@ -146,6 +146,7 @@ endif()
4+
# build might work on ELF but fail on MachO/COFF.
5+
if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32 OR CYGWIN OR
6+
${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
7+
+ ${CMAKE_SYSTEM_NAME} MATCHES "DragonFly" OR
8+
${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") AND
9+
NOT LLVM_USE_SANITIZER)
10+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- src/llvm/lib/Support/Unix/Path.inc.orig 2018-04-04 15:39:54 UTC
2+
+++ src/llvm/lib/Support/Unix/Path.inc
3+
@@ -68,13 +68,13 @@
4+
5+
#include <sys/types.h>
6+
#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && \
7+
- !defined(__linux__)
8+
+ !defined(__DragonFly__) && !defined(__linux__)
9+
#include <sys/statvfs.h>
10+
#define STATVFS statvfs
11+
#define FSTATVFS fstatvfs
12+
#define STATVFS_F_FRSIZE(vfs) vfs.f_frsize
13+
#else
14+
-#if defined(__OpenBSD__) || defined(__FreeBSD__)
15+
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
16+
#include <sys/mount.h>
17+
#include <sys/param.h>
18+
#elif defined(__linux__)

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@ Boostrapping the Rust compiler on DragonFlyBSD (Scripts only, no binaries)
55
## Build dependencies
66

77
* devel/llvm50
8+
* (devel/llvm60)
9+
* gcc7
810
* lang/python27
911
* devel/cmake
1012
* security/libssh
13+
* perl5 (for shasum)
14+
15+
## Howto build
16+
17+
# To build rust <= 1.27
18+
cd $HOME
19+
mkdir rust
20+
cd $HOME/rust && git clone https://github.com/mneumann/rust-bootstrap-dragonfly-dist.git
21+
export BOOTSTRAP_DIR=$HOME/rust/rust-bootstrap-dragonfly-dist
22+
23+
cd $HOME/rust && git clone https://github.com/mneumann/rust-bootstrap-dragonfly.git
24+
cd $HOME/rust/rust-bootstrap-dragonfly/1.26.0 && ./build.sh $HOME/rust/build-1.26.0
25+
26+
# To build rust > 1.27
27+
cd $HOME
28+
mkdir rust
29+
# replace 1.27.0 below by the previous version, e.g. for 1.28.0 use 1.27.0
30+
cd $HOME/rust && git clone https://github.com/mneumann/rust-dragonfly-dist-1.27.0.git
31+
export BOOTSTRAP_DIR=$HOME/rust/rust-dragonfly-dist-1.27.0
32+
33+
cd $HOME/rust && git clone https://github.com/mneumann/rust-bootstrap-dragonfly.git
34+
cd $HOME/rust/rust-bootstrap-dragonfly/1.28.0 && ./build.sh $HOME/rust/build-1.28.0

bin/sha256

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
/sbin/sha256 $*

checksums.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ SHA256_rustc_1_23_0_src_tar_gz=7464953871dcfdfa8afcc536916a686dd156a83339d8ec4d5
88
SHA256_rustc_1_24_0_src_tar_gz=bb8276f6044e877e447f29f566e4bbf820fa51fea2f912d59b73233ffd95639f
99
SHA256_rustc_1_25_0_src_tar_gz=eef63a0aeea5147930a366aee78cbde248bb6e5c6868801bdf34849152965d2d
1010
SHA256_rustc_1_26_0_src_tar_gz=4fb09bc4e233b71dcbe08a37a3f38cabc32219745ec6a628b18a55a1232281dd
11+
SHA256_rustc_1_27_0_src_tar_gz=2cb9803f690349c9fd429564d909ddd4676c68dc48b670b8ddf797c2613e2d21
12+
SHA256_rustc_1_28_0_src_tar_gz=1d5a81729c6f23a0a23b584dd249e35abe9c6f7569cee967cc42b1758ecd6486

common.sh

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ DEST_INSTALL=$DEST/install
7979
COMPONENTS="cargo-${CARGO_BOOTSTRAP_VERSION} rust-std-${RUSTC_BOOTSTRAP_VERSION} rustc-${RUSTC_BOOTSTRAP_VERSION}"
8080

8181
# set path
82-
export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
82+
export PATH=/bin:/usr/bin:/usr/local/bin
8383

8484
# we need these to avoid patching the sources for sha256sum
8585
export PATH=$PATH:$BASE/../bin
@@ -147,14 +147,14 @@ fixup-vendor-patch() {
147147
}
148148

149149
extract() {
150-
mkdir -p $DEST/tmp $DEST/bootstrap
150+
mkdir -p $DEST/tmp $DEST/bootstrap ${DEST_INSTALL}
151151

152152
download rustc-$RUST_VERSION-src.tar.gz /usr/distfiles $DEST ${RUST_DIST_SERVER}/dist || exit 1
153153
tar xvzf $DEST/rustc-$RUST_VERSION-src.tar.gz -C ${DEST} 2>&1 | wc -l
154154

155155
for component in ${COMPONENTS}; do
156156
echo "INSTALL COMPONENT: ${component}"
157-
tar xvzf ${BOOTSTRAP_DIR}/$component-${TARGET}.tar.xz -C $DEST/tmp
157+
tar xvzf ${BOOTSTRAP_DIR}/$component-${TARGET}.tar.xz -C $DEST/tmp || exit 1
158158
# install.sh needs bash, but used !/bin/bash which does not exist on DragonFly
159159
${BASH} $DEST/tmp/$component-${TARGET}/install.sh --prefix=$DEST/bootstrap
160160
done
@@ -170,6 +170,18 @@ prepatch() {
170170
fi
171171
}
172172

173+
create-config() {
174+
cat $BASE/config.toml.template | \
175+
sed -e "s:%%CARGO%%:${BOOTSTRAP_COMPILER_BASE}/bin/cargo:g" | \
176+
sed -e "s:%%RUSTC%%:${BOOTSTRAP_COMPILER_BASE}/bin/rustc:g" | \
177+
sed -e "s:%%PREFIX%%:${DEST_INSTALL}:g" | \
178+
sed -e "s:%%CC%%:${CONF_CC}:g" | \
179+
sed -e "s:%%CXX%%:${CONF_CXX}:g" | \
180+
sed -e "s:%%LINKER%%:${CONF_LINKER}:g" | \
181+
sed -e "s:%%LLVM_CONFIG%%:${LLVM_ROOT}/bin/llvm-config:g" > \
182+
$DEST/rustc-$RUST_VERSION-src/config.toml
183+
}
184+
173185
config() {
174186
cd $DEST/rustc-$RUST_VERSION-src
175187
./configure \
@@ -200,6 +212,18 @@ inst() {
200212
mk install
201213
}
202214

215+
xbuild() {
216+
cd $DEST/rustc-$RUST_VERSION-src && python x.py build --verbose --config ./config.toml --jobs 10
217+
}
218+
219+
xdist() {
220+
cd $DEST/rustc-$RUST_VERSION-src && python x.py dist --verbose --config ./config.toml
221+
}
222+
223+
xinst() {
224+
cd $DEST/rustc-$RUST_VERSION-src && python x.py install --verbose --config ./config.toml
225+
}
226+
203227
info() {
204228
echo Base: $BASE
205229
echo Release-Channel: $RELEASE_CHANNEL

0 commit comments

Comments
 (0)