Bug 281521 - security/libretls: fix build with clang 19
Summary: security/libretls: fix build with clang 19
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Baptiste Daroussin
URL:
Keywords:
Depends on:
Blocks: 280562
  Show dependency treegraph
 
Reported: 2024-09-15 16:54 UTC by Dimitry Andric
Modified: 2024-09-17 07:32 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (bapt)


Attachments
security/libretls: fix build with clang 19 (1.56 KB, patch)
2024-09-15 16:55 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2024-09-15 16:54:23 UTC
Clang 19 has become more strict about function redefinitions, which
results in:

  compat/arc4random.c:197:1: error: redefinition of 'arc4random_buf'
    197 | arc4random_buf(void *buf, size_t n)
        | ^
  /usr/include/ssp/stdlib.h:38:22: note: previous definition is here
     38 | __ssp_redirect(void, arc4random_buf, (void *__buf, size_t __len),
        |                      ^

The problem is that the configure script "detects" arc4random_buf just
fine, due to the ports system passing ac_cv_func_arc4random_buf=yes, but
it also has an overriding part:

  # fork detection missing, weak seed on failure
  # https://svnweb.freebsd.org/base/head/lib/libc/gen/arc4random.c?revision=268642&view=markup
  USE_BUILTIN_ARC4RANDOM=yes

I think both of these are no longer true, so delete these lines in
post-patch, which ensures that compat/arc4random.c is _not_ compiled at
all.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-09-15 16:55:50 UTC
Created attachment 253587 [details]
security/libretls: fix build with clang 19
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2024-09-17 07:32:34 UTC
fixed another way, thank ;)