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.

wyoung 2019-08-20 04:24 configure-updates
Commit 66fdab7605d37be5bf559b3a9b193f8e9fe22608d1b4402c9a7f08bd5ec0971f
1 file changed +2 -2
+2 -2
--- auto.def
+++ auto.def
@@ -595,14 +595,14 @@
595595
596596
# Add -fsanitize compile and link options late: we don't want the C
597597
# checks above to run with those sanitizers enabled. It can not only
598598
# be pointless, it can actually break correct tests.
599599
set fsan [opt-val with-sanitizer]
600
-if {[string length fsan]} {
600
+if {[string length $fsan]} {
601601
define-append EXTRA_CFLAGS -fsanitize=$fsan
602602
define-append EXTRA_LDFLAGS -fsanitize=$fsan
603
- if {[string first "undefined" $fsan]} {
603
+ if {[string first "undefined" $fsan] != -1} {
604604
# We need to link with libubsan if we're compiling under
605605
# GCC with -fsanitize=undefined.
606606
cc-check-function-in-lib __ubsan_handle_add_overflow ubsan
607607
}
608608
}
609609
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button