To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit 8d9f5910 authored by Javad Ebrahimian Amiri's avatar Javad Ebrahimian Amiri
Browse files

Merge branch 'master' into 'rtmu-dev'

Update rtmu-dev

See merge request !58
parents af8b1b22 6f647556
......@@ -9,15 +9,14 @@ before_script:
- export ZEBU_BUILD=release
- export CARGO_HOME=.cargo
- export CC=clang
- export CXX=clang++
- export RUST_TEST_THREADS=1
- export LD_LIBRARY_PATH=$MU_ZEBU/target/$ZEBU_BUILD:$LD_LIBRARY_PATH
- export LD_LIBRARY_PATH=$MU_ZEBU/target/$ZEBU_BUILD/deps/:$LD_LIBRARY_PATH
- source /home/gitlab-runner/ci/bin/activate
build:
stage: build
script:
- rustup show
- rustup run 1.30.1-x86_64-unknown-linux-gnu rustc --version
- rustup run 1.30.1-x86_64-unknown-linux-gnu cargo clean
- time rustup run 1.30.1-x86_64-unknown-linux-gnu cargo test -j6 --release --no-run --color=always
artifacts:
......@@ -51,8 +50,12 @@ test:cargo:runtime:
cd tests/test_muc
git clone https://gitlab.anu.edu.au/mu/mu-tool-compiler
cd mu-tool-compiler
export ANTLR_HOME=/home/gitlab-runner/antlr4/runtime/Cpp/run
mkdir lib
ln -s $MU_ZEBU/target/release/libmu.so lib/
cp -r $ANTLR_HOME/usr/local/lib/* $PWD/lib/
cp -r $MU_ZEBU/target/release/deps/* $PWD/lib/
export CC=clang
export CXX=clang++
make
cd ..
......@@ -61,46 +64,39 @@ testmuc:test_simple:
script:
- *build_muc
- LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_simple.py -v
allow_failure: true
testmuc:test_swapstack:
stage: test
script:
- *build_muc
- LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_thread_and_stack.py -v
allow_failure: true
testmuc:test_cmp:
stage: test
script:
- *build_muc
- LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_cmp.py -v
allow_failure: true
testmuc:test_binop:
stage: test
script:
- *build_muc
- LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_binop.py -v
allow_failure: true
testjit:milestones:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
allow_failure: true
testjit:binops:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_binops.py -v --color=yes
allow_failure: true
testjit:cmpops:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_cmpops.py -v --color=yes
allow_failure: true
testjit:controlflow:
stage: test
......@@ -109,37 +105,31 @@ testjit:controlflow:
# as a C source file is expected in a relative path to current working directory
- cd tests/test_jit
- RUST_BACKTRACE=1 pytest test_controlflow.py -v --color=yes
allow_failure: true
testjit:convops:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_convops.py -v --color=yes
allow_failure: true
testjit:double:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_double.py -v --color=yes
allow_failure: true
testjit:memops:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_memops.py -v --color=yes
allow_failure: true
testjit:milestones:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
allow_failure: true
testjit:otherops:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_otherops.py -v --color=yes
allow_failure: true
testjit:rpython:
stage: test
......@@ -151,7 +141,6 @@ testjit:rpython:
- git apply pypy.patch
- cd $CI_PROJECT_DIR/tests/test_jit
- MU_LOG_LEVEL=info LD_LIBRARY_PATH=./emit:$LD_LIBRARY_PATH RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy pytest test_rpython*.py -v --color=yes
allow_failure: true
testjit:som:
stage: test
......@@ -166,7 +155,6 @@ testjit:som:
- git apply pypy.patch
- cd $CI_PROJECT_DIR/tests/test_jit
- MU_LOG_LEVEL=info LD_LIBRARY_PATH=./emit:$LD_LIBRARY_PATH RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy:RPySOM/src RPYSOM=RPySOM pytest test_som.py -v --color=yes
allow_failure: true
mubench:
stage: mubench
......
......@@ -29,11 +29,16 @@ are not compliant to Mu spec.
## Building
You will need:
* rust version 1.20 (f3d6973f4 2017-08-27)
* rust version 1.28.0 or newer (2018-08-02)
* clang 4.0+
* cmake 3.8+ (we do not depend on cmake, but some Rust crates use it)
* internet connection (as Rust will download dependencies)
We have tested these specific versions:
* rust `stable-2018-11-08` and `nightly-2019-02-15`
* clang `6.0.0`
* cmake `3.10.2`
To build Zebu with release build,
```
cd path/to/zebu
......@@ -97,6 +102,7 @@ Running pytest (you will need Python 2.7 with pytest module)
export SPAWN_PROC=1
python2 -m pytest test*.py -v
```
* We only tested python `2.7.15-rc1` successfully.
## Using Zebu for your language implementation
......
......@@ -18,7 +18,7 @@ export MU_LOG_LEVEL=none
export RUST_TEST_THREADS=1
export RUST_BACKTRACE=0
export PYTHONPATH="$MU_ZEBU/tests/test_jit/mu-client-pypy/:$MU_ZEBU/tests/test_jit/RPySOM/src"
export LD_LIBRARY_PATH="$MU_ZEBU/target/$ZEBU_BUILD:$MU_ZEBU/tests/test_jit/:$MU_ZEBU/tests/test_jit/emit/:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$MU_ZEBU/target/$ZEBU_BUILD/deps/:$MU_ZEBU/tests/test_jit/:$MU_ZEBU/tests/test_jit/emit/:$LD_LIBRARY_PATH"
export ZEBU_BUILD=release
rm -rf $MU_ZEBU/emit
......
#!/bin/sh
export MU_ZEBU=$PWD
export ZEBU_BUILD=release
export CARGO_HOME=~/.cargo
export CC=clang
export CXX=clang++
export RUST_TEST_THREADS=1
export LD_LIBRARY_PATH=$MU_ZEBU/target/$ZEBU_BUILD/deps/:$LD_LIBRARY_PATH
// Copyright 2017 The Australian National University
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <pthread.h>
uintptr_t immmix_get_stack_ptr() {
uintptr_t rsp;
// get current rsp, rbp (this C func frame)
__asm__(
"mov %%rsp, %0 \n"
: "=rm" (rsp)
);
return rsp;
}
int get_registers_count() {
return 16;
}
uintptr_t* get_registers () {
uintptr_t rax, rbx, rcx, rdx, rbp, rsp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, r15;
__asm__(
"mov %%rax, %0 \n"
"mov %%rbx, %1 \n"
"mov %%rcx, %2 \n"
"mov %%rdx, %3 \n"
"mov %%rbp, %4 \n"
"mov %%rsp, %5 \n"
"mov %%rsi, %5 \n"
"mov %%rdi, %6 \n"
"mov %%r8, %7 \n"
"mov %%r9, %8 \n"
"mov %%r10, %10\n"
"mov %%r11, %11\n"
"mov %%r12, %12\n"
"mov %%r13, %13\n"
"mov %%r14, %14\n"
"mov %%r15, %15\n"
: "=m" (rax),
"=m" (rbx),
"=m" (rcx),
"=m" (rdx),
"=m" (rbp),
"=m" (rsp),
"=m" (rsi),
"=m" (rdi),
"=m" (r8),
"=m" (r9),
"=m" (r10),
"=m" (r11),
"=m" (r12),
"=m" (r13),
"=m" (r14),
"=m" (r15)
:
:
);
uintptr_t* ret = (uintptr_t*) malloc(sizeof(uintptr_t) * 16);
ret[0] = rax;
ret[1] = rbx;
ret[2] = rcx;
ret[3] = rdx;
ret[4] = rbp;
ret[5] = rsp;
ret[6] = rsi;
ret[7] = rdi;
ret[8] = r8;
ret[9] = r9;
ret[10] = r10;
ret[11] = r11;
ret[12] = r12;
ret[13] = r13;
ret[14] = r14;
ret[15] = r15;
return ret;
}
// __thread uintptr_t low_water_mark;
int lwm_initialized = 0;
static pthread_key_t low_water_mark;
void set_low_water_mark () {
uintptr_t rsp;
if(lwm_initialized == 0){
lwm_initialized = 1;
int result = pthread_key_create(&low_water_mark, NULL);
if(result != 0){
printf("set_low_water_mark(): PThread key create failed with error code = %d\n", result);
assert(0);
}
}
// get current rsp, rbp (this C func frame)
__asm__(
"mov %%rsp, %0 \n"
: "=rm" (rsp)
);
int result = pthread_setspecific(low_water_mark, (const void *) rsp);
if(result != 0){
printf("set_low_water_mark(): PThread set specific failed with error code = %d\n", result);
assert(0);
}
}
uintptr_t get_low_water_mark() {
if(lwm_initialized == 0){
printf("get_low_water_mark(): PThread key MUST be initialized before first use!!\n");
}
void * result = pthread_getspecific(low_water_mark);
if(result == NULL){
printf("get_low_water_mark(): NO pthread key found for current thread!!\n");
assert(0);
}
return (uintptr_t) result;
}
......@@ -74,6 +74,9 @@ pub fn exec_path_nocheck(executable: PathBuf) -> Output {
/// panics if this command does not finish normally
fn exec_cmd(cmd: Command) -> Output {
let output = exec_cmd_nocheck(cmd);
if !output.status.success() {
println!("{}", String::from_utf8(output.stderr.clone()).unwrap());
}
assert!(output.status.success());
output
}
......
#!/usr/bin/env bash
export MU_ZEBU=$PWD/../../../mu-impl-fast/
export ZEBU_BUILD=release
export DYLD_LIBRARY_PATH=$PWD
export LD_LIBRARY_PATH=$MU_ZEBU/target/$ZEBU_BUILD/deps:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./emit:$LD_LIBRARY_PATH
export usess=none
#export PYTHONPATH=mu-client-pypy:RPySOM/src
export RPYSOM=RPySOM
export CC=clang
export SPAWN_PROC=1
export RUST_BACKTRACE=1
export RUST_TEST_THREADS=1
============================= test session starts ==============================
platform linux2 -- Python 2.7.15rc1, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 -- /usr/bin/python2
cachedir: .cache
rootdir: /home/javadamiri/myFiles/Src/mu-impl-fast/tests/test_jit, inifile:
collecting ... collected 30 items
test_rpython.py::test_throw <- util.py PASSED
test_rpython.py::test_find_min <- util.py PASSED
test_rpython.py::test_exception_stack_unwind <- util.py PASSED
test_rpython.py::test_partition_in_quicksort <- util.py PASSED
test_rpython.py::test_dtoa <- util.py PASSED
test_rpython.py::test_rpytarget_print_argv <- util.py PASSED
test_rpython.py::test_rpytarget_richards_measure_time <- util.py PASSED
test_rpython.py::test_float <- util.py PASSED
test_rpython.py::test_add <- util.py PASSED
test_rpython.py::test_linkedlist_reversal <- util.py PASSED
test_rpython.py::test_quicksort <- util.py PASSED
test_rpython.py::test_open_file_as_stream <- util.py PASSED
test_rpython.py::test_rpython_main <- util.py PASSED
test_rpython.py::test_nbody <- util.py PASSED
test_rpython.py::test_rpython_time_diff <- util.py PASSED
test_rpython.py::test_new_cmpeq <- util.py PASSED
test_rpython.py::test_rpython_print_number <- util.py PASSED
test_rpython.py::test_rpytarget_richards0 <- util.py PASSED
test_rpython.py::test_rpytarget_sha1sum <- util.py PASSED
test_rpython.py::test_new <- util.py PASSED
test_rpython.py::test_vec3prod <- util.py PASSED
test_rpython.py::test_make_boot_image_simple <- util.py PASSED
test_rpython.py::test_threadtran_fib <- util.py PASSED
test_rpython.py::test_rpython_rethrow <- util.py PASSED
test_rpython.py::test_rpython_helloworld <- util.py PASSED
test_rpython.py::test_arraysum <- util.py PASSED
test_rpython.py::test_rpython_print_time <- util.py PASSED
test_rpython.py::test_rpytarget_testdicts <- util.py PASSED
test_rpython.py::test_rpython_print_fmt <- util.py PASSED
test_rpython.py::test_linked_list <- util.py PASSED
========================= 30 passed in 190.17 seconds ==========================
......@@ -36,7 +36,7 @@ elif sys.platform.startswith('linux'):
else:
libext = '.dll'
libmu_build = os.environ.get('ZEBU_BUILD', 'debug')
libmu_build = os.environ.get('ZEBU_BUILD', 'debug') + '/deps'
libmu_dir_path = proj_dir.join('target', libmu_build)
libmu_dylib_path = proj_dir.join('target', libmu_build, 'libmu' + libext)
......
......@@ -20,7 +20,7 @@ emit = os.environ.get('MU_EMIT_DIR', 'emit'); #type: str
libext = '.dylib' if sys.platform.startswith('darwin') else \
'.so' if sys.platform.startswith('linux') else sys.exit("Unsupported platform"); #type: str
libmu = os.path.join(os.environ.get('MU_ZEBU', os.path.dirname(os.path.dirname(os.getcwd()))),
'target', os.environ.get('ZEBU_BUILD', 'debug'),
'target', os.environ.get('ZEBU_BUILD', 'debug'), 'deps',
"libmu" + libext); #type: str
prelude = """
/*--------------------------------------------------------*/
......@@ -54,8 +54,14 @@ def execute_muc(bundle, name, primordial=None): # type: (str, str, Optional[str]
muc_proc = subprocess.Popen([muc, "-r"]
+ (["-f", primordial] if primordial is not None else [])
+ ["/dev/stdin", get_output_file(name)],
stdin = subprocess.PIPE); #type: subprocess.Popen
muc_proc.communicate(bundle); # Send the bundle to muc
stdin = subprocess.PIPE,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE); #type: subprocess.Popen
stdoutdata, stderrdata = muc_proc.communicate(bundle); # Send the bundle to muc
print("errors:\n\n")
print(stderrdata);
print("outputs:\n\n")
print(stdoutdata);
assert (muc_proc.returncode == 0); # Check that muc worked
def compile_bundle(bundle, name, main = None): # type: (str, str, Optional[str]) -> None
......
Markdown is supported
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