Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Sanitizers -- status & how to use?



> 	hello.  In your stack traces, I see libgcc_s.so.1.  Is
> there a comparable library clang should be using instead of a
> library which, on the face of it, looks very gcc specific?  If
> there is, can you use that with different results?

That goes back to "how do I actually use this feature" which I have
not found a cogent description of from a simple user perspective, and
my attempt was by making this diff to the wip/bind920/ package:

: {1} cd /usr/pkgsrc/wip/bind920
: {2} git diff .
diff --git a/bind920/Makefile b/bind920/Makefile
index d270b440ea..6f706070c5 100644
--- a/bind920/Makefile
+++ b/bind920/Makefile
@@ -29,6 +29,12 @@ GNU_CONFIGURE=               yes
 CHECK_FILES_SKIP=      bin/tests/system/system-test-driver.sh
 MAKE_ENV+=             WRKDIR=${WRKDIR} PREFIX=${PREFIX}
 
+# Try to use thread sanitizer
+#PKGSRC_COMPILER=      clang   # does not work with thread sanitizer(!)
+CFLAGS+=               -g
+CFLAGS+=               -fsanitize=thread
+LDFLAGS+=              -lexecinfo
+
 .if ${OPSYS} == "Linux" && !exists(/usr/include/sys/capability.h)
 CONFIGURE_ARGS+=               --disable-linux-caps
 .endif
: {3} 

and I tried to replicate the build & running of one of the tests
configure does to check whether executables produced by the C
compiler complete successfully, which the posted program with the
given options didn't when trying with clang as the C compiler.

If I recall correctly, I had to add the LDFLAGS entry after I
switched to use gcc as the C compiler, and with that the build at
least succeeded.  I have yet to test the result, though, much less
trying to run this in "production".

Regards,

- Håvard


Home | Main Index | Thread Index | Old Index