From 66b09ce044c70e523f4315b7ca755490c2329a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9B=E8=BF=8E=E6=9E=97?= Date: Fri, 4 Nov 2022 10:18:37 +0000 Subject: [PATCH] add build.sh. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 辛迎林 --- README_OE.md | 21 +++ build.sh | 164 ++++++++++++++++++ .../lsan/TestCases/Linux/log-path_test.cpp | 1 + compiler-rt/test/lsan/TestCases/malloc_zero.c | 1 + .../test/lsan/TestCases/realloc_too_big.c | 1 + .../archer/tests/races/critical-unrelated.c | 2 + .../tests/races/lock-nested-unrelated.c | 1 + .../tools/archer/tests/races/lock-unrelated.c | 2 + .../archer/tests/races/parallel-simple.c | 2 + .../archer/tests/races/task-dependency.c | 2 + .../tests/races/task-taskgroup-unrelated.c | 2 + .../archer/tests/races/task-taskwait-nested.c | 2 + openmp/tools/archer/tests/races/task-two.c | 2 + .../archer/tests/task/task_late_fulfill.c | 1 + 14 files changed, 204 insertions(+) create mode 100644 README_OE.md create mode 100755 build.sh diff --git a/README_OE.md b/README_OE.md new file mode 100644 index 000000000000..af956a923c04 --- /dev/null +++ b/README_OE.md @@ -0,0 +1,21 @@ + 我们提供了build.sh脚本来构建llvm-project。 + 我们已经验证了它可以在openEuler系统成功构建。 + + 在构建编译器之前,确保已经安装了以下工具: + gcc \ + g++ \ + libgcc \ + openssl-devel \ + cmake \ + python3 \ + python3-setuptools \ + python-wheel \ + texinfo \ + binutils \ + libstdc++-static \ + libatomic + + 具体的编译选项可以在build.sh中查看,也可以通过“./build.sh -h”命令查看。 + 例如: + ./build.sh -r -b release -X X86 + diff --git a/build.sh b/build.sh new file mode 100755 index 000000000000..4fed7989a657 --- /dev/null +++ b/build.sh @@ -0,0 +1,164 @@ +#!/bin/bash + +# Tools to use for bootstrapping. +C_COMPILER_PATH=gcc +CXX_COMPILER_PATH=g++ + +# Initialize our own variables: +buildtype=RelWithDebInfo +backends="ARM;AArch64;X86" +split_dwarf=on +use_ccache="0" +do_install="0" +clean=0 +unit_test="" +verbose="" +dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +build_dir_name="build" +install_dir_name="install" +build_prefix="$dir/$build_dir_name" +install_prefix="$dir/$install_dir_name" + +# Use 8 threads for builds and tests by default. Use more threads if possible, +# but avoid overloading the system by using up to 50% of available cores. +threads=8 +nproc=$(type -p nproc) +if [ -x "$nproc" -a -f /proc/loadavg ]; then + loadavg=$(awk '{printf "%.0f\n", $1}' < /proc/loadavg) + let threads="($($nproc) - $loadavg) / 2" + if [ $threads -le 0 ]; then + threads=1 + fi +fi + +# Exit script on first error. +set -e + +usage() { + cat <> %t.log // RUN: %adb_shell 'cat %device_rundir/%t.log.*' >> %t.log // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.log.* +// REQUIRES: x86_64 #include #include diff --git a/compiler-rt/test/lsan/TestCases/malloc_zero.c b/compiler-rt/test/lsan/TestCases/malloc_zero.c index 5c8d1850a0f9..d6d2db6a62c0 100644 --- a/compiler-rt/test/lsan/TestCases/malloc_zero.c +++ b/compiler-rt/test/lsan/TestCases/malloc_zero.c @@ -3,6 +3,7 @@ /// Fails when only leak sanitizer is enabled // UNSUPPORTED: arm-linux, armhf-linux +// REQUIRES: x86_64 #include #include diff --git a/compiler-rt/test/lsan/TestCases/realloc_too_big.c b/compiler-rt/test/lsan/TestCases/realloc_too_big.c index bb1316024b5c..ad0c0a78e154 100644 --- a/compiler-rt/test/lsan/TestCases/realloc_too_big.c +++ b/compiler-rt/test/lsan/TestCases/realloc_too_big.c @@ -3,6 +3,7 @@ /// Fails when only leak sanitizer is enabled // UNSUPPORTED: arm-linux, armhf-linux +// REQUIRES: x86_64 #include #include diff --git a/openmp/tools/archer/tests/races/critical-unrelated.c b/openmp/tools/archer/tests/races/critical-unrelated.c index bff8b9763c14..1a4d39a72362 100644 --- a/openmp/tools/archer/tests/races/critical-unrelated.c +++ b/openmp/tools/archer/tests/races/critical-unrelated.c @@ -13,6 +13,8 @@ // RUN: %libarcher-compile-and-run-race | FileCheck %s // RUN: %libarcher-compile-and-run-race-noserial | FileCheck %s // REQUIRES: tsan +// REQUIRES: x86_64 + #include #include diff --git a/openmp/tools/archer/tests/races/lock-nested-unrelated.c b/openmp/tools/archer/tests/races/lock-nested-unrelated.c index e24b4cdedc71..13b6e3417458 100644 --- a/openmp/tools/archer/tests/races/lock-nested-unrelated.c +++ b/openmp/tools/archer/tests/races/lock-nested-unrelated.c @@ -13,6 +13,7 @@ // RUN: %libarcher-compile-and-run-race | FileCheck %s // RUN: %libarcher-compile-and-run-race-noserial | FileCheck %s // REQUIRES: tsan +// REQUIRES: x86_64 #include #include diff --git a/openmp/tools/archer/tests/races/lock-unrelated.c b/openmp/tools/archer/tests/races/lock-unrelated.c index 4245490a703f..891549ff91ff 100644 --- a/openmp/tools/archer/tests/races/lock-unrelated.c +++ b/openmp/tools/archer/tests/races/lock-unrelated.c @@ -13,6 +13,8 @@ // RUN: %libarcher-compile-and-run-race | FileCheck %s // RUN: %libarcher-compile-and-run-race-noserial | FileCheck %s // REQUIRES: tsan +// REQUIRES: x86_64 + #include #include diff --git a/openmp/tools/archer/tests/races/parallel-simple.c b/openmp/tools/archer/tests/races/parallel-simple.c index 700e4a7f3313..809ef6f4c114 100644 --- a/openmp/tools/archer/tests/races/parallel-simple.c +++ b/openmp/tools/archer/tests/races/parallel-simple.c @@ -13,6 +13,8 @@ // RUN: %libarcher-compile-and-run-race | FileCheck %s // RUN: %libarcher-compile-and-run-race-noserial | FileCheck %s // REQUIRES: tsan +// REQUIRES: x86_64 + #include #include diff --git a/openmp/tools/archer/tests/races/task-dependency.c b/openmp/tools/archer/tests/races/task-dependency.c index f6496ac8596d..63b4cf4bfc56 100644 --- a/openmp/tools/archer/tests/races/task-dependency.c +++ b/openmp/tools/archer/tests/races/task-dependency.c @@ -13,6 +13,8 @@ // RUN: %libarcher-compile-and-run-race | FileCheck %s // RUN: %libarcher-compile-and-run-race-noserial | FileCheck %s // REQUIRES: tsan +// REQUIRES: x86_64 + #include "ompt/ompt-signal.h" #include #include diff --git a/openmp/tools/archer/tests/races/task-taskgroup-unrelated.c b/openmp/tools/archer/tests/races/task-taskgroup-unrelated.c index 04b2957b4863..770e31c8f831 100644 --- a/openmp/tools/archer/tests/races/task-taskgroup-unrelated.c +++ b/openmp/tools/archer/tests/races/task-taskgroup-unrelated.c @@ -13,6 +13,8 @@ // RUN: %libarcher-compile-and-run-race | FileCheck %s // RUN: %libarcher-compile-and-run-race-noserial | FileCheck %s // REQUIRES: tsan +// REQUIRES: x86_64 + #include "ompt/ompt-signal.h" #include #include diff --git a/openmp/tools/archer/tests/races/task-taskwait-nested.c b/openmp/tools/archer/tests/races/task-taskwait-nested.c index 02f1fb576c87..64aa03f3f8db 100644 --- a/openmp/tools/archer/tests/races/task-taskwait-nested.c +++ b/openmp/tools/archer/tests/races/task-taskwait-nested.c @@ -13,6 +13,8 @@ // RUN: %libarcher-compile-and-run-race | FileCheck %s // RUN: %libarcher-compile-and-run-race-noserial | FileCheck %s // REQUIRES: tsan +// REQUIRES: x86_64 + #include "ompt/ompt-signal.h" #include #include diff --git a/openmp/tools/archer/tests/races/task-two.c b/openmp/tools/archer/tests/races/task-two.c index 06d5bc021ee6..f1fa654b2da9 100644 --- a/openmp/tools/archer/tests/races/task-two.c +++ b/openmp/tools/archer/tests/races/task-two.c @@ -13,6 +13,8 @@ // RUN: %libarcher-compile-and-run-race | FileCheck %s // RUN: %libarcher-compile-and-run-race-noserial | FileCheck %s // REQUIRES: tsan +// REQUIRES: x86_64 + #include #include #include diff --git a/openmp/tools/archer/tests/task/task_late_fulfill.c b/openmp/tools/archer/tests/task/task_late_fulfill.c index 31d096deec75..23f54eeb9b57 100644 --- a/openmp/tools/archer/tests/task/task_late_fulfill.c +++ b/openmp/tools/archer/tests/task/task_late_fulfill.c @@ -10,6 +10,7 @@ // icc compiler does not support detach clause. // UNSUPPORTED: icc // REQUIRES: tsan +// REQUIRES: x86_64 #include #include -- Gitee