Fossil SCM
Fixed a couple of Tcl syntax fixes that caused the new --with-sanitizer code to a) run unconditionally irrespective of the option's setting and b) to check for the existence of libubsan whether it was actually needed or not.
Commit
66fdab7605d37be5bf559b3a9b193f8e9fe22608d1b4402c9a7f08bd5ec0971f
Parent
7907b6ffae6c6fa…
1 file changed
+2
-2
M
auto.def
+2
-2
| --- auto.def | ||
| +++ auto.def | ||
| @@ -595,14 +595,14 @@ | ||
| 595 | 595 | |
| 596 | 596 | # Add -fsanitize compile and link options late: we don't want the C |
| 597 | 597 | # checks above to run with those sanitizers enabled. It can not only |
| 598 | 598 | # be pointless, it can actually break correct tests. |
| 599 | 599 | set fsan [opt-val with-sanitizer] |
| 600 | -if {[string length fsan]} { | |
| 600 | +if {[string length $fsan]} { | |
| 601 | 601 | define-append EXTRA_CFLAGS -fsanitize=$fsan |
| 602 | 602 | define-append EXTRA_LDFLAGS -fsanitize=$fsan |
| 603 | - if {[string first "undefined" $fsan]} { | |
| 603 | + if {[string first "undefined" $fsan] != -1} { | |
| 604 | 604 | # We need to link with libubsan if we're compiling under |
| 605 | 605 | # GCC with -fsanitize=undefined. |
| 606 | 606 | cc-check-function-in-lib __ubsan_handle_add_overflow ubsan |
| 607 | 607 | } |
| 608 | 608 | } |
| 609 | 609 |
| --- auto.def | |
| +++ auto.def | |
| @@ -595,14 +595,14 @@ | |
| 595 | |
| 596 | # Add -fsanitize compile and link options late: we don't want the C |
| 597 | # checks above to run with those sanitizers enabled. It can not only |
| 598 | # be pointless, it can actually break correct tests. |
| 599 | set fsan [opt-val with-sanitizer] |
| 600 | if {[string length fsan]} { |
| 601 | define-append EXTRA_CFLAGS -fsanitize=$fsan |
| 602 | define-append EXTRA_LDFLAGS -fsanitize=$fsan |
| 603 | if {[string first "undefined" $fsan]} { |
| 604 | # We need to link with libubsan if we're compiling under |
| 605 | # GCC with -fsanitize=undefined. |
| 606 | cc-check-function-in-lib __ubsan_handle_add_overflow ubsan |
| 607 | } |
| 608 | } |
| 609 |
| --- auto.def | |
| +++ auto.def | |
| @@ -595,14 +595,14 @@ | |
| 595 | |
| 596 | # Add -fsanitize compile and link options late: we don't want the C |
| 597 | # checks above to run with those sanitizers enabled. It can not only |
| 598 | # be pointless, it can actually break correct tests. |
| 599 | set fsan [opt-val with-sanitizer] |
| 600 | if {[string length $fsan]} { |
| 601 | define-append EXTRA_CFLAGS -fsanitize=$fsan |
| 602 | define-append EXTRA_LDFLAGS -fsanitize=$fsan |
| 603 | if {[string first "undefined" $fsan] != -1} { |
| 604 | # We need to link with libubsan if we're compiling under |
| 605 | # GCC with -fsanitize=undefined. |
| 606 | cc-check-function-in-lib __ubsan_handle_add_overflow ubsan |
| 607 | } |
| 608 | } |
| 609 |