Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Feb 2023 10:32:48 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        David Chisnall <theraven@FreeBSD.org>, shawn.webb@hardenedbsd.org
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>, Dimitry Andric <dim@FreeBSD.org>
Subject:   Re: CFT: snmalloc as libc malloc (the source_location issue)
Message-ID:  <64CA5178-100B-4244-8F36-ADF417EE2F5C@yahoo.com>
In-Reply-To: <F363CC44-831B-41E8-BB82-564144C48AA4@FreeBSD.org>
References:  <22F8AD1A-C1F9-48FA-BCED-E165E2DA5260@yahoo.com> <1982263E-57E0-4709-AAB3-DBB4F75C7546@yahoo.com> <96652C51-EAB7-46C7-9039-557A5DCDAB75@yahoo.com> <F363CC44-831B-41E8-BB82-564144C48AA4@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Feb 11, 2023, at 09:13, David Chisnall <theraven@FreeBSD.org> wrote:

> On 10 Feb 2023, at 21:34, Mark Millard <marklmi@yahoo.com> wrote:
>>=20
>> # find / -name source_location -print | more
>> =
/usr/obj/DESTDIRs/main-amd64-chroot/usr/local/lib/gcc12/include/c++/experi=
mental/source_location
>> =
/usr/obj/DESTDIRs/main-amd64-chroot/usr/local/lib/gcc12/include/c++/source=
_location
>> /usr/local/lib/gcc12/include/c++/experimental/source_location
>> /usr/local/lib/gcc12/include/c++/source_location
>>=20
>> So, none for FreeBSD and its llvm15.
>>=20
>> This makes sense, https://libcxx.llvm.org/Status/Cxx20.html shows:
>>=20
>> P1208R6 LWG Adopt source_location for C++20 Cologne Complete 16.0
>>=20
>> So, likely FreeBSD will not have this until it progresses to
>> LLVM16 . It just changed to LLVM15 in main [so: FreeBSD 14].
>=20
> The include of source_location is guarded under an #if __has_include, =
it should be used only if it exists.  If it doesn=E2=80=99t, there=E2=80=99=
s a stub implementation.  If you have GCC includes in your include path, =
is it possible that it=E2=80=99s finding a source_location that is then =
guarded behind a check for a compiler builtin that clang doesn=E2=80=99t =
have?

I was just looking at Shawn's hardenedbsd log and FreeBSD source
(source from after the llvm15 update). Shawn's log shows an example
of:

=
/data/src/hardenedbsd/contrib/snmalloc/src/snmalloc/override/../global/../=
backend/../backend_helpers/../mem/../ds/../pal/../aal/../ds_core/defines.h=
:114:12: fatal error: 'source_location' file not found
# include <source_location>

(I do not have hardenedbsd source around, nor an install. Just
FreeBSD.) The gcc12 present in my search is from/for port building,
not for buildworld or buildkernel for FreeBSD.

I have not tried to do anything with snmalloc myself. I was just
looking at part of the context Shawn presented based on the
request:

QUOTE
Any non-XKCD[138]-conforming pointers would be appreciated. ;-)
END QUOTE

As to how helpful --or not-- Shawn found my notes and responses to
my notes, I do not know. I did not expect my notes to be a complete
classification of everything involved, just a possible start.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?64CA5178-100B-4244-8F36-ADF417EE2F5C>