Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin Sprinkle "-static" when using "-pg" as profili...



details:   https://anonhg.NetBSD.org/src/rev/20fe102f070c
branches:  trunk
changeset: 366753:20fe102f070c
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Jun 12 08:55:36 2022 +0000

description:
Sprinkle "-static" when using "-pg" as profiling only works with static and
the gcc specs are currently broken.

PR/56876: hppa: "cc -pg" fails with "undefined reference to `mprotect'"

diffstat:

 tests/usr.bin/c++/asan_common.subr               |  6 +++---
 tests/usr.bin/c++/t_call_once.sh                 |  6 +++---
 tests/usr.bin/c++/t_call_once2.sh                |  6 +++---
 tests/usr.bin/c++/t_cxxruntime.sh                |  6 +++---
 tests/usr.bin/c++/t_fuzzer_oom.sh                |  2 +-
 tests/usr.bin/c++/t_fuzzer_simple.sh             |  2 +-
 tests/usr.bin/c++/t_fuzzer_timeout.sh            |  2 +-
 tests/usr.bin/c++/t_hello.sh                     |  6 +++---
 tests/usr.bin/c++/t_msan_allocated_memory.sh     |  2 +-
 tests/usr.bin/c++/t_msan_check_mem.sh            |  2 +-
 tests/usr.bin/c++/t_msan_free.sh                 |  2 +-
 tests/usr.bin/c++/t_msan_heap.sh                 |  2 +-
 tests/usr.bin/c++/t_msan_partial_poison.sh       |  2 +-
 tests/usr.bin/c++/t_msan_poison.sh               |  2 +-
 tests/usr.bin/c++/t_msan_realloc.sh              |  2 +-
 tests/usr.bin/c++/t_msan_shadow.sh               |  2 +-
 tests/usr.bin/c++/t_msan_stack.sh                |  2 +-
 tests/usr.bin/c++/t_msan_unpoison.sh             |  2 +-
 tests/usr.bin/c++/t_pthread_once.sh              |  6 +++---
 tests/usr.bin/c++/t_static_destructor.sh         |  6 +++---
 tests/usr.bin/c++/t_tsan_data_race.sh            |  2 +-
 tests/usr.bin/c++/t_tsan_heap_use_after_free.sh  |  2 +-
 tests/usr.bin/c++/t_tsan_lock_order_inversion.sh |  2 +-
 tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh |  2 +-
 tests/usr.bin/c++/t_tsan_signal_errno.sh         |  2 +-
 tests/usr.bin/c++/t_tsan_thread_leak.sh          |  2 +-
 tests/usr.bin/c++/t_tsan_vptr_race.sh            |  2 +-
 tests/usr.bin/c++/ubsan_common.subr              |  6 +++---
 tests/usr.bin/cc/asan_common.subr                |  6 +++---
 tests/usr.bin/cc/t_fuzzer_oom.sh                 |  2 +-
 tests/usr.bin/cc/t_fuzzer_simple.sh              |  2 +-
 tests/usr.bin/cc/t_fuzzer_timeout.sh             |  2 +-
 tests/usr.bin/cc/t_hello.sh                      |  4 ++--
 tests/usr.bin/cc/t_msan_allocated_memory.sh      |  2 +-
 tests/usr.bin/cc/t_msan_check_mem.sh             |  2 +-
 tests/usr.bin/cc/t_msan_free.sh                  |  2 +-
 tests/usr.bin/cc/t_msan_heap.sh                  |  2 +-
 tests/usr.bin/cc/t_msan_partial_poison.sh        |  2 +-
 tests/usr.bin/cc/t_msan_poison.sh                |  2 +-
 tests/usr.bin/cc/t_msan_realloc.sh               |  2 +-
 tests/usr.bin/cc/t_msan_shadow.sh                |  2 +-
 tests/usr.bin/cc/t_msan_stack.sh                 |  2 +-
 tests/usr.bin/cc/t_msan_unpoison.sh              |  2 +-
 tests/usr.bin/cc/t_tsan_data_race.sh             |  2 +-
 tests/usr.bin/cc/t_tsan_heap_use_after_free.sh   |  2 +-
 tests/usr.bin/cc/t_tsan_lock_order_inversion.sh  |  2 +-
 tests/usr.bin/cc/t_tsan_locked_mutex_destroy.sh  |  2 +-
 tests/usr.bin/cc/t_tsan_signal_errno.sh          |  2 +-
 tests/usr.bin/cc/t_tsan_thread_leak.sh           |  2 +-
 tests/usr.bin/cc/ubsan_common.subr               |  6 +++---
 50 files changed, 71 insertions(+), 71 deletions(-)

diffs (truncated from 756 to 300 lines):

diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/asan_common.subr
--- a/tests/usr.bin/c++/asan_common.subr        Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/asan_common.subr        Sun Jun 12 08:55:36 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: asan_common.subr,v 1.3 2021/10/12 18:40:01 skrll Exp $
+#      $NetBSD: asan_common.subr,v 1.4 2022/06/12 08:55:36 skrll Exp $
 #
 # Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -93,7 +93,7 @@
 
        $1_profile_body() {
                echo \"\$ASAN_CODE\" > test.cpp
-               c++ -fsanitize=address -o test -pg test.cpp
+               c++ -fsanitize=address -static -o test -pg test.cpp
                paxctl +a test
                atf_check -s not-exit:0 -o not-match:'CHECK\n' -e match:'$3' ./test
        }
@@ -148,7 +148,7 @@
                atf_check -s not-exit:0 -o not-match:'CHECK\n' -e match:'$3' ./df32
 
 # and another test with profile 32bit binaries
-               c++ -fsanitize=address -o test -pg -m32 test.cpp
+               c++ -fsanitize=address -static -o test -pg -m32 test.cpp
                paxctl +a test
                atf_check -s not-exit:0 -o not-match:'CHECK\n' -e match:'$3' ./test
        }"
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_call_once.sh
--- a/tests/usr.bin/c++/t_call_once.sh  Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_call_once.sh  Sun Jun 12 08:55:36 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_call_once.sh,v 1.4 2020/10/13 06:49:27 rin Exp $
+#      $NetBSD: t_call_once.sh,v 1.5 2022/06/12 08:55:36 skrll Exp $
 #
 # Copyright (c) 2018 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -111,7 +111,7 @@
         return 0;
 }
 EOF
-       atf_check -s exit:0 -o ignore -e ignore c++ -pg -o call_once test.cpp -pthread
+       atf_check -s exit:0 -static -o ignore -e ignore c++ -pg -o call_once test.cpp -pthread
        atf_check -s exit:0 -o inline:"hello, world!\n" ./call_once
 }
 
@@ -138,7 +138,7 @@
         return 0;
 }
 EOF
-       atf_check -s exit:0 -o ignore -e ignore c++ -m32 -pg -o call_once test.cpp -pthread
+       atf_check -s exit:0 -static -o ignore -e ignore c++ -m32 -pg -o call_once test.cpp -pthread
        atf_check -s exit:0 -o inline:"hello, world!\n" ./call_once
 }
 
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_call_once2.sh
--- a/tests/usr.bin/c++/t_call_once2.sh Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_call_once2.sh Sun Jun 12 08:55:36 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_call_once2.sh,v 1.4 2022/05/07 05:14:09 rin Exp $
+#      $NetBSD: t_call_once2.sh,v 1.5 2022/06/12 08:55:36 skrll Exp $
 #
 # Copyright (c) 2018 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -154,7 +154,7 @@
         return 0;
 }
 EOF
-       atf_check -s exit:0 -o ignore -e ignore c++ -pg -o call_once2 test.cpp -pthread
+       atf_check -s exit:0 -static -o ignore -e ignore c++ -pg -o call_once2 test.cpp -pthread
        atf_check -s exit:0 -o inline:"hello, world!\n" ./call_once2
 }
 
@@ -198,7 +198,7 @@
         return 0;
 }
 EOF
-       atf_check -s exit:0 -o ignore -e ignore c++ -m32 -pg -o call_once2 test.cpp -pthread
+       atf_check -s exit:0 -static -o ignore -e ignore c++ -m32 -pg -o call_once2 test.cpp -pthread
        atf_check -s exit:0 -o inline:"hello, world!\n" ./call_once2
        atf_expect_fail "The combination of 32-bit and profiling should be fail"
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_cxxruntime.sh
--- a/tests/usr.bin/c++/t_cxxruntime.sh Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_cxxruntime.sh Sun Jun 12 08:55:36 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_cxxruntime.sh,v 1.5 2020/10/13 06:49:27 rin Exp $
+#      $NetBSD: t_cxxruntime.sh,v 1.6 2022/06/12 08:55:36 skrll Exp $
 #
 # Copyright (c) 2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -104,7 +104,7 @@
 #include <iostream>
 int main(void) {std::cout << "hello world" << std::endl;exit(0);}
 EOF
-       atf_check -s exit:0 -o ignore -e ignore c++ -pg -o hello test.cpp
+       atf_check -s exit:0 -static -o ignore -e ignore c++ -pg -o hello test.cpp
        atf_check -s exit:0 -o inline:"hello world\n" ./hello
 }
 
@@ -126,7 +126,7 @@
 #include <iostream>
 int main(void) {std::cout << "hello world" << std::endl;exit(0);}
 EOF
-       atf_check -s exit:0 -o ignore -e ignore c++ -m32 -pg -o hello test.cpp
+       atf_check -s exit:0 -static -o ignore -e ignore c++ -m32 -pg -o hello test.cpp
        atf_check -s exit:0 -o inline:"hello world\n" ./hello
 }
 
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_fuzzer_oom.sh
--- a/tests/usr.bin/c++/t_fuzzer_oom.sh Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_fuzzer_oom.sh Sun Jun 12 08:55:36 2022 +0000
@@ -90,7 +90,7 @@
 }
 EOF
 
-       c++ -fsanitize=fuzzer -o test -pg test.cc
+       c++ -fsanitize=fuzzer -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o ignore -e match:"ERROR: libFuzzer: out-of-memory" ./test -rss_limit_mb=30
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_fuzzer_simple.sh
--- a/tests/usr.bin/c++/t_fuzzer_simple.sh      Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_fuzzer_simple.sh      Sun Jun 12 08:55:36 2022 +0000
@@ -98,7 +98,7 @@
 }
 EOF
 
-       c++ -fsanitize=fuzzer -o test -pg test.cc
+       c++ -fsanitize=fuzzer -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o ignore -e match:"BINGO" ./test
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_fuzzer_timeout.sh
--- a/tests/usr.bin/c++/t_fuzzer_timeout.sh     Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_fuzzer_timeout.sh     Sun Jun 12 08:55:36 2022 +0000
@@ -88,7 +88,7 @@
 }
 EOF
 
-       c++ -fsanitize=fuzzer -o test -pg test.cc
+       c++ -fsanitize=fuzzer -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o ignore -e match:"ERROR: libFuzzer: timeout" ./test -timeout=5
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_hello.sh
--- a/tests/usr.bin/c++/t_hello.sh      Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_hello.sh      Sun Jun 12 08:55:36 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_hello.sh,v 1.5 2020/10/13 06:49:27 rin Exp $
+#      $NetBSD: t_hello.sh,v 1.6 2022/06/12 08:55:36 skrll Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -101,7 +101,7 @@
 #include <stdlib.h>
 int main(void) {printf("hello world\n");exit(0);}
 EOF
-       atf_check -s exit:0 -o ignore -e ignore c++ -pg -o hello test.cpp
+       atf_check -s exit:0 -static -o ignore -e ignore c++ -pg -o hello test.cpp
        atf_check -s exit:0 -o inline:"hello world\n" ./hello
 }
 
@@ -122,7 +122,7 @@
 #include <stdlib.h>
 int main(void) {printf("hello world\n");exit(0);}
 EOF
-       atf_check -s exit:0 -o ignore -e ignore c++ -m32 -pg -o hello test.cpp
+       atf_check -s exit:0 -static -o ignore -e ignore c++ -m32 -pg -o hello test.cpp
        atf_check -s exit:0 -o inline:"hello world\n" ./hello
 }
 
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_msan_allocated_memory.sh
--- a/tests/usr.bin/c++/t_msan_allocated_memory.sh      Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_msan_allocated_memory.sh      Sun Jun 12 08:55:36 2022 +0000
@@ -90,7 +90,7 @@
 }
 EOF
 
-       c++ -fsanitize=memory -o test -pg test.cc
+       c++ -fsanitize=memory -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o ignore -e match:"WARNING: MemorySanitizer: use-of-uninitialized-value" ./test
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_msan_check_mem.sh
--- a/tests/usr.bin/c++/t_msan_check_mem.sh     Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_msan_check_mem.sh     Sun Jun 12 08:55:36 2022 +0000
@@ -92,7 +92,7 @@
 }
 EOF
 
-       c++ -fsanitize=memory -o test -pg test.cc
+       c++ -fsanitize=memory -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o ignore -e match:"Uninitialized bytes in __msan_check_mem_is_initialized at offset 0 inside" ./test
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_msan_free.sh
--- a/tests/usr.bin/c++/t_msan_free.sh  Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_msan_free.sh  Sun Jun 12 08:55:36 2022 +0000
@@ -88,7 +88,7 @@
 }
 EOF
 
-       c++ -fsanitize=memory -o test -pg test.cc
+       c++ -fsanitize=memory -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o ignore -e match:"WARNING: MemorySanitizer: use-of-uninitialized-value" ./test
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_msan_heap.sh
--- a/tests/usr.bin/c++/t_msan_heap.sh  Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_msan_heap.sh  Sun Jun 12 08:55:36 2022 +0000
@@ -78,7 +78,7 @@
 int main() { int *a = (int *)malloc(sizeof(int)); return *a; }
 EOF
 
-       c++ -fsanitize=memory -o test -pg test.cc
+       c++ -fsanitize=memory -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o ignore -e match:"WARNING: MemorySanitizer: use-of-uninitialized-value" ./test
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_msan_partial_poison.sh
--- a/tests/usr.bin/c++/t_msan_partial_poison.sh        Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_msan_partial_poison.sh        Sun Jun 12 08:55:36 2022 +0000
@@ -94,7 +94,7 @@
 }
 EOF
 
-       c++ -fsanitize=memory -o test -pg test.cc
+       c++ -fsanitize=memory -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o ignore -e match:": 77654321" ./test
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_msan_poison.sh
--- a/tests/usr.bin/c++/t_msan_poison.sh        Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_msan_poison.sh        Sun Jun 12 08:55:36 2022 +0000
@@ -92,7 +92,7 @@
 }
 EOF
 
-       c++ -fsanitize=memory -o test -pg test.cc
+       c++ -fsanitize=memory -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o ignore -e match:"Uninitialized bytes in __msan_check_mem_is_initialized at offset 5 inside" ./test
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_msan_realloc.sh
--- a/tests/usr.bin/c++/t_msan_realloc.sh       Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_msan_realloc.sh       Sun Jun 12 08:55:36 2022 +0000
@@ -90,7 +90,7 @@
 }
 EOF
 
-       c++ -fsanitize=memory -o test -pg test.cc
+       c++ -fsanitize=memory -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o ignore -e match:"WARNING: MemorySanitizer: use-of-uninitialized-value" ./test
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_msan_shadow.sh
--- a/tests/usr.bin/c++/t_msan_shadow.sh        Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_msan_shadow.sh        Sun Jun 12 08:55:36 2022 +0000
@@ -100,7 +100,7 @@
 }
 EOF
 
-       c++ -fsanitize=memory -o test -pg test.cc
+       c++ -fsanitize=memory -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o match:"2" -e match:"00000000 ff000000" ./test
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_msan_stack.sh
--- a/tests/usr.bin/c++/t_msan_stack.sh Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_msan_stack.sh Sun Jun 12 08:55:36 2022 +0000
@@ -88,7 +88,7 @@
 }
 EOF
 
-       c++ -fsanitize=memory -o test -pg test.cc
+       c++ -fsanitize=memory -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o ignore -e match:"MemorySanitizer: bad pointer" ./test
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_msan_unpoison.sh
--- a/tests/usr.bin/c++/t_msan_unpoison.sh      Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_msan_unpoison.sh      Sun Jun 12 08:55:36 2022 +0000
@@ -100,7 +100,7 @@
 }
 EOF
 
-       c++ -fsanitize=memory -o test -pg test.cc
+       c++ -fsanitize=memory -static -o test -pg test.cc
        paxctl +a test
        atf_check -s ignore -o ignore -e not-match:"WARNING: MemorySanitizer: use-of-uninitialized-value" ./test
 }
diff -r 653d927650fc -r 20fe102f070c tests/usr.bin/c++/t_pthread_once.sh
--- a/tests/usr.bin/c++/t_pthread_once.sh       Sun Jun 12 08:04:07 2022 +0000
+++ b/tests/usr.bin/c++/t_pthread_once.sh       Sun Jun 12 08:55:36 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_pthread_once.sh,v 1.4 2020/10/13 06:49:27 rin Exp $
+#      $NetBSD: t_pthread_once.sh,v 1.5 2022/06/12 08:55:36 skrll Exp $
 #
 # Copyright (c) 2018 The NetBSD Foundation, Inc.
 # All rights reserved.



Home | Main Index | Thread Index | Old Index