Commit 580fdc9 1 parent ae63e78 commit 580fdc9 Copy full SHA for 580fdc9
File tree 2 files changed +27
-2
lines changed
2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -151,3 +151,20 @@ jobs:
151
151
run : make VERBOSE=1
152
152
- name : Test it
153
153
run : make test
154
+ linux-asan :
155
+ name : ASAN
156
+ runs-on : ubuntu-latest
157
+ steps :
158
+ - uses : actions/checkout@v4
159
+ with :
160
+ submodules : true
161
+ - name : Dependencies
162
+ run : |
163
+ sudo apt update
164
+ sudo apt install -y libcurl4-openssl-dev
165
+ - name : Build it
166
+ run : make BUILD_WITH_ASAN=ON
167
+ - name : Test it
168
+ env :
169
+ ASAN_OPTIONS : halt_on_error=1
170
+ run : make test
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ macro(cpr_option OPTION_NAME OPTION_TEXT OPTION_DEFAULT)
45
45
endmacro ()
46
46
47
47
cpr_option(BUILD_WITH_ASAN "If ON, build with the address sanitizer enabled" OFF )
48
+ cpr_option(BUILD_WITH_MSAN "If ON, build with the memory sanitizer enabled" OFF )
49
+ cpr_option(BUILD_WITH_UBSAN "If ON, build with the undefined behavior sanitizer enabled" OFF )
48
50
cpr_option(USE_EXTERNAL_FFI "Specify to use external ffi dependency" OFF )
49
51
50
52
add_subdirectory (deps/quickjs EXCLUDE_FROM_ALL )
@@ -144,8 +146,14 @@ target_include_directories(tjs PRIVATE ${CURL_INCLUDE_DIRS})
144
146
target_link_libraries (tjs qjs uv_a m3 sqlite3 m pthread ${CURL_LIBRARIES} )
145
147
146
148
if (BUILD_WITH_ASAN)
147
- target_compile_options (tjs PRIVATE -fsanitize=address)
148
- target_link_options (tjs PRIVATE -fsanitize=address)
149
+ target_compile_options (tjs PRIVATE -fsanitize=address -fno-sanitize-recover=all -fno-omit-frame-pointer)
150
+ target_link_options (tjs PRIVATE -fsanitize=address -fno-sanitize-recover=all -fno-omit-frame-pointer)
151
+ elseif (BUILD_WITH_MSAN)
152
+ target_compile_options (tjs PRIVATE -fsanitize=memory -fno-sanitize-recover=all -fno-omit-frame-pointer)
153
+ target_link_options (tjs PRIVATE -fsanitize=memory -fno-sanitize-recover=all -fno-omit-frame-pointer)
154
+ elseif (BUILD_WITH_UBSAN)
155
+ target_compile_options (tjs PRIVATE -fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer)
156
+ target_link_options (tjs PRIVATE -fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer)
149
157
endif ()
150
158
151
159
add_executable (tjsc EXCLUDE_FROM_ALL
You can’t perform that action at this time.
0 commit comments