pkgsrc-Users archive

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

Re: lang/gcc10 is missing libasan because patches not ported forward



On Sat 17 Dec 2022 at 15:42:12 +0100, Rhialto wrote:
> Anyway, the build failed because of something in
> gcc-10.4.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
> which is apparently included from upstream but not used without these
> patches?
> 
> ../../../../gcc-10.4.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cpp:2182:36: error: 'MD5_CTX' was not declared in this scope; did you mean 'MD4_CTX'?
>  2182 | const unsigned MD5_CTX_sz = sizeof(MD5_CTX);
>       |                                    ^~~~~~~
>       |                                    MD4_CTX
> ../../../../gcc-10.4.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cpp:2183:36: error: 'MD5_DIGEST_STRING_LENGTH' was not declared in this scope; did you mean 'MD2_DIGEST_STRING_LENGTH'?
>  2183 | const unsigned MD5_return_length = MD5_DIGEST_STRING_LENGTH;
>       |                                    ^~~~~~~~~~~~~~~~~~~~~~~~
>       |                                    MD2_DIGEST_STRING_LENGTH

It is totally unexplainable, but for some reason the #include <md5.h>
which is correctly present in the file doesn't have effect. I wonder if
there is some weird bug in duplicate-include-avoidance or something.

Re-including <md5.h> doesn't help. Even with #undef _SYS_MD5_H_ before
it.
Inlining some lines from <md5.h> works.
Changing the #include to <sys/md5.h> also works... huh???
The former is a symlink to the latter so it should make no difference at
all.

But this seems to point to a bug in a strategy to avoid double #includes
or something like that.

$NetBSD$

--- 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>

Anyway, this still doesn't produce a working sanitizer in the end.
Although libasan and libusan are now built, they still miss something.
A small test with a known-working case from gcc8 now has a link error:

/usr/bin/ld: /usr/pkg/gcc10/lib/gcc/x86_64--netbsd/10.4.0/../../../libasan.so: undefined reference to `__sanitizer::StopTheWorld(void (*)(__sanitizer::SuspendedThreadsList const&, void*), void*)'
collect2: error: ld returned 1 exit status

-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

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index