Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
0d85903d
Commit
0d85903d
authored
Oct 24, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add build_oai/cmake option to build with thread sanitizer
parent
ac5c4efd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
CMakeLists.txt
CMakeLists.txt
+7
-0
cmake_targets/build_oai
cmake_targets/build_oai
+5
-0
No files found.
CMakeLists.txt
View file @
0d85903d
...
@@ -193,6 +193,13 @@ if (SANITIZE_ADDRESS)
...
@@ -193,6 +193,13 @@ if (SANITIZE_ADDRESS)
# wrong in the pthread library, or something subtly wrong in this CMakeLists.txt. Use Ubuntu 20.04 instead.
# wrong in the pthread library, or something subtly wrong in this CMakeLists.txt. Use Ubuntu 20.04 instead.
endif
()
endif
()
add_boolean_option
(
SANITIZE_THREAD False
"enable the address sanitizer (TSan)"
ON
)
if
(
SANITIZE_THREAD
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-fsanitize=thread -fno-omit-frame-pointer -fno-common"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fsanitize=thread -fno-omit-frame-pointer -fno-common"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
-fsanitize=thread"
)
endif
()
add_boolean_option
(
SANITIZE_UNDEFINED False
"enable the undefined behavior sanitizer (UBSan)"
ON
)
add_boolean_option
(
SANITIZE_UNDEFINED False
"enable the undefined behavior sanitizer (UBSan)"
ON
)
if
(
SANITIZE_UNDEFINED
)
if
(
SANITIZE_UNDEFINED
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-fsanitize=undefined -fno-sanitize-recover=all"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-fsanitize=undefined -fno-sanitize-recover=all"
)
...
...
cmake_targets/build_oai
View file @
0d85903d
...
@@ -158,6 +158,8 @@ Options:
...
@@ -158,6 +158,8 @@ Options:
Enable the memory sanitizer on all targets. Requires clang, and is
Enable the memory sanitizer on all targets. Requires clang, and is
incompatible with ASan/UBSan. To build, issue:
incompatible with ASan/UBSan. To build, issue:
CC=/usr/bin/clang CXX=/usr/bin/clang++ ./build_oai ... --sanitize-memory
CC=/usr/bin/clang CXX=/usr/bin/clang++ ./build_oai ... --sanitize-memory
--sanitize-thread | -fsanitize=thread
Enable the thread sanitizer on all targets
-h | --help
-h | --help
Print this help"
Print this help"
}
}
...
@@ -416,6 +418,9 @@ function main() {
...
@@ -416,6 +418,9 @@ function main() {
CMAKE_CMD
=
"
$CMAKE_CMD
-DTRACE_ASN1C_ENC_DEC=ON"
CMAKE_CMD
=
"
$CMAKE_CMD
-DTRACE_ASN1C_ENC_DEC=ON"
echo_info
"Enabling asn1c internal traces via OAI logging system"
echo_info
"Enabling asn1c internal traces via OAI logging system"
shift
1
;;
shift
1
;;
--sanitize-thread
|
-fthread
=
address
)
CMAKE_CMD
=
"
$CMAKE_CMD
-DSANITIZE_THREAD=True"
shift
;;
-h
|
--help
)
-h
|
--help
)
print_help
print_help
exit
1
;;
exit
1
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment