You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift-corelibs-foundation uses strlcpy and strlcat functions, which are originally from BSD and not available in glibc. However, glibc 2.38 added these functions as an extension, so swift-corelibs-foundation includes a CMake check for these functions and uses them from glibc if available; otherwise, it provides its own implementation like this:
However, when the new CMakeFiles were added in c772413, this check wasn't added to the new CMakeLists.txt, so the build fails when glibc 2.38+ is used.
These checks are required because glibc 2.38+ added strlcat and strlcpy
functions. swift-corelibs-foundation should use these functions if
they are available.
The checks originally existed in commit 8d1a679,
but were not added to the new CMakeLists.txt in commit c772413.
Fixesswiftlang#5012
…itions.
While checking whether the system provides the `strlcat` and `strlcpy`
functions, using an autoconf-style check to determine their availability
does not seem to be a good idea. This is because the code is also
used with SwiftPM, which does not have a similar feature test.
Instead, we should directly check the availability of these functions
in the system.
Given that `strlcpy` and `strlcat` are not standard C functions,
we should check whether the system is macOS, Linux with Bionic or
Musl libc, or glibc version 2.38 or later. This patch adds the necessary
checks in the header file so that SwiftPM can use these checks as well.
Fixesswiftlang#5012
swift-corelibs-foundation uses
strlcpy
andstrlcat
functions, which are originally from BSD and not available in glibc. However, glibc 2.38 added these functions as an extension, so swift-corelibs-foundation includes a CMake check for these functions and uses them from glibc if available; otherwise, it provides its own implementation like this:See 8d1a679 and 48076cb for more details.
However, when the new CMakeFiles were added in c772413, this check wasn't added to the new CMakeLists.txt, so the build fails when glibc 2.38+ is used.
For example, see my build log at https://download.copr.fedorainfracloud.org/results/leebc/swift-lang-main/fedora-40-x86_64/07741791-swift-lang/builder-live.log.gz. The build failed with:
Details
We should add the check for strlcpy and strlcat functions in the new CMakeLists.txt as well.
The text was updated successfully, but these errors were encountered: