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'"
This commit is contained in:
skrll 2022-06-12 08:55:36 +00:00
parent 4a76333117
commit 4bb9965c48
50 changed files with 71 additions and 71 deletions

View File

@ -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 @@ asan_test_case() {
$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 @@ asan_test_case() {
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
}"

View File

@ -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 @@ int main(void) {
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 @@ int main(void) {
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
}

View File

@ -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 @@ int main(void) {
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 @@ int main(void) {
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"
}

View File

@ -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 @@ cxxruntime_profile_body() {
#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 @@ cxxruntime_profile_32_body() {
#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
}

View File

@ -90,7 +90,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
}
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
}

View File

@ -98,7 +98,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
}
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
}

View File

@ -88,7 +88,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
}
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
}

View File

@ -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 @@ hello_profile_body() {
#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 @@ hello_profile_32_body() {
#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
}

View File

@ -90,7 +90,7 @@ int main() {
}
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
}

View File

@ -92,7 +92,7 @@ int main(int argc, char **argv) {
}
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
}

View File

@ -88,7 +88,7 @@ int main() {
}
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
}

View File

@ -78,7 +78,7 @@ heap_profile_body(){
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
}

View File

@ -94,7 +94,7 @@ int main(void) {
}
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
}

View File

@ -92,7 +92,7 @@ int main(void) {
}
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
}

View File

@ -90,7 +90,7 @@ int main(int argc, char **argv) {
}
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
}

View File

@ -100,7 +100,7 @@ int main(int argc, char **argv) {
}
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
}

View File

@ -88,7 +88,7 @@ int main() {
}
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
}

View File

@ -100,7 +100,7 @@ int main(void) {
}
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
}

View File

@ -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.
@ -109,7 +109,7 @@ int main(void) {
return 0;
}
EOF
atf_check -s exit:0 -o ignore -e ignore c++ -pg -o pthread_once test.cpp -pthread
atf_check -s exit:0 -static -o ignore -e ignore c++ -pg -o pthread_once test.cpp -pthread
atf_check -s exit:0 -o inline:"hello, world!\n" ./pthread_once
}
@ -135,7 +135,7 @@ int main(void) {
return 0;
}
EOF
atf_check -s exit:0 -o ignore -e ignore c++ -m32 -pg -o pthread_once test.cpp -pthread
atf_check -s exit:0 -static -o ignore -e ignore c++ -m32 -pg -o pthread_once test.cpp -pthread
atf_check -s exit:0 -o inline:"hello, world!\n" ./pthread_once
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_static_destructor.sh,v 1.4 2020/10/13 06:49:27 rin Exp $
# $NetBSD: t_static_destructor.sh,v 1.5 2022/06/12 08:55:36 skrll Exp $
#
# Copyright (c) 2017 The NetBSD Foundation, Inc.
# All rights reserved.
@ -122,7 +122,7 @@ struct B {
};
int main(void) {struct B b;return 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:"CTOR A\nCTOR B\nDTOR B:10\nDTOR A:20\n" ./hello
}
@ -153,7 +153,7 @@ struct B {
};
int main(void) {struct B b;return 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:"CTOR A\nCTOR B\nDTOR B:10\nDTOR A:20\n" ./hello
}

View File

@ -95,7 +95,7 @@ int main() {
}
EOF
c++ -fsanitize=thread -o test -pg test.cc
c++ -fsanitize=thread -static -o test -pg test.cc
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: data race " ./test
}

View File

@ -130,7 +130,7 @@ int main() {
}
EOF
c++ -fsanitize=thread -o test -pg test.cc
c++ -fsanitize=thread -static -o test -pg test.cc
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: heap-use-after-free" ./test
}

View File

@ -106,7 +106,7 @@ int main() {
}
EOF
c++ -fsanitize=thread -o test -pg test.cc
c++ -fsanitize=thread -static -o test -pg test.cc
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: lock-order-inversion" ./test
}

View File

@ -114,7 +114,7 @@ int main() {
}
EOF
c++ -fsanitize=thread -o test -pg test.cc
c++ -fsanitize=thread -static -o test -pg test.cc
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: destroy of a locked mutex" ./test
}

View File

@ -107,7 +107,7 @@ int main() {
}
EOF
c++ -fsanitize=thread -o test -pg test.cc
c++ -fsanitize=thread -static -o test -pg test.cc
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: signal handler spoils errno" ./test
}

View File

@ -107,7 +107,7 @@ int main() {
}
EOF
c++ -fsanitize=thread -o test -pg test.cc
c++ -fsanitize=thread -static -o test -pg test.cc
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: thread leak" ./test
}

View File

@ -120,7 +120,7 @@ int main() {
}
EOF
c++ -fsanitize=thread -o test -pg test.cc
c++ -fsanitize=thread -static -o test -pg test.cc
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: data race on vptr \(ctor/dtor vs virtual call\)" ./test
}

View File

@ -1,4 +1,4 @@
# $NetBSD: ubsan_common.subr,v 1.1 2019/01/29 20:07:03 mgorny Exp $
# $NetBSD: ubsan_common.subr,v 1.2 2022/06/12 08:55:36 skrll Exp $
#
# Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
# All rights reserved.
@ -91,7 +91,7 @@ ubsan_test_case() {
$1_profile_body() {
echo \"\$UBSAN_CODE\" > test.cpp
c++ -fsanitize=undefined -o test -pg test.cpp
c++ -fsanitize=undefined -static -o test -pg test.cpp
atf_check -s ignore -e match:'$3' ./test
}
@ -142,7 +142,7 @@ ubsan_test_case() {
atf_check -s ignore -e match:'$3' ./df32
# and another test with profile 32bit binaries
c++ -fsanitize=undefined -o test -pg -m32 test.cpp
c++ -fsanitize=undefined -static -o test -pg -m32 test.cpp
atf_check -s ignore -e match:'$3' ./test
}"
}

View File

@ -1,4 +1,4 @@
# $NetBSD: asan_common.subr,v 1.2 2021/10/12 18:40:01 skrll Exp $
# $NetBSD: asan_common.subr,v 1.3 2022/06/12 08:55:36 skrll Exp $
#
# Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
# All rights reserved.
@ -93,7 +93,7 @@ asan_test_case() {
$1_profile_body() {
echo \"\$ASAN_CODE\" > test.c
cc -fsanitize=address -o test -pg test.c
cc -fsanitize=address -static -o test -pg test.c
paxctl +a test
atf_check -s not-exit:0 -o not-match:'CHECK\n' -e match:'$3' ./test
}
@ -148,7 +148,7 @@ asan_test_case() {
atf_check -s not-exit:0 -o not-match:'CHECK\n' -e match:'$3' ./df32
# and another test with profile 32bit binaries
cc -fsanitize=address -o test -pg -m32 test.c
cc -fsanitize=address -static -o test -pg -m32 test.c
paxctl +a test
atf_check -s not-exit:0 -o not-match:'CHECK\n' -e match:'$3' ./test
}"

View File

@ -90,7 +90,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
}
EOF
cc -fsanitize=fuzzer -o test -pg test.c
cc -fsanitize=fuzzer -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"ERROR: libFuzzer: out-of-memory" ./test -rss_limit_mb=30
}

View File

@ -98,7 +98,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
}
EOF
cc -fsanitize=fuzzer -o test -pg test.c
cc -fsanitize=fuzzer -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"BINGO" ./test
}

View File

@ -88,7 +88,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
}
EOF
cc -fsanitize=fuzzer -o test -pg test.c
cc -fsanitize=fuzzer -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"ERROR: libFuzzer: timeout" ./test -timeout=5
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_hello.sh,v 1.10 2020/10/13 06:49:27 rin Exp $
# $NetBSD: t_hello.sh,v 1.11 2022/06/12 08:55:36 skrll Exp $
#
# Copyright (c) 2011 The NetBSD Foundation, Inc.
# All rights reserved.
@ -71,7 +71,7 @@ hello_profile_body() {
#include <stdlib.h>
int main(void) {printf("hello world\n");exit(0);}
EOF
atf_check -s exit:0 -o ignore -e ignore cc -o hello -pg test.c
atf_check -s exit:0 -static -o ignore -e ignore cc -o hello -pg test.c
atf_check -s exit:0 -o inline:"hello world\n" ./hello
atf_check -s exit:0 -o ignore -e ignore cc -o hello2 -fprofile-generate test.c
atf_check -s exit:0 -o inline:"hello world\n" ./hello2

View File

@ -90,7 +90,7 @@ int main() {
}
EOF
cc -fsanitize=memory -o test -pg test.c
cc -fsanitize=memory -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: MemorySanitizer: use-of-uninitialized-value" ./test
}

View File

@ -92,7 +92,7 @@ int main(int argc, char **argv) {
}
EOF
cc -fsanitize=memory -o test -pg test.c
cc -fsanitize=memory -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"Uninitialized bytes in __msan_check_mem_is_initialized at offset 0 inside" ./test
}

View File

@ -88,7 +88,7 @@ int main() {
}
EOF
cc -fsanitize=memory -o test -pg test.c
cc -fsanitize=memory -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: MemorySanitizer: use-of-uninitialized-value" ./test
}

View File

@ -78,7 +78,7 @@ heap_profile_body(){
int main() { int *a = (int *)malloc(sizeof(int)); return *a; }
EOF
cc -fsanitize=memory -o test -pg test.c
cc -fsanitize=memory -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: MemorySanitizer: use-of-uninitialized-value" ./test
}

View File

@ -94,7 +94,7 @@ int main(void) {
}
EOF
cc -fsanitize=memory -o test -pg test.c
cc -fsanitize=memory -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:": 77654321" ./test
}

View File

@ -92,7 +92,7 @@ int main(void) {
}
EOF
cc -fsanitize=memory -o test -pg test.c
cc -fsanitize=memory -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"Uninitialized bytes in __msan_check_mem_is_initialized at offset 5 inside" ./test
}

View File

@ -90,7 +90,7 @@ int main(int argc, char **argv) {
}
EOF
cc -fsanitize=memory -o test -pg test.c
cc -fsanitize=memory -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: MemorySanitizer: use-of-uninitialized-value" ./test
}

View File

@ -100,7 +100,7 @@ int main(int argc, char **argv) {
}
EOF
cc -fsanitize=memory -o test -pg test.c
cc -fsanitize=memory -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o match:"2" -e match:"00000000 ff000000" ./test
}

View File

@ -88,7 +88,7 @@ int main() {
}
EOF
cc -fsanitize=memory -o test -pg test.c
cc -fsanitize=memory -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"MemorySanitizer: bad pointer" ./test
}

View File

@ -100,7 +100,7 @@ int main(void) {
}
EOF
cc -fsanitize=memory -o test -pg test.c
cc -fsanitize=memory -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e not-match:"WARNING: MemorySanitizer: use-of-uninitialized-value" ./test
}

View File

@ -95,7 +95,7 @@ int main() {
}
EOF
cc -fsanitize=thread -o test -pg test.c
cc -fsanitize=thread -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: data race " ./test
}

View File

@ -113,7 +113,7 @@ int main() {
}
EOF
cc -fsanitize=thread -o test -pg test.c
cc -fsanitize=thread -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: heap-use-after-free" ./test
}

View File

@ -105,7 +105,7 @@ int main() {
}
EOF
cc -fsanitize=thread -o test -pg test.c
cc -fsanitize=thread -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: lock-order-inversion" ./test
}

View File

@ -113,7 +113,7 @@ int main() {
}
EOF
cc -fsanitize=thread -o test -pg test.c
cc -fsanitize=thread -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: destroy of a locked mutex" ./test
}

View File

@ -107,7 +107,7 @@ int main() {
}
EOF
cc -fsanitize=thread -o test -pg test.c
cc -fsanitize=thread -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: signal handler spoils errno" ./test
}

View File

@ -107,7 +107,7 @@ int main() {
}
EOF
cc -fsanitize=thread -o test -pg test.c
cc -fsanitize=thread -static -o test -pg test.c
paxctl +a test
atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: thread leak" ./test
}

View File

@ -1,4 +1,4 @@
# $NetBSD: ubsan_common.subr,v 1.1 2019/01/29 19:59:10 mgorny Exp $
# $NetBSD: ubsan_common.subr,v 1.2 2022/06/12 08:55:36 skrll Exp $
#
# Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
# All rights reserved.
@ -91,7 +91,7 @@ ubsan_test_case() {
$1_profile_body() {
echo \"\$UBSAN_CODE\" > test.c
cc -fsanitize=undefined -o test -pg test.c
cc -fsanitize=undefined -static -o test -pg test.c
atf_check -s ignore -e match:'$3' ./test
}
@ -142,7 +142,7 @@ ubsan_test_case() {
atf_check -s ignore -e match:'$3' ./df32
# and another test with profile 32bit binaries
cc -fsanitize=undefined -o test -pg -m32 test.c
cc -fsanitize=undefined -static -o test -pg -m32 test.c
atf_check -s ignore -e match:'$3' ./test
}"
}