Commit 37eb08fc authored by Georg Koppen's avatar Georg Koppen
Browse files

Bug 32436: Add lucetc project for RLBox

parent e8574bbd
#!/bin/bash
[% c("var/set_default_env") -%]
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
distdir=/var/tmp/dist
builddir=/var/tmp/build/[% project %]
mkdir -p $distdir
tar -C /var/tmp/dist -xf [% c('input_files_by_name/cmake') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/clang') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/binutils') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/rust') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/wasi-sysroot') %]
export PATH="/var/tmp/dist/cmake/bin:/var/tmp/dist/clang/bin:/var/tmp/dist/binutils/bin:/var/tmp/dist/rust/bin:$PATH"
export CC=$distdir/clang/bin/clang
export CFLAGS="-L$distdir/clang/lib"
export CXXFLAGS=$CFLAGS
export CXX=$distdir/clang/bin/clang++
export AR=$distdir/clang/bin/llvm-ar
export RUSTFLAGS="-C linker=$CXX -C link-arg=$CXXFLAGS"
export LUCET_PREFIX=$distdir/[% project %]
export WASI_SYSROOT=$distdir/wasi-sysroot
mkdir -p /var/tmp/build
tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
# Now prepare the offline build
# Move the directory for hardcoding the path in .cargo/config
mv /var/tmp/build/[% project %]-[% c('version') %] $builddir
tar -C $builddir -xjf lucetc-vendor.tar.bz2
cd $builddir
# .cargo exists already, let's just add to it
cat >> .cargo/config << 'EOF'
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "/var/tmp/build/lucetc/vendor"
EOF
make -j[% c("buildconf/num_procs") %] build
make install
cd $distdir
[% c('tar', {
tar_src => [ project ],
tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
}) %]
# vim: filetype=yaml sw=2
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %]'
version: '[% c("abbrev") %]'
git_hash: 5c22392b5b1aaa60e915c75e92b57391e1e61e6d
git_url: https://github.com/PLSysSec/lucet_sandbox_compiler/
git_submodule: 1
var:
container:
use_container: 1
input_files:
- project: container-image
# Our clang still needs GCC parts (libstdc++ for instance) so we include that
# one here even though compilation gets done solely by clang.
- name: '[% c("var/compiler") %]'
project: '[% c("var/compiler") %]'
- name: cmake
project: cmake
- name: clang
project: clang
- name: binutils
project: binutils
- name: rust
project: rust
input_file_var:
# lucetc needs Rust >= 1.36.0
rust_version: 1.36.0
prev_version: 1.35.0
- name: wasi-sysroot
project: wasi-sysroot
# `cargo vendor vendor` in the `lucetc-sandbox-compiler` directory has vendored
# the sources.
- URL: https://people.torproject.org/~gk/mirrors/sources/lucetc-vendor.tar.bz2
sha256sum: 5a7802834d0d4b9210f323cf69cc305946f22dba4ddaf2c4c0eb6d3621da2c2a
# vim: filetype=yaml sw=2 # vim: filetype=yaml sw=2
filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz' filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
version: 1.34.2 version: '[% c("input_file_var/rust_version") %]'
var: # those values can be changed from the input_files section of other
# projects. See projects/lucetc/config and bug 32436.
input_file_var:
rust_version: 1.34.2
prev_version: 1.33.0 prev_version: 1.33.0
var:
prev_version: '[% c("input_file_var/prev_version") %]'
container: container:
use_container: 1 use_container: 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment