Mercurial > octave
comparison run-octave.in @ 30277:f816a8c44924
allow build to succeed when address sanitizer is enabled (bug #61415)
* configure.ac, Makefile.am: Explicitly substitute
ADDRESS_SANITIZER_ENABLED and ADDRESS_SANITIZER_OPTIONS.
* subst-script-vals.in.sh: Also substitute ADDRESS_SANITIZER_ENABLED.
* run-octave.in: New option, -disable-asan, to suppress address
sanitizer output and disable leak checks on exit.
* graphics_properties.mk, images.awk, doc/interpreter/module.mk:
Invoke run-octave with -disable-asan.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 10 Nov 2021 11:50:31 -0500 |
parents | 2a4980872234 |
children | 796f54d4ddbf |
comparison
equal
deleted
inserted
replaced
30276:63147d7d53a0 | 30277:f816a8c44924 |
---|---|
28 ######################################################################## | 28 ######################################################################## |
29 | 29 |
30 : ${AWK=%AWK%} | 30 : ${AWK=%AWK%} |
31 : ${FIND=%FIND%} | 31 : ${FIND=%FIND%} |
32 : ${SED=%SED%} | 32 : ${SED=%SED%} |
33 : ${ADDRESS_SANITIZER_OPTIONS="%ADRESS_SANITIZER_OPTIONS%"} | 33 : ${ADDRESS_SANITIZER_ENABLED="%ADDRESS_SANITIZER_ENABLED%"} |
34 : ${ADDRESS_SANITIZER_OPTIONS="%ADDRESS_SANITIZER_OPTIONS%"} | |
34 | 35 |
35 # FIXME: is there a better way to handle the possibility of spaces | 36 # FIXME: is there a better way to handle the possibility of spaces |
36 # in these names? | 37 # in these names? |
37 | 38 |
38 top_srcdir='%abs_top_srcdir%' | 39 top_srcdir='%abs_top_srcdir%' |
88 driver="strace -o octave.trace" | 89 driver="strace -o octave.trace" |
89 shift | 90 shift |
90 elif [ "x$1" = "x-cli" ]; then | 91 elif [ "x$1" = "x-cli" ]; then |
91 octave_executable="$builddir/src/octave-cli" | 92 octave_executable="$builddir/src/octave-cli" |
92 shift | 93 shift |
94 elif [ "x$1" = "x-disable-asan" ]; then | |
95 disable_asan=yes | |
96 shift | |
93 else | 97 else |
94 break | 98 break |
95 fi | 99 fi |
96 done | 100 done |
97 | 101 |
117 OCTAVE_QTHELP_COLLECTION="$builddir/doc/interpreter/octave_interpreter.qhc"; export OCTAVE_QTHELP_COLLECTION | 121 OCTAVE_QTHELP_COLLECTION="$builddir/doc/interpreter/octave_interpreter.qhc"; export OCTAVE_QTHELP_COLLECTION |
118 OCTAVE_SITE_INITFILE="$top_srcdir/scripts/startup/site-rcfile"; export OCTAVE_SITE_INITFILE | 122 OCTAVE_SITE_INITFILE="$top_srcdir/scripts/startup/site-rcfile"; export OCTAVE_SITE_INITFILE |
119 OCTAVE_VERSION_INITFILE="$top_srcdir/scripts/startup/version-rcfile"; export OCTAVE_VERSION_INITFILE | 123 OCTAVE_VERSION_INITFILE="$top_srcdir/scripts/startup/version-rcfile"; export OCTAVE_VERSION_INITFILE |
120 | 124 |
121 if [ "$ADDRESS_SANITIZER_ENABLED" = yes ]; then | 125 if [ "$ADDRESS_SANITIZER_ENABLED" = yes ]; then |
122 ASAN_OPTIONS=symbolize=1; export ASAN_OPTIONS | 126 if [ "$disable_asan" = yes ]; then |
127 ## Is there a better way to do this so that we don't fill /tmp | |
128 ## with junk files? Using /dev/null won't work because asan | |
129 ## appends the process ID to the file name. | |
130 ASAN_OPTIONS="leak_check_at_exit=0:log_path=/tmp/oct-asan-log:verbosity=0" | |
131 else | |
132 ASAN_OPTIONS="$ADDRESS_SANITIZER_OPTIONS" | |
133 fi | |
134 export ASAN_OPTIONS | |
123 fi | 135 fi |
124 | 136 |
125 exec $builddir/libtool --mode=execute $driver \ | 137 exec $builddir/libtool --mode=execute $driver \ |
126 "$octave_executable" --no-init-path --path="$LOADPATH" \ | 138 "$octave_executable" --no-init-path --path="$LOADPATH" \ |
127 --image-path="$IMAGEPATH" --doc-cache-file="$DOCFILE" \ | 139 --image-path="$IMAGEPATH" --doc-cache-file="$DOCFILE" \ |