On 12 Jun 2025, at 03:59, Warner Losh <i...@bsdimp.com> wrote:
> 
> On Wed, Jun 11, 2025 at 10:56 PM Shawn Webb <shawn.w...@hardenedbsd.org> 
> wrote:
>> 
>> On Wed, Jun 11, 2025 at 11:16:40PM +0000, Warner Losh wrote:
>>> The branch main has been updated by imp:
>>> 
>>> URL: 
>>> https://cgit.FreeBSD.org/src/commit/?id=3d12567133bfb4082a5115f16a71a865ff2af7fb
>>> 
>>> commit 3d12567133bfb4082a5115f16a71a865ff2af7fb
>>> Author:     Ricardo Branco <rbra...@suse.de>
>>> AuthorDate: 2025-05-10 20:56:03 +0000
>>> Commit:     Warner Losh <i...@freebsd.org>
>>> CommitDate: 2025-06-11 23:16:22 +0000
>>> 
>>>    Add the POSIX sig2str(3) & str2sig(3) calls
>>> 
>>>    Signed-off-by: Ricardo Branco <rbra...@suse.de>
>>>    Reviewed by: imp, kib, des, jilles
>>>    Pull Request: https://github.com/freebsd/freebsd-src/pull/1696
>>> ---
>>> include/signal.h          |   9 ++++
>>> lib/libc/gen/Makefile.inc |   3 ++
>>> lib/libc/gen/Symbol.map   |   2 +
>>> lib/libc/gen/psignal.3    |  56 ++++++++++++++++++++++-
>>> lib/libc/gen/sig2str.c    | 112 
>>> ++++++++++++++++++++++++++++++++++++++++++++++
>>> 5 files changed, 180 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/include/signal.h b/include/signal.h
>>> index c1d341f317f4..22fefb63568f 100644
>>> --- a/include/signal.h
>>> +++ b/include/signal.h
>>> @@ -40,6 +40,10 @@
>>> #include <sys/_ucontext.h>
>>> #endif
>>> 
>>> +#if __POSIX_VISIBLE >= 202405 || __BSD_VISIBLE
>>> +#define SIG2STR_MAX  32      /* size of buffer required for sig2str() */
>>> +#endif
>> 
>> Hey Warner and Ricardo,
>> 
>> The above breaks building world when _FORTIFY_SOURCE=2. I've committed
>> in HardenedBSD a fix:
>> https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/commit/0572db282c5a542fe0de52739932e91eade537ed
>> 
>> I suppose that the !defined gate might not actually be desired, since
>> doing it the way I did might cause issues if third-party code defines
>> the macro to a value smaller than what libc was built with. I might
>> remove that gate.
> 
> I don't think we need the !defined part of it...
> 
> But what software is breaking? What's the error message? Maybe the
> fact it's undefined is pointing at a different bug…

Probably include/ssp/signal.h unconditionally defining the wrapper?
Presumably gating that with the same condition as sig2str itself would
fix things properly rather than such bogus hacks.

But yes, including the actual error message when reporting a build
failure would have been helpful.

Jess


Reply via email to