]> git.sesse.net Git - stockfish/commitdiff
Makefile fix for sanitize
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 31 Oct 2016 20:10:31 +0000 (21:10 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 5 Nov 2016 07:15:56 +0000 (08:15 +0100)
Small fixes for compilation with sanitize=yes optimize=no,
by always adding -fsanitize=undefined to the LDFLAGS as required.
Updates config-sanity to check&report the status of the flag.

No functional change.

src/Makefile

index cdedd25d0da4cb5747594ffd17ec4efad4759067..935445e052b9cca92eb6469fb82311642de75af6 100644 (file)
@@ -264,7 +264,8 @@ endif
 
 ### 3.2.2 Debugging with undefined behavior sanitizers
 ifeq ($(sanitize),yes)
 
 ### 3.2.2 Debugging with undefined behavior sanitizers
 ifeq ($(sanitize),yes)
-       CXXFLAGS += -g3 -fsanitize=undefined
+        CXXFLAGS += -g3 -fsanitize=undefined
+        LDFLAGS += -fsanitize=undefined
 endif
 
 ### 3.3 Optimization
 endif
 
 ### 3.3 Optimization
@@ -472,6 +473,7 @@ config-sanity:
        @echo ""
        @echo "Config:"
        @echo "debug: '$(debug)'"
        @echo ""
        @echo "Config:"
        @echo "debug: '$(debug)'"
+       @echo "sanitize: '$(sanitize)'"
        @echo "optimize: '$(optimize)'"
        @echo "arch: '$(arch)'"
        @echo "bits: '$(bits)'"
        @echo "optimize: '$(optimize)'"
        @echo "arch: '$(arch)'"
        @echo "bits: '$(bits)'"
@@ -490,6 +492,7 @@ config-sanity:
        @echo "Testing config sanity. If this fails, try 'make help' ..."
        @echo ""
        @test "$(debug)" = "yes" || test "$(debug)" = "no"
        @echo "Testing config sanity. If this fails, try 'make help' ..."
        @echo ""
        @test "$(debug)" = "yes" || test "$(debug)" = "no"
+       @test "$(sanitize)" = "yes" || test "$(sanitize)" = "no"
        @test "$(optimize)" = "yes" || test "$(optimize)" = "no"
        @test "$(arch)" = "any" || test "$(arch)" = "x86_64" || test "$(arch)" = "i386" || \
         test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || test "$(arch)" = "armv7"
        @test "$(optimize)" = "yes" || test "$(optimize)" = "no"
        @test "$(arch)" = "any" || test "$(arch)" = "x86_64" || test "$(arch)" = "i386" || \
         test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || test "$(arch)" = "armv7"