From bfeeb532160ecd0b405039a59cbd0b6e4b519779 Mon Sep 17 00:00:00 2001 From: Ke Zhiming Date: Thu, 17 Dec 2020 20:18:10 +0800 Subject: [PATCH 1/5] qemu.yaml: add qemu asan configuration item 1. Format adjustment 2. Add qemu asan configuration item Signed-off-by: Ke Zhiming --- jobs/openeuler_qemu.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jobs/openeuler_qemu.yaml b/jobs/openeuler_qemu.yaml index 3f90702..4dcbe9e 100644 --- a/jobs/openeuler_qemu.yaml +++ b/jobs/openeuler_qemu.yaml @@ -2,6 +2,7 @@ suite: openeuler_qemu category: functional openEuler_qemu: - repo_name: qemu - repo_url: https://gitee.com/openeuler/qemu.git - repo_branch: master + repo_name: qemu + repo_url: https://gitee.com/openeuler/qemu.git + repo_branch: master + san: enable -- Gitee From e0c02e7ca02d404b7477815540ecdd195ed1df7f Mon Sep 17 00:00:00 2001 From: Ke Zhiming Date: Thu, 17 Dec 2020 20:24:28 +0800 Subject: [PATCH 2/5] openeuler_qemu: build configurable san 1. Add san compilation dependency 2. Build configurable sanitizers Signed-off-by: Ke Zhiming --- tests/openeuler_qemu | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/openeuler_qemu b/tests/openeuler_qemu index b1f53fc..dee372b 100755 --- a/tests/openeuler_qemu +++ b/tests/openeuler_qemu @@ -60,6 +60,7 @@ depends_install() { usbredir-devel \ virglrenderer-devel \ zlib-devel \ + libasan \ --downloadonly --downloaddir=./qemu_depends sudo rpm -ivh --force --nodeps ./qemu_depends/*.rpm } @@ -86,6 +87,12 @@ build() { disable_bluez="" fi + if [ x$san == x"enable" ];then + enable_san="--enable-sanitizers" + else + enable_san="" + fi + ../configure \ --prefix=/usr \ ${target_list} \ @@ -128,6 +135,7 @@ build() { --disable-sheepdog \ --disable-capstone \ --disable-smartcard \ + ${enable_san} \ || (cat config.log; exit 1) make -j $(getconf _NPROCESSORS_ONLN) VL_LDFLAGS=-Wl,--build-id V=1 -- Gitee From 938d9c84fac0ae5409fdb1145ab9a3c38066e439 Mon Sep 17 00:00:00 2001 From: Ke Zhiming Date: Thu, 17 Dec 2020 20:27:54 +0800 Subject: [PATCH 3/5] openeuler_qemu: error using varialbe Variable usage error repair Signed-off-by: Ke Zhiming --- tests/openeuler_qemu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/openeuler_qemu b/tests/openeuler_qemu index dee372b..9c41f5b 100755 --- a/tests/openeuler_qemu +++ b/tests/openeuler_qemu @@ -68,7 +68,7 @@ depends_install() { build() { git clone $repo_url cd $repo_name - git checkout -f $branch + git checkout -f $repo_branch git submodule update --init ui/keycodemapdb if [ "$arch" = "aarch64" ]; then -- Gitee From 73b362c29e72418ce2fa9b9a791c055b1243de72 Mon Sep 17 00:00:00 2001 From: Ke Zhiming Date: Thu, 17 Dec 2020 20:30:34 +0800 Subject: [PATCH 4/5] openeuler_qemu: compile options add -Wno-error Compile options add -Wno-error, otherwaise all warnings being treated as errors. It will cause san compilation to fail. Signed-off-by: Ke Zhiming --- tests/openeuler_qemu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/openeuler_qemu b/tests/openeuler_qemu index 9c41f5b..4b25205 100755 --- a/tests/openeuler_qemu +++ b/tests/openeuler_qemu @@ -96,7 +96,7 @@ build() { ../configure \ --prefix=/usr \ ${target_list} \ - '--extra-cflags=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/openEuler/openEuler-hardened-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fPIE -DPIE -fPIC' \ + '--extra-cflags=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/openEuler/openEuler-hardened-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fPIE -DPIE -fPIC -Wno-error' \ '--extra-ldflags=-Wl,--build-id -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack' \ --datadir=/usr/share \ --docdir=/usr/share/doc/qemu \ -- Gitee From bbb0941af850f03e0aa2ac2d72ac3862de8e31f8 Mon Sep 17 00:00:00 2001 From: Ke Zhiming Date: Thu, 17 Dec 2020 20:50:31 +0800 Subject: [PATCH 5/5] openeuler_qemu: make concurrency setting in san If it is san, the concurrency will be reduced to avoid complilation stuck. Signed-off-by: Ke Zhiming --- tests/openeuler_qemu | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/openeuler_qemu b/tests/openeuler_qemu index 4b25205..6f3e8ab 100755 --- a/tests/openeuler_qemu +++ b/tests/openeuler_qemu @@ -89,8 +89,10 @@ build() { if [ x$san == x"enable" ];then enable_san="--enable-sanitizers" + concurrency=60 else enable_san="" + concurrency=$(getconf _NPROCESSORS_ONLN) fi ../configure \ @@ -138,7 +140,7 @@ build() { ${enable_san} \ || (cat config.log; exit 1) - make -j $(getconf _NPROCESSORS_ONLN) VL_LDFLAGS=-Wl,--build-id V=1 + make -j ${concurrency} VL_LDFLAGS=-Wl,--build-id V=1 make check V=1 } -- Gitee