pkgsrc-Bugs archive

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

pkg/57115: lang/gcc10 regression: no sanitizers



>Number:         57115
>Category:       pkg
>Synopsis:       lang/gcc10 has no sanitizers (this is a regression)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 17 19:50:00 +0000 2022
>Originator:     Rhialto
>Release:        NetBSD 9.3
>Organization:
	
>Environment:
	
	
System: NetBSD murthe.falu.nl 9.3 NetBSD 9.3 (MAXLWP8192) #0: Sat Aug 6 22:25:06 CEST 2022 rhialto%murthe.falu.nl@localhost:/mnt/scratch/scratch/NetBSD/NetBSD-9.3/source/sets/x/usr/src/sys/arch/amd64/compile/MAXLWP8192 amd64
Architecture: x86_64
Machine: amd64
>Description:
	Package lang/gcc10 does not build the libraries for asan and ubsan.

        See https://mail-index.netbsd.org/pkgsrc-users/2022/12/16/msg036629.html
        for a mail tread.
>How-To-Repeat:
	Try to use -fsanitizer=address
>Fix:
	I added some patches to the package, partly adapted from lang/gcc8.
        That still ended up with the dreaded

        ==19445==ASan runtime does not come first in initial library list; you
        should either link runtime to your application or manually preload it
        with LD_PRELOAD.

        which seems unfixable by the user (at least I never found how).
        At this point I gave up.

        Patches so far:

==== patch-libsanitizer_configure.tgt ====
$NetBSD: patch-libsanitizer_configure.tgt,v 1.1 2018/05/05 04:08:36 maya Exp $

--- libsanitizer/configure.tgt.orig	2022-06-28 08:54:31.000000000 +0000
+++ libsanitizer/configure.tgt
@@ -68,6 +68,10 @@ case "${target}" in
 	;;
   riscv64-*-linux*)
 	;;
+  x86_64-*-netbsd*)
+	TSAN_SUPPORTED=no
+	LSAN_SUPPORTED=no
+	;;
   *)
 	UNSUPPORTED=1
 	;;
==== patch-libsanitizer_sanitizer__common_Makefile.am ====
$NetBSD: patch-libsanitizer_sanitizer__common_Makefile.am,v 1.1 2018/05/05 04:08:36 maya Exp $

Enable building libasan and libubsan.

--- libsanitizer/sanitizer_common/Makefile.am.orig	2022-06-28 08:54:31.000000000 +0000
+++ libsanitizer/sanitizer_common/Makefile.am
@@ -45,6 +45,7 @@ sanitizer_common_files = \
 	sanitizer_openbsd.cpp \
 	sanitizer_persistent_allocator.cpp \
 	sanitizer_platform_limits_linux.cpp \
+	sanitizer_platform_limits_netbsd.cpp \
 	sanitizer_platform_limits_openbsd.cpp \
 	sanitizer_platform_limits_posix.cpp \
 	sanitizer_platform_limits_solaris.cpp \
@@ -66,6 +67,7 @@ sanitizer_common_files = \
 	sanitizer_symbolizer_report.cpp \
 	sanitizer_stacktrace_printer.cpp \
 	sanitizer_stoptheworld_linux_libcdep.cpp \
+	sanitizer_stoptheworld_netbsd_libcdep.cpp \
 	sanitizer_stoptheworld_mac.cpp \
 	sanitizer_suppressions.cpp \
 	sanitizer_symbolizer.cpp \
==== patch-libsanitizer_sanitizer__common_Makefile.in ====
$NetBSD: patch-libsanitizer_sanitizer__common_Makefile.in,v 1.1 2018/05/05 04:08:36 maya Exp $

Enable building libasan and libubsan.

--- libsanitizer/sanitizer_common/Makefile.in.orig	2022-06-28 08:55:09.000000000 +0000
+++ libsanitizer/sanitizer_common/Makefile.in
@@ -131,6 +131,7 @@ am__objects_1 = sancov_flags.lo sanitize
 	sanitizer_mac.lo sanitizer_mac_libcdep.lo sanitizer_netbsd.lo \
 	sanitizer_openbsd.lo sanitizer_persistent_allocator.lo \
 	sanitizer_platform_limits_linux.lo \
+	sanitizer_platform_limits_netbsd.lo \
 	sanitizer_platform_limits_openbsd.lo \
 	sanitizer_platform_limits_posix.lo \
 	sanitizer_platform_limits_solaris.lo sanitizer_posix.lo \
@@ -143,6 +144,7 @@ am__objects_1 = sancov_flags.lo sanitize
 	sanitizer_stacktrace_sparc.lo sanitizer_symbolizer_mac.lo \
 	sanitizer_symbolizer_report.lo sanitizer_stacktrace_printer.lo \
 	sanitizer_stoptheworld_linux_libcdep.lo \
+	sanitizer_stoptheworld_netbsd_libcdep.lo \
 	sanitizer_stoptheworld_mac.lo sanitizer_suppressions.lo \
 	sanitizer_symbolizer.lo sanitizer_symbolizer_libbacktrace.lo \
 	sanitizer_symbolizer_libcdep.lo \
@@ -402,6 +404,7 @@ sanitizer_common_files = \
 	sanitizer_openbsd.cpp \
 	sanitizer_persistent_allocator.cpp \
 	sanitizer_platform_limits_linux.cpp \
+	sanitizer_platform_limits_netbsd.cpp \
 	sanitizer_platform_limits_openbsd.cpp \
 	sanitizer_platform_limits_posix.cpp \
 	sanitizer_platform_limits_solaris.cpp \
@@ -423,6 +426,7 @@ sanitizer_common_files = \
 	sanitizer_symbolizer_report.cpp \
 	sanitizer_stacktrace_printer.cpp \
 	sanitizer_stoptheworld_linux_libcdep.cpp \
+	sanitizer_stoptheworld_netbsd_libcdep.cpp \
 	sanitizer_stoptheworld_mac.cpp \
 	sanitizer_suppressions.cpp \
 	sanitizer_symbolizer.cpp \
@@ -558,6 +562,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_openbsd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_persistent_allocator.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_platform_limits_linux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_platform_limits_netbsd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_platform_limits_openbsd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_platform_limits_posix.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_platform_limits_solaris.Plo@am__quote@
@@ -577,6 +582,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_stacktrace_printer.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_stacktrace_sparc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_stoptheworld_linux_libcdep.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_stoptheworld_netbsd_libcdep.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_stoptheworld_mac.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_suppressions.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_symbolizer.Plo@am__quote@
==== patch-libsanitizer_sanitizer__common_sanitizer__platform__limits__netbsd.cpp ====
$NetBSD$

Enable building libasan and libubsan.

Somehow MD5_CTX and MD5_DIGEST_STRING_LENGTH are unknown even after including
<md5.h>. Somehow it works better with <sys/md5.h>. This smells like a gcc bug.

--- libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cpp.orig	2022-06-28 08:54:31.000000000 +0000
+++ libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
@@ -203,7 +203,7 @@
 #include <stddef.h>
 #include <md2.h>
 #include <md4.h>
-#include <md5.h>
+#include <sys/md5.h>
 #include <rmd160.h>
 #include <soundcard.h>
 #include <term.h>

-Olaf.
-- 
___ "Buying carbon credits is a bit like a serial killer paying someone else to
\X/  have kids to make his activity cost neutral." -The BOFH    falu.nl@rhialto

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index